[example] Compiling 2.6.32 kernel in Slackware 64
Originally Posted in my BLOG
Please Note: You should atleast read Alien_Bob's [Eric Hameleers] Guide once if you are new to kernel compiling. I always refer this guide to people who just started kernel compiling since it's very well-written and explained in details. Here is the link.
This is my second kernel compile guide [actually more like a report of my experience]. A few things I did differently than last time, so instead of updating the previous guide I thought of creating a new one. So, here goes.
Get root privilege by using su, then continue.
Now your linux directory points to your newly extracted kernel tree source.
I am not going to link my kernel config here as many people previously asked me why their kernel config didn't work, it's not supposed to! Your hardware is different than mine and my .config will be different than yours. So you must understand what to enable or disable in your own kernel config. Or just use:
Now run:
Now you can strip off your kernel and fine tune your config. Remove support for what you don't need and select accordingly. Read more about it here.
Now run :
Carefully check out each sections to see if localmodconfig stripped off something which you need.
WARNING: My USB Mass storage device support and Intel Sound card support was stripped off by localmodconfig and hence I had to recompile kernel again with those support re-enabled.
Now scroll all the way down and select load kernel configuration and press enter to select the .config.
This will take a while, meanwhile open another tab and configure lilo.
Scroll all the way down and copy the existing linux entry. Just change the part which says /boot/vmlinuz to /boot/bzImage and then add another line just below it called initrd. Here’s my entry:
Remember to replace /dev/hda3 with your own root partition. Yes yes, I know we haven’t created an initrd image yet. Patience! Just save and exit for now.
Now that make is over run:
You may copy over the config file to /boot but I see now use for that and hence I skipped it.
Anyways, now for the next step, you are own your own since it depends on what partition type you are using. I use ext3 throughout and have no separate partition for /boot and hence this is how I generated my initrd image. Please refer to /boot/README.initrd file for details!
If you get a warning about LBA32 just add “lba32″ in your lilo.conf and re-run lilo. And now reboot into your new kernel!
Good Luck
Please Note: You should atleast read Alien_Bob's [Eric Hameleers] Guide once if you are new to kernel compiling. I always refer this guide to people who just started kernel compiling since it's very well-written and explained in details. Here is the link.
This is my second kernel compile guide [actually more like a report of my experience]. A few things I did differently than last time, so instead of updating the previous guide I thought of creating a new one. So, here goes.
Get root privilege by using su, then continue.
Code:
# cd /usr/src/ # rm -rf linux # wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.tar.bz2 # tar xvfj linux-2.6.32.tar.bz2 # ln -s /usr/src/linux-2.6.32 /usr/src/linux
I am not going to link my kernel config here as many people previously asked me why their kernel config didn't work, it's not supposed to! Your hardware is different than mine and my .config will be different than yours. So you must understand what to enable or disable in your own kernel config. Or just use:
Code:
# cp /usr/src/linux-2.6.29.6/.config /usr/src/linux
Code:
# make localmodconfig
Now run :
Code:
# make menuconfig
WARNING: My USB Mass storage device support and Intel Sound card support was stripped off by localmodconfig and hence I had to recompile kernel again with those support re-enabled.
Now scroll all the way down and select load kernel configuration and press enter to select the .config.
Code:
# make
Code:
# nano /etc/lilo.conf
Code:
image = /boot/bzImage initrd = /boot/initrd.gz root= /dev/hda3 label = Linux read-only
Now that make is over run:
Code:
# make modules_install # cp arch/x86_64/boot/bzImage /boot/bzImage # cp System.map /boot/System.map.new # rm /boot/System.map # ln -s /boot/System.map.new /boot/System.map
Anyways, now for the next step, you are own your own since it depends on what partition type you are using. I use ext3 throughout and have no separate partition for /boot and hence this is how I generated my initrd image. Please refer to /boot/README.initrd file for details!
Code:
# mkinitrd -c -k 2.6.32~pdg -m mbcache:jbd:ext3 -f ext3 -r /dev/hda3 # cd /etc/rc.d # rm rc.modules # cp rc.modules-2.6.29.6-smp rc.modules-2.6.32~pdg # ln -s /etc/rc.d/rc.modules-2.6.32~pdg /etc/rc.d/rc.modules # lilo
Good Luck
Total Comments 0