cp vmlinuz-2.4.2-2 vmlinuz.save
cp bzImage /boot/vmlinuz-X.X.XX-Xwhere the X's represent the current kernel version.
default=0 timeout=10 splashimage=(hd0,0)/grub/splash.xpm.gz title Red Hat Linux (2.4.20-8) root (hd0,0) kernel /vmlinuz-2.4.20-8 ro root=/dev/md1 hdb=ide-scsi initrd /initrd-2.4.20-8.img title Red Hat Linux (2.4.22-2) root (hd0,0) kernel /vmlinuz-2.4.22-2 ro root=/dev/md1 hdb=ide-scsi initrd /initrd-2.4.22-2.img
unable to handle kernel paging request at address C0000010 Oops: 0002 EIP: 0010:LLLLLLLL eax: xxxxxxxx ebx: xxxxxxxx ecx: xxxxxxxx edx: xxxxxxxx esi: xxxxxxxx edi: xxxxxxxx ebp: xxxxxxxx ds: xxxx es: xxxx fs: xxxx gs: xxxx Pid: xx, process nr: xx xx xx xx xx xx xx xx xx xx xxthe LLLLLLLL values tells you where in the kernel it had a problem.
nm vmlinuz | sort | less
You decide that you need to upgrade your kernel to the latest version. So you go to the kernel mirror list, and pick a good place to download the kernel. You go to the kernel directory and see a list of kernel versions. 2.4 is the largest number so you check there. The README file makes it clear that this version is not ready for prime time, so you try 2.3. The latest version is 2.3.99-pre9:
.rhkmvtag cdrom/ ipv4/ modules.dep pcmcia/ video/ block/ fs/ misc/ net/ scsi/
aztcd.o cm206.o isp16.o mcdx.o sbpcd.o sonycd535.o cdu31a.o gscd.o mcd.o optcd.o sjcd.o
The module configuration is found in /etc/modules.conf. Older Linux versions use conf.modules and it will still be used if modules.conf is not present.
A typical module configuration file might be:
alias eth0 eepro100 alias usb-controller usb-uhci alias eth0 tulip
When the system boots, it loads the modules specified by modules.conf. Modules can also be managed manually.
lsmod lists all currently loaded modules.
insmod will install a loadable kernel module.
insmod /lib/modules/2.2.12-20/scsi/aha152x.o
insmod -f -o aha1527 /lib/modules/2.2.12-20/scsi/aha152x.o
modinfo will output information about a module file
depmod outputs a set of dependencies based on the set of modules mentioned on the command line or in a default place (/lib/modules/) and places the dependency file in a known place (/lib/modules/version/modules.dep).
modprobe takes the dependency list created by depmod and loads the appropriate modules. For example, this is done in /etc/rc.d/rc.sysinit
lsmod lists all currently loaded modules.
You decide to go for a nice SCSI tape drive on your system. Unfortunately, the manufacturer doesn't provide Linux drivers. So you look on the web and find a site like HREF="http://lhd.zdnet.com/lhd_press_drivers.html">zdnet that has quite a few drives and lo, there it is. They have a loadable kernel module for your controller. Download the file (probably a tar file), untar it and put the output (.c and .h files) in /usr/src/linux-X.X/drivers/scsi (where your current linux source tree resides). A module might also come as a patch as discussed later.
Since its a module, check to make sure that you have enabled loadable modules in your kernel configuration. If not, rebuild it. If you install the modules, it should be in /lib/modules/your-version-number in the the scsi subdirectory.
Now, you can enter:
The initrd files that you commonly see in the /boot directory and referenced in the grub.conf file are RAM disk files. That is, they are images that can be loaded directly into memory to complement the kernel that is to be booted. They contain things (usually modules) that need to be loaded before the kernel can run. For example, if you have a SCSI disk and your kernel doesn't have the SCSI functionality compiled in, you can force the necessary driver modules to be loaded into memory and be available to load the kernel from the disk.
mkinird is the command used to create initrd files. It will automatically load anything mentioned in /etc/modules.conf as well as the default SCSI modules. There are two options for adding another module; with for adding modules to be loaded after the SCSI modules, and preload for modules to be loaded before the SCSI modules. For example,
which creates an initrd image named initrd-test.img, based on the 2.4.20 kernel (which has to be present) and in addition to the default contents, also preloads the hpt366 driver and postloads mymodule.
Interestingly, an initrd image is simply a compressed file image, so you can add things to the file system directly. For example,
You will find a number of things, including the modules you want loaded under the lib directory. Once mounted like this, you can add modules and other features if you so desire. Then,
Kernel upgrades are often done with patches. A patch is a set of diff files. diff is a program that will compare two files and output the differences on a line-by-line basis. If you have an old file and a set of differences between the old file , you can upgrade the old file to be a duplicate of the new file. Kernel patches have the diff files between different versions or mods and when applied, can upgrade the kernel.
but the usual form is:
For example, in the situation above, we have /usr/src/linux-2.4 contains our current version, and we want to patch it with the data we put in directory patch-2.4.26-rc2. So we would do the following:
The -p1 option tells patch how to process filenames. The diff files directory structure will mimic the directory structure of /usr/src/linux-2.4 and patch will find files with the matching pathname to make changes. The filenames will be ../patch-2.4.26-rc2/..., but we need the files to match at the level of the patch-2.4.26-rc2. That is, if /usr/src/linux-2.4 has a file named config, then you would expect to find the same name in the patch directory at the same level. -p1 tells patch to ignore the first element in the path, so it becomes patch-2.4.26-rc2. If this directory contains a config, then we have what we need. You can think about it this way, each n in -pn removes one slash from a pathname and everything in front of it.
After executing the patch command, the kernel is ready to be rebuilt. Remember to perform an mrproper.
uname -r 2.2.13-7mdk mkbootdisk 2.2.13-7mdk Insert a disk in /dev/fd0. Any information on the disk will be lost. Pressto continue or ^C to abort. mount -text2 /dev/fd0 /mnt/floppy ls ./ ../ boot/ dev/ etc/ initrd.img lost+found/ vmlinux-2.2.13-7mdk