Added script

This commit is contained in:
dbroqua 2018-08-26 20:51:00 +02:00
parent 9cf11ab645
commit 362c9355b7
2 changed files with 39 additions and 1 deletions

View file

@ -1,3 +1,5 @@
# pkgkernel
Simple command line for compile new kernel on Debian
Based on https://debian-facile.org/doc:systeme:kernel:compiler

36
pkgkernel.sh Executable file
View file

@ -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"