|
Post by thatnerdjosh on Jul 13, 2024 11:12:24 GMT
(Please excuse the formatting, it was originally written in Markdown and then converted to BBCode) Environment SetupBased on and extended from the Official Ubuntu Documentation. Setup Build EnvironmentPull Kernel Sourcesexport KERNEL_FULL_VERSION=$(uname -r) export KERNEL_VERSION=$(uname -r | cut -d - -f1) sudo apt-get build-dep linux-image-`uname -r` sudo apt -y install linux-source-$KERNEL_VERSION Copy Sources to Build Directorymkdir -p ~/kernel && cd ~/kernel tar xjvf /usr/src/linux-source-$KERNEL_VERSION.tar.bz2 cd linux-source-$KERNEL_VERSION Configure Permissionssudo chmod a+x /usr/src/linux-source-$KERNEL_VERSION/debian/scripts/* sudo chmod a+x /usr/src/linux-source-$KERNEL_VERSION/debian/scripts/misc/* Copy Configif [ -f "/boot/config-$KERNEL_FULL_VERSION" ]; then cp -vi /boot/config-$KERNEL_FULL_VERSION .config else echo "Warning: /boot/config-$KERNEL_FULL_VERSION not found. Using default configuration." fi
sed -i -e '/CONFIG_SYSTEM_TRUSTED_KEYS=/ s/=.*/=""/' .config sed -i -e '/CONFIG_SYSTEM_REVOCATION_KEYS=/ s/=.*/=""/' .config Pull Dependenciessudo apt-get install rsync libncurses5 libncurses5-dev pahole Configure and Build KernelPrepare Envcd /usr/src/linux-source-$KERNEL_VERSION
sudo fakeroot debian/rules clean
# quicker build: sudo fakeroot debian/rules binary-headers binary-generic binary-perarch Build .deb Packages for KernelAt this point, you should be able to configure the kernel in the way most comfortable for you. Refer to the kernel.org Documentation on configuration editing. After configured, run the following: cd ~/kernel/linux-source-$KERNEL_VERSION make -j3 bindeb-pkg References* kernel.org Documentation* Official Ubuntu Documentation
|
|