summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpks <pks@pks.rocks>2021-05-16 18:01:05 +0200
committerpks <pks@pks.rocks>2021-05-16 18:01:05 +0200
commitd41104e0b9503f3cee7024a9828b4228264b5413 (patch)
tree934b4bd14ff4352ebb9e58dd602adc57b708fb04
parent8464e5bce46eea782ca16bfa037bffd4176ca33e (diff)
build-and-install script
-rwxr-xr-xscripts/build-and-install44
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/build-and-install b/scripts/build-and-install
new file mode 100755
index 0000000..0bd0314
--- /dev/null
+++ b/scripts/build-and-install
@@ -0,0 +1,44 @@
+#!/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 + lilo
+sudo cp -v arch/x86/boot/bzImage /boot/kernel
+sudo md5sum /boot/kernel > /tmp/kernel.md5
+sudo mv /tmp/kernel.md5 /boot/kernel.md5
+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
+
+# tp smapi
+cd ~/.local/src/kernel/tp_smapi/
+sudo make HDAPS=0 install KVER=$V KSRC=/home/pks/.local/src/kernel/linux-$V KBUILD=/home/pks/.local/src/kernel/linux-$V
+sudo make clean
+
+# phc intel
+cd ~/.local/src/kernel/phc_intel/
+KERNELRELEASE=$V KERNELSRC=../linux-$V make
+sudo make install
+make clean
+sudo depmod
+
+sudo chown -R pks:pks * .* ~/.local/src/kernel/tp_smapi/ ~/.local/src/kernel/linux-*