From 362c9355b7c9814df8004799b89a1157daa30469 Mon Sep 17 00:00:00 2001 From: dbroqua Date: Sun, 26 Aug 2018 20:51:00 +0200 Subject: [PATCH] Added script --- README.md | 4 +++- pkgkernel.sh | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100755 pkgkernel.sh diff --git a/README.md b/README.md index 611352e..907a451 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # pkgkernel -Simple command line for compile new kernel on Debian \ No newline at end of file +Simple command line for compile new kernel on Debian + +Based on https://debian-facile.org/doc:systeme:kernel:compiler diff --git a/pkgkernel.sh b/pkgkernel.sh new file mode 100755 index 0000000..1ecdce2 --- /dev/null +++ b/pkgkernel.sh @@ -0,0 +1,36 @@ +#! /bin/bash + +GREEN='\033[0;32m' +DEFAULT='\033[0m' +EXTENSION='.tar.xz' +KERNEL=`echo ${1}|cut -d"-" -f 2` + +# Get kernel version from argument +KERNEL=${KERNEL%$EXTENSION} + +# Extract kernel archive +tar xavf ${1} + +# Enter kernel directory +cd linux-${KERNEL} + +# Get old config +make olddefconfig + +# Some optimizations +./scripts/config -d CONFIG_MODULE_SIG_ALL -d CONFIG_MODULE_SIG_KEY -d CONFIG_SYSTEM_TRUSTED_KEYS +./scripts/config -d CONFIG_DEBUG_INFO + +# Compile kernel +make deb-pkg -j"$(nproc)" LOCALVERSION=-"$(dpkg --print-architecture)" KDEB_PKGVERSION="$(make kernelversion)-1" + +# Optimization +make bindeb-pkg -j"$(nproc)" LOCALVERSION=-"$(dpkg --print-architecture)" KDEB_PKGVERSION="$(make kernelversion)-1" + +# Go to parent directory +cd .. + +# Install new packages +dpkg -i *${KERNEL}*.deb + +echo -e "${GREEN} ALL DONE!\n"