Help text for installing a new kernel How to compile a single driver To recompile a single driver: How to patch a kernel On 17 April 2004 I installed xfree86-driver-synaptics for sigillo's touchpad. The touchpad is an ALPS touchpad that needs the /usr/share/doc/xfree86-driver-synaptics/alps.patch.gz patch. I copied the patch to /usr/src/patches and gunzipped the file; it contained an e-mail exchange and lots of diff files. I saved each diff to its own file and copied them to a copy of /usr/src/drivers/input/mouse/ at /usr/src/patched-mouse. I stripped each file of all prefixes in file names. I then issued this for existing files that needed patching: patch -p0 < Makefile~alps And this for files that were created by a patch: patch -p0 < alps.c~alps > alps.c In two cases I got offsets, as the patch was made against an earlier kernel: patch -p0 < psmouse-base.c~alps patching file psmouse-base.c In those cases, I got an *.orig file. I checked the files and they looked fine. Now it's unclear if you could have produced the new files if you had left the patches in one file -- I'm guessing you could. So I tried that -- just stripped away the e-mail and left the main diff sections in one file, removed all file paths, and issued I got the same result: patching file Makefile I verified that the files are identical. Now, this clearly means I could have patched the files cleanly in the normal way, within its proper directory. I try that -- this time I just strip the junk at the beginning of the file, but leave all file prefixes in place and simply issue,
and get the same thing: patching file drivers/input/mouse/Makefile I ran the patch for real and then ran diffs to verify the files were identical. OK, so that worked -- all you need to do is shred off the gunk at the beginning. You did learn some things about patching. There's likely a really clean way of doing it in Debian. 23 June 2003 kernel patch On 22 June 2003 I downloaded the 2.4.21 kernel and the 2.4.21-ac2 patch to Incidentally, here's how you back out a patch:
Guides The old gubbio:/usr/src/kernel-help.txt, now gone Check out the latest version: http://www.kernel.org/ Download the kernel and latest patch to /usr/src:
or
Untar the kernel -- it expands into its own directory:
Patch the kernel after placing the patch in the same directory:
Configure the kernel:
Make sure you read in the latest configuration from /boot and that you save the new one there, as kernel-2.4.xx-prex.config. If you don't want the screen printout to slow down things (let's say you're doing this over a phoneline), you can use this one to silence everything:
You can then use tail -f logfile to monitor progress -- or you can run top to amuse yourself. It's definitely more fun than having the bandwidth eaten up by a stream of compilation codes. Another advantage of course is that if you connection should be inadvertently cut, you won't be interrupting the program. Similarly for the compilation (in fact this is where it's really useful):
-- you'll get a receipt like [1] 24834 showing PID. The compilation takes about fifteen minutes I think -- I haven't timed it. Or less dramatically, letting you see just the error messages:
This is still necessary for 2.4 kernels:
For the final stage remember you need to be root:
Then
and
Finally, add the new kernel to /etc/lilo.conf -- make a copy of the file to /mnt/hdc7/etc (mount the partition first), and don't forget to run lilo. You're ready to kernel panic!
Kernel expert Here's the expert installing a new kernel with patches -- that is to say, the 2.4.19 kernel with Marcelo Tosati's 2.4.20-pre4 and Alan Cox's 2.4.20-pre4-ac2 and Andre Henrick's 2.4-pre4-ac2-newide patches. Note that he edits the Makefile to reflect the patch generation: $ tar xzf linux-2.4.19.tgz Note that he also used this Kernel command line:
It looks to me like there's a reboot safety feature here -- I guess I don't need it because I use Lilo. Note that he's still setting the system bus speed for each drive -- this is not getting autodetected. Note also that this patch gives him Uniform Multi-Platform E-IDE driver Revision: 7.00alpha1.
|
|
|
|
|||||
Maintained by Francis F. Steen, Communication Studies, University of California Los Angeles |