|
skyPipes Manual Index |
|
skyPipes Installation Manual |
|
|
Julian Anastasov's Linux Kernel Patches |
|
|
The Linux Kernel HOWTO by Al Dev |
/root/skybuilders/patches/ directory (appropriate patches for Linux 2.2 and 2.6 are also available in version-named subdirectories), and its name looks like routes-x.x.xx-x.diff. The official site for the routes patch is Julian Anastasov's Linux Kernel Patches, and new versions, deeper help, and news can be found there.
- Change directory to the kernel source code directory,
/usr/src/linux/:
# cd /usr/src/linux/ - Patch the kernel using the
patchcommand, pointing it at the patch file (this will output about 32 lines):
# patch -p1 < /root/skybuilders/patches/routes-2.4.20-9.diff
First, an overview of the necessary steps.
- Clean
- Copy boot config file
- Configure
- Dep
- Uniquely name the new kernel
- Do make
- Loadable Modules
- Wait - for compile to complete
- bzImage
- Config Grub
- Reboot and test new kernel
- Change directory to the kernel source code directory,
/usr/src/linux/:
# cd /usr/src/linux/ - Make a new directory,
/usr/src/kernelconfigs/:
# cd /usr/src/kernelconfigs/ - Back up the config file (this may fail; don't worry, just move on to the next step):
# cp /usr/src/linux/.config /usr/src/kernelconfigs/.config.save - Back up the config file again (this may fail; don't worry, just move on to the next step) [Extra Safe]:
# cp /usr/src/linux/.config /usr/src/linux/configs/.config.save - Back up the boot config files [Extra Safe]:
# cp /boot/config* /usr/src/linux/configs/ - Do the clean (make sure all three lines are run in this order):
# make clean
# make mrproper
# make clean - Restore the config (this may fail; don't worry, just move on to the next section):
# cp /usr/src/kernelconfigs/.config.save .config
- Copy the boot configuration file, to retain settings chosen during installation:
# cp /boot/config-2.4.20-8 /usr/src/linux/.config
- Set terminal (use 'xterm' instead of 'vt100' if running from X instead of CLI):
# export TERM=vt100 - run config (this will load an application for managing the configuration process):
# make menuconfig - Select the option that says "Load Configuration From File". This will raise a dialog box. Enter:
/usr/src/linux/.config - Make sure that the following choices are made properly:
Select the proper CPU type
Select SMP support - single or multiple processors (it should default to single)
File systems loaded as part of the kernel (this may only be offered as a Module - don't worry about it if so)
Enable Loadable Modules
And MOST IMPORTANTLY:
Under Networking > Networking Options > IP: Advanced Router, enable IP: equal cost multipath
Also (to enable NAT) under Networking > Networking Options &62; Network packet filtering framework (Netfilter) > Core Netfilter Configuration, enable Netfilter connection tracking support - Save and Exit. Just exiting does this. All selected options will now have been saved into
/usr/src/linux/.configand if there are any problems, check.menuconfig.login the same directory
- Run Dep:
# make dep
- Edit the file
/usr/src/linux/Makefilein your favorite editor. Look for:
EXTRAVERSION = -8
and change it to something like:
EXTRAVERSION = -8skypipes.20031104
but with the current date. - Save and exit.
nohup command is used in this section. From the nohup man page: "run a command immune to hangups, with output to a non-tty". The tail command is used to monitor the copious output as it appears in nohup.out; go on to the next step while it runs. Once make completes, the file /usr/src/linux/arch/i386/boot/bzImage will contain the newly compiled kernel.
- Now the
makecommand (man nohupfor more info):
# nohup make bzImage &
# tail -f nohup.out
The nohup command is also used in this section. The call is more complicated, however, by having to specify error and output files, so as not to overwrite the ones currently in use by the prior nohup instance, which should be running concurrently. The tail command is once again used to monitor progress. This too will take quite awhile, so move on to the next section, leaving this nohup running.
- Make Modules:
# nohup make modules 1> modules.out 2> modules.err &
# tail -f modules.out
. . .
Welcome back! Now examine the output and error files for anything that may have gone wrong. If there's anything wrong, try to fix it and recompile using the instructions above. Otherwise, install the modules.
- Check log output:
# less nohup.out
# less modules.err
# less modules.out - If there are no apparent errors, continue by installing the modules:
# make modules_install
/boot/ directory or it cannot be booted from. This is also the key opportunity to rename the bzImage so that it can be identified. Be sure to use the current date rather than the date in the example below. Likewise, the config file must also be copied and renamed. Then the initrd (boot loader initialized RAM disk) file must be created and copied for use in GRUB (GRand Universal Bootloader).
- Copy bzImage to
/boot/:
# cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage.skypipes.20031104 - Copy config to
/boot/:
# cp /usr/src/linux/.config /boot/config-2.4.20-8.skypipes.20031104 - Make initrd file:
# mkinitrd ./initrd-2.4.20-8skypipes.20031104.img 2.4.20-8skypipes.20031104 - Copy initrd file:
# cp ./initrd-2.4.20-8skypipes.20031104.img /boot/
- Back up
/etc/grub.conf:
# cp /boot/grub/grub.conf /boot/grub/grub.conf.orig - Open
/etc/grub.confin your favorite editor. Find the section that looks like:
title Red Hat Linux (2.4.18-14)
root (hd0,0)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ hdd=ide-scsi
initrd /initrd-2.4.18-14.img
Insert a section before it that has a title that refers to the new kernel, replaces the vmlinuz reference with the name of the new bzImage file, and replaces the initrd reference with the name of the new initrd file. Like this:
title Red Hat Linux (2.4.20-8skypipes-20031104)
root (hd0,0)
kernel /bzImage.skypipes.20031104 ro root=LABEL=/
initrd /initrd-2.4.20-8skypipes.20031104.img
- Reboot the machine:
# shutdown -r now
Copyright © 2003 Derek Doyle <dtd@skybuilders.com>.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".




