
This document describes how to apply the Mac-on-Linux patch
to the kernel source. Note that in general it is not necessary
to apply any patches since MOL can patch 2.2 kernels 
at runtime.


1.	Look for the patch of your favourite kernel. If it is missing, 
	then there is a fair chance one of the supplied patches 
	will apply anyway.

	In the following, it will be assumed X is the file name
	of the kernel patch (e.g. 'mol-kernel-pmac-stable.patch').
	It is also assumed that the directory of the kernel source 
	is /usr/src/linux.


2.	The following sequence will test (without actually doing
	anything) if the patch applies:

		cd Doc/Kernel_Patches
		patch --dry-run -d /usr/src/linux -p0 < X

	If no FAILUREs are reported, then go ahead and apply
	the patch:

		patch -d /usr/src/linux -p0 < X

	At the end of document, there are some suggestions
	about what you can do when there isn't a patch available for 
	your favourite kernel and none of the supplied patches 
	applies cleanly.


3.	Configure and build the kernel. Information about 
	this is available online (also take a look at the
	file /usr/src/linux/README).

	If you have build the kernel previously, then a 
	good sequence is:

		cd /usr/src/linux
		make oldconfig 		(enable CONFIG_MOL)
		make clean
		make dep
		make

	If this is the first time you build the kernel,
	then you probably want to configure some other things
	too:

		cd /usr/src/linux
		make clean
		make xconfig 		(enable CONFIG_MOL)
		make clean
		make dep
		make


5.	Copy the newly compiled kernel (/usr/src/linux/vmlinux)
	to MacOS and select it with BootX.



What to when the patch did not apply
=====================================

1.	If only a few hunks were was rejected, then the
	simplest thing to do is to examine the rejected patch
	(e.g. head.S.rej) and apply it manually (in principal, 
	lines with a leading `+` should be inserted and lines 
	with a leading `-` deleted).


2.	If there were several failed patches, then it is simpler
	to do everything manually. The folder 

		Doc/Kernel_Patches/files

	contains all MOL-modified kernel files. All mac-on-linux
	modifications are marked with CONFIG_MOL, e.g.

		#ifdef CONFIG_MOL
			... MOL modification ...
		#endif

	It should be relatively simple to search for CONFIG_MOL and
	then make the corresponding change to the kernel source.

	If you have sucessfully applied the MOL-modifications to a kernel 
	which is not listed above, please send me the patch, 
	preferably created with the make_kpatch script in the 
	mol/scripts directory. For instance:

	  cd mol/scripts
	  ./make_kpatch /usr/src/linux-org /usr/src/linux > patchfile

