Here you will see how to build Debian deb package for linux kernel source.
Install Tools
First of all install few tools:
apt-get install kernel-package libncurses5-dev fakeroot bzip2 build-essential
Prepare Working Directory
- Add users to group src:
usermod -a -G src user1
- Ensure group src is the owner of /usr/src:
chgrp -R src /usr/src
chmod g+s /usr/src
chmod -R g+w /usr/src
Download Kernel Source
- Change your working directory to /usr/src/:
cd /usr/src
- Download kernel source from kernel.org:
wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.tar.bz2
- Decompress kernel source and create a symbolic link:
tar xjf linux-2.6.36.tar.bz2
test -L linux && rm linux
ln -s linux-2.6.36 linux
cd linux
Configure Kernel
- Let use existing kernel configuration as a start point:
cp /boot/config-`uname -r` /usr/src/linux/.config
- Launch kernel configuration tool:
make menuconfig
- Start kernel build (this may take from 20 mins to few hours depending on your hardware and number of CPUs):
time fakeroot make-kpkg -j 2 --initrd --append-to-version=-custom kernel_image kernel_headers
- Once build finishes you should get two .deb files in parent directory:
deby01:/usr/src$ ls -l *.deb
linux-headers-2.6.36-custom_2.6.36-custom-10.00.Custom_amd64.deb
linux-image-2.6.36-custom_2.6.36-custom-10.00.Custom_amd64.deb
Install Kernel
- Install linux kernel and image deb packages by issuing the following command:
dpkg -i *.deb
- Restart your computer:
shutdown -r now
- Once it restarts check the kernel version you are using:
deby01:~$ uname -r
2.6.36-custom
Enjoy your custom kernel.
No comments :
Post a Comment