WebHostGear.com - the hosting resource for professionalshosting tutorials 
hosting howto webhost guide server managementMarch 13, 2010
server management, apache tutorials, hosting tutorials, cpanel, server security
Home / Hosting Tutorials / Server Security / Compile 2.6.7 Kernel w/module-init-tools

Compile 2.6.7 Kernel w/module-init-tools



Printer Friendly Printer Friendly Send to a friend Send to a friend
By : Rack911 Rating : Average Rating : 9.00 From 18 Voter(s)

Compiling the kernel

Wanted to try out the 2.6 edition kernel? Never knew how to do it? Well heres how! Includes everything from compiling the kernel to configuring your bootloader.

Lets Begin!

cd /usr/src
wget -c http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.7.tar.bz2
tar xvfj linux-2.6.7.tar.bz2
cd linux-2.6.7
make clean && make mrproper
make oldconfig  ( or make menuconfig )
make bzImage
make modules
make modules_install

( i prefer this method rather then just "make" )

If you get alot of errors about .ko modules when you run make modules_install you need to update your modutils package with module-init-tools, see below.

Now to copy the files over for the kernel itself.

cp .config /boot/config-2.6.7
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.7
cp System.map /boot/System.map-2.6.7
mkinitrd /boot/initrd-2.6.7.img 2.6.7



Article provided by WebHostGear.com

You may experience an error such as this:

/dev/mapper/control: open failed: No such file or directory

if you receive that error run the following commands:

rm -rf /boot/initrd-2.6.7.img
mkinitrd --omit-lvm-modules /boot/initrd-2.6.7.img 2.6.7

Now to add it to the grub / lilo configuration.

[Grub]

Your config will look something like this. Please note you need to follow the format for your current config.

title Red Hat Linux (2.6.7)
root (hd0,0)
kernel /vmlinuz-2.6.7 ro root=LABEL=/
initrd /initrd-2.6.7.img

Add your new entry to the top of the kernel list. Set the default to your working kernel. NOTE: the first kernel in the list is "0". (ex. default=1)

Now exit. Type "grub" at the bash prompt.

savedefault --default=0 --once

issue that at the grub prompt then use quit to exit. Once your reboot you need to go back in and set the default to the 2.6 kernel by setting default=0

[lilo]

Your config will look something like this. Please note you need to follow the format for your current config.

image=/boot/vmlinuz-2.6.7
label=2.6.7
append="root=LABEL=/"
read-only
initrd=/boot/initrd-2.6.7.img

Leave the default as is.

/sbin/lilo -v -v
/sbin/lilo -R 2.6.7

Once it reboots and comes back online you can change the default to be 2.6.7 and /sbin/lilo -v -v

The above tells you how to enable failsafe in your kernels. SO that if the box panics the dc tech does not have to console in he just has to reboot the box.

How to install module-init-tools:

cd /usr/src
wget -c
http://www.kernel.org/pub/linux/kernel/people/rusty/modules/module-init-tools-3.0.tar.gz
tar -zxvf module-init-tools-3.0.tar.gz
cd module-init-tools-3.0
./configure --prefix=""
make moveold
make install
./generate-modprobe.conf /etc/modprobe.conf

How to determine what boot loader you are using?

dd if=/dev/hda bs=512 count=1 2>&1 | grep GRUB
dd if=/dev/hda bs=512 count=1 2>&1 | grep LILO

one of them will kick back something like:

root@w00t [~]# dd if=/dev/hda bs=512 count=1 2>&1 | grep GRUB
Binary file (standard input) matches
root@w00t [~]#

which means its using grub.

New! - Need server help? Hire an Expert

Get professional help with your configuration, script installation or server issue.
Learn how we can help you with any server problem and make your server run like new. Professional staff will contact you, after submitting a quote request, by phone or email.

Rate this Article :

1

2

3

4

5

6

7

8

9

10
Poor Excellent

Related Articles


Disable Direct Root Logins
Guide to Chkrootkit - checking for intruders
Upgrade Guide From Red Hat 7.3 to 9.0
Securing Your /tmp Partition with Cpanel/WHM
Common SSH Commands - Linux Shell Commands
Linux 2.4 Kernel Exploit in Wild
How to install BFD (Brute Force Detection)
How to install APF (Advanced Policy Firewall)
How to install mod_security for Apache
Updated kernel packages resolve security vulnerabilities
How to Disable Telnet


Discuss this article with others in our new hosting forums

Comments / Feedback

r007

/boot/config-2.4.20-8:2130: trying to assign nonexistent symbol DEBUG_IOVIRT
/boot/config-2.4.20-8:2133: trying to assign nonexistent symbol DEBUG_BU

I get tons of errors like that, any help?
Tom
Does this work on Fedora?
mohamed
tom / i have install it on FC1 and it run :)
JLChafardet
definatelly this isnt as easy at it seems, all that y m n ? drove me krazy, hope to do not crash my box LOL
fusion
i think if you press just enter it picks the best option

 Add Comment
Name
Email
Image Code
Refresh Image

Comments / Feedback



Our site offers free hosting tutorials, cpanel tutorial, web hosting news, shell commands, running a web hosting business, dedicated guides, linux tutorial, apache install, home web server, web server guide, ssh commands, dedicated servers, DNS nameservers, chkrootkit, apf firewall, exim configuration, server compromised, cron backup solution, ftp backup script

Server Tutorials


WebHostGear Reviewed by Ping Zine - Click here

Links:
Lunarpages Coupon