Copy the file
/usr/src/linux/arch/i386/boot/bzImagefrom the kernel source tree to the/bootdirectory, and give it an appropriate new name.[root@deep ] /linux#cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-kernel.version.numberAn appropriated or recommended new name is something like vmlinuz-2.2.14, this is important if you want a new rescue floppy or emergency boot floppy using the mkbootdisk program that require some specific needs like for example: vmlinuz-2.2.14 instead of vmlinuz-2.2.14.a
Copy the file
/usr/src/linux/System.mapfrom the kernel source tree to the/bootdirectory, and give it an appropriate new name.[root@deep ] /linux#cp /usr/src/linux/System.map /boot/System.map-kernel.version.numberMove into the
/bootdirectory and rebuild the links tovmlinuzandSystem.mapwith the following commands:[root@deep ] /linux#cd /boot [root@deep ] /boot#ln -fs vmlinuz-kernel.version.number vmlinuz [root@deep ] /boot#ln -fs System.map-kernel.version.number System.mapWe must rebuild the links of
vmlinuzandSystem.mapto point them to the new kernel version installed. Without the new links LILO program will look by default for the old version of your Linux kernel.Remove obsolete and unnecessary files under the
/bootdirectory to make space:[root@deep ] /boot#rm -f module-info [root@deep ] /boot#rm -f initrd-2.2.xx.imgThe
module-infolink point to the old modules directory of your original kernel. Since we have installed a brand new kernel, we don't need to keep this broken link. Theinitrd-2.2.xxis a file that contains an initial RAM disk image that serves as a system before the disk is available. This file is only available and is installed from the Linux setup installation if your system has a SCSI adapter present. If we use and have a SCSI system, the driver now will be incorporated into our new Linux kernel since we have build a monolithic kernel, so we can remove this fileinitrd-2.2.xx.imgsafely.Create a new Linux kernel directory that will handle all header files related to Linux kernel for future compilation of other programs on your system. Recall, we had created two symlinks under the
/usr/include directory that point to the Linux kernel to be able to compile it without receiving error and also be able to compile future programs. The/usr/includedirectory is where all header files of your Linux system are kept for reference and dependencies when you compile and install new programs. The asm, and linux links are used when program need to know some functions from compile-time specific to the kernel installed on your system. Programs call other headers in the include directory when they must know specific information, dependencies, etc. of your system.[root@deep] /#mkdir -p /usr/src/linux-2.2.14/include [root@deep] /#cp -r /usr/src/linux/include/asm-generic /usr/src/linux-2.2.14/include [root@deep] /#cp -r /usr/src/linux/include/asm-i386 /usr/src/linux-2.2.14/include [root@deep] /#cp -r /usr/src/linux/include/linux /usr/src/linux-2.2.14/include [root@deep] /#cp -r /usr/src/linux/include/net /usr/src/linux-2.2.14/include [root@deep] /#cp -r /usr/src/linux/include/video /usr/src/linux-2.2.14/include [root@deep] /#cp -r /usr/src/linux/include/scsi /usr/src/linux-2.2.14/include [root@deep] /#rm -rf /usr/src/linux [root@deep] /#cd /usr/src [root@deep ] /src#ln -s /usr/src/linux-2.2.14 linuxFirst we create a new directory named
linux-2.2.14based on the version of the kernel we have installed for easy interpretation, then we copy directories asm-generic, asm-i386, linux, net, video, and scsi from/usr/linux/includeto our new place/usr/src/linux-2.2.14/include. After We remove the entire source directory where we had compiled the new kernel, create a new symbolic link namedlinuxunder/usr/srcthat points to our new/usr/src/linux-2.2.14/includedirectory. With these steps, future compiled programs will know where to look for headers related to the kernel on your server.
This step will allow us to gain space on our hard drive and will reduce the risk of security. The Linux kernel source directory handles a of lot files and is about 75 MB in size when uncompressed. With the procedure described above, our Linux kernel directory began approximately 3 MB in size so we save 72 MB for the same functionalities.
Finally, you need to edit the
/etc/lilo.conffile to make your new kernel one of the boot time options:Edit the
lilo.conffile - vi/etc/lilo.confand make the appropriated change on the line that readimage=/boot/.[root@deep] /#vi /etc/lilo.conf
boot=/dev/sda
map=/boot/map
install=/boot/boot.b
prompt
timeout=00
restricted
password=somepasswd
image=/boot/vmlinuz-kernel.version.number #add your new kernel name file here.
label=linux
root=/dev/sda6
read-only
Don't forget to remove the line that read
initrd=/boot/initrd-2.2.12-20.imgin thelilo.conffile, since this line is not necessary now monolithic kernel doesn't need an initrd file.Once the name of the new kernel version has been put in the
lilo.conffile as shown above, we update ourlilo.conffile for the change to take effect with the following command:[root@deep] /#/sbin/lilo -v
LILO version 21, [Copyright 1992-1998 Werner Almesberger
Reading boot sector from /dev/sda
Merging with /boot/boot.b
Boot image: /boot/vmlinuz-2.2.14
Added linux *
/boot/boot.0800 exits no backup copy made.
Writing boot sector.
If you say
NOto the configuration option Unix98 PTY supportCONFIG_UNIX98_PTYSduring your kernel configuration, you must edit the/etc/fstabfile and remove the line that read:none /dev/pts devpts gid=5,mode=620 0 0