summaryrefslogtreecommitdiff
path: root/scripts/build-and-install
blob: c52a458b9accc76534315a7591f29d6b3bd8717b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh

if [ ! -f .config ]; then
  echo "Call from kernel source dir!"; exit
fi

V=`pwd | ruby -e "puts STDIN.gets.split('/').last.split('-')[1..-1].join '-'"`;
echo "Building Kernel @$V"

make mrproper
cp -v ../config .config
make -j $(nproc)

# modules
# FIXME: This will fail when there already exists a directory for version $V
sudo make modules_install
sudo ln -s /lib/modules/$V-* /lib/modules/$V

# cp to /boot + run lilo
sudo cp -v arch/x86/boot/bzImage /boot/kernel
sudo sha1sum /boot/kernel > /tmp/kernel.sha1
sudo mv /tmp/kernel.sha1 /boot/kernel.sha1
sudo /sbin/lilo

# /usr/src/linux symlink
sudo rm /usr/src/linux
find . -type d | xargs chmod a+rx
find . -type f | xargs chmod a+r
find . -executable | xargs chmod a+x
sudo ln -s $(pwd) /usr/src/linux

pushd .

# tp smapi
cd ../extra_modules/tp_smapi/
sudo make HDAPS=0 install KVER=$V KSRC=/usr/src/linux KBUILD=../../linux-$V
sudo make clean

# phc intel
cd ../phc_intel/
KERNELRELEASE=$V KERNELSRC=/usr/src/linux make
sudo make install
make clean
sudo depmod

popd

sudo chown -R pks:pks * .* ../extra_modules