Gnuru.org
Productive Linux


Subscribe

 Subscribe via Feedburner in a reader

Enter your email address:

Delivered by FeedBurner


Login
Login:
Password:



Don't have an account?
Sign up to Gnuru.org
Forgot your password?

Compiling A Debian Kernel
11 December 2008 @ 12:58 GMT
by Paul

Note to self.

First get the source:

apt-get install linux-source-2.2.26

Unpack the source archive and create the symlink:

cd /usr/src/
tar jxf linux-source-2.2.26.tar.bz2
ln -s linux-source-2.2.26 linux
cd linux

Don't reconfigure manually, get your old config:

zcat /proc/config.gz > .config

Compile your version with the wonderful fakeroot command:

fakeroot make-kpkg --initrd --revision=anumber kernel_image

Install it:

sudo dkpg -i ../linux-image-2.6.26_anumber_i386.deb 

And reboot.

Red Hat Certified Technician & Engineer (RHCT and RHCE) Training Guide and Administrator's Reference

Tags: kernel debian


Ah, this doesn't work with a standard Debian kernel, at least not on the systems where I've tried it:

desktop:~$ zcat /proc/config.gz gzip: /proc/config.gz: No such file or directory desktop:~$ uname -a Linux desktop 2.6.26-1-686 #1 SMP Wed Nov 26 19:14:11 UTC 2008 i686 GNU/Linux desktop:~$ cat /etc/debian_version 5.0


Posted by lefty.crupps on 2008-12-12 17:17:44.

Stupid line-break-stealer ;)

Those command should have read thus:

desktop:~$ zcat /proc/config.gz gzip: /proc/config.gz: No such file or directory

desktop:~$ uname -a Linux desktop 2.6.26-1-686 #1 SMP Wed Nov 26 19:14:11 UTC 2008 i686 GNU/Linux

desktop:~$ cat /etc/debian_version 5.0


Posted by lefty.crupps on 2008-12-12 17:18:57.

#! /bin/sh

# Build_Kernel Ver. .000001 # Run under /usr/src. Adjust .

#Dependency Check sudo apt-get install -y --force-yes build-essential bin86 kernel-package libqt3-headers libqt3-mt-dev wget libncurses5 libncurses5-dev #Wget the kernel wget https://www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.35-rc2.tar.bz2 #Untar the kernel sudo tar -xvjf linux-2.6.35-rc2.tar.bz2 #Symbolic link the kernel directory sudo ln -s /usr/src/linux-2.6.35-rc2 linux #Apply any patches here. Repeat a Wget for the patch itself but they offer fully patched kernels now. #wget http://www.kernel.org/pub/linux/kernel//v2.6/snapshots/patch-2.6.32-rc8-git4.bz2 #Apply patch #sudo bunzip2 patch-2.6.33-git12.bz2 #sudo cp xfs.patch linux #sudo cp xfs2.patch linux cd linux #Copy the previously used config for re-use in the new kernel. sudo cp /boot/config-2.6.35-rc1 .config #Apply any patches here. 'patch -p1 < ' #sudo patch -p1 Save. sudo make xconfig #Make it clean #sudo make-kpkg clean #sleep 180 #sleep 60 #Build the new kernel.Adjust Concurrency to the CPU cores +1. Install if the build completed successfully. #Add a break here if the build didn't complete successfully or add '&& sudo dpkg -i *.deb' after the step below. We can just move out of the directory if the stage is successful. #Move files from /include/generated to /include/linux #sudo cp /usr/src/linux/incldue/generated/* /usr/src/linux/include/linux sudo CONCURRENCY_LEVEL=4 make-kpkg --initrd kernel_image kernel_headers modules_image && cd .. #Back out of the linux directory #cd .. #Install the image and headers sudo dpkg -i *.deb #Remove the Kernel Directory and downloaded bz2s. ###sleep 30 sudo rm -rf /usr/src/linux-2.6.35-rc2 && sudo rm /usr/src/linux #Symbolic Link the *new* headers directory to /lib/modules//build & source #First remove bad links if there are any. #Move .deb sudo mv *.deb /media/ubu/Goodone # sudo rm /lib/modules/2.6.35-rc2/build && sudo rm /lib/modules/2.6.35-rc2/source #Now synbolic link the new header directory to build and source. sudo ln -s /usr/src/linux-headers-2.6.35-rc2 /lib/modules/2.6.35-rc2/build && sudo ln -s /usr/src/linux-headers-2.6.35-rc2 /lib/modules/2.6.35-rc2/source #Reinstall any video,etc drivers after reboot or add a stage for envyng or something like that yourself.;)


Posted by anon on 2010-06-11 21:51:22.
Leave a comment:

Are you human?