A patch allows you to modify your kernel source code so that:
In the following example, I will show how the Win4Lin patches are applied. This should help you understand the general process, applicable to any kernel patch.
The instructions are broadly the same as given before. In this case, we will show the specific example of Win4Lin. For it to work, you must be in the directory /usr/src/linux-2.4.20-8W4L
make distclean
cp configs/kernel-2.4.20-i686.config .config
make xconfig
Then choose the desired kernel options. Apart from the ones you may have chosen before, be sure to set:
| SECTION | KERNEL OPTION |
| Loadable module support | Enable loadable module support (Y) |
| General setup | Networking support (Y) |
| PCMCIA/CardBus Support (Y), CardBus Support (Y), Other Bridge Support (All N) | |
| System V IPC (Y) | |
| Kernel support for ELF binaries (Y) | |
| Networking options | TCP/IP networking (Y) |
| File systems | ISO 9660 CD-ROM filesystem support (Y) |
| Windows application support | Include NeTraverse Win4Lin Support (Y) |
When you have finished, select the option "Save and exit".
Xconfig will tell you to check the top level Makefile (/usr/src/linux-2.4.20-8W4L/Makefile), so please do it now, and make sure - again - that the EXTRAVERSION is set to what you think it should be...! (Read step 9, above). If you keep it at EXTRAVERSION = -8, the following steps will OVERWRITE your default linux kernel, with possibly catastrophic results.
Everything OK so far? Now comes the really tedious bit -
If there are any problems during the above processes, all I can suggest is that you start again from the beginning, doing a make mrproper before make distclean and if that fails, do a "Google" search on the error string you are getting. Someone else may have run into the same problem.
Check that you have the relevant vmlinuz, initrd and System Map files in your /boot directory. For example, if your EXTRAVERSION name is -8W4L, you should see files with that suffix included in their name.
Re-point your /usr/src/linux-2.4 symlink as follows:
cd /usr/src/ rm linux-2.4 ln -s linux-2.4.20-8W4L linux-2.4
Now configure your boot loader. I use Grub, for which the relevant configuration file is /boot/grub/grub.conf. Here is an example:
default 1
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda2
# initrd /initrd-version.img
#boot=/dev/hda
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
password --md5 ******
title Red Hat Linux Win4Lin-enabled (2.4.20-8W4L)
root (hd0,0)
kernel /vmlinuz-2.4.20-8W4L ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.20-8W4L.img
title Red Hat Linux (default config 2.4.20-8)
root (hd0,0)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.20-8.img
If you are using Lilo, the syntax is different (refer to Lilo documentation) and you
must remember to run lilo before rebooting.
Now you can reboot and test your patched kernel. When you are happy that it works,
set the Grub default to 0: this will start the Win4Lin kernel, as in this example, by default.
Finally, if you are installing an application supported by the new kernel, download the application
as .rpm, tarball or (in the case of Win4Lin) an installer script and install according to the
supplier's instructions.