Messages in this thread Patch in this message | | | Date | Sat, 1 Aug 1998 15:27:32 +0200 | From | Alexander Kjeldaas <> | Subject | Re: Layout/Setup of Kernel |
| |
On Sat, Aug 01, 1998 at 02:32:38AM -0400, Mike A. Harris wrote: > > I've dropped the CC to Linus - he has much better things to do > than follow these threads... > > Getting all the patches and trying to piece it together is an > *EASY* job at *WORST*. > > Assuming you have a kernel, lets say 2.1.98 for example. Lets > say you've downloaded all patches to get to 2.1.112 or whatever > is current. You just do the following: > > > 1) Put all the patches into ANY DIRECTORY on your hard disk > 2) Untar the kernel source (2.1.98) into the standard place > 3) cd into the directory where the patches reside (wherever it is) > 4) type "/usr/src/linux/scripts/patch-kernel" > 5) Go get a coffee. >
I have always patched my kernels by hand, but I took a look at the patch-kernel script. It defaults to patching /usr/src/linux without even _checking_ whether the script is located in a directory different from /usr/src/linux/scripts. I seldom untar my kernel in /usr/src/linux since I don't want to compile stuff with experimental header files. Following the principle of least surprise, I think patch-kernel should default to the directory where patch-files resides. [btw, as I don't use patch-kernel, I haven't tested this patch ;-)]
--- ../../linux-2.1.106/scripts/patch-kernel Sat Jan 17 22:38:29 1998 +++ patch-kernel Sat Aug 1 15:23:45 1998 @@ -1,8 +1,9 @@ #! /bin/sh # Script to apply kernel patches. # usage: patch-kernel [ sourcedir [ patchdir ] ] -# The source directory defaults to /usr/src/linux, and the patch -# directory defaults to the current directory. +# The source directory defaults to the directory above where patch-kernel +# resides, or /usr/src/linux if patch-kernel is located outside the kernel +# source. The patch directory defaults to the current directory. # # It determines the current kernel version from the top-level Makefile. # It then looks for patches for the next sublevel in the patch directory. @@ -18,7 +19,10 @@ # Adam Sulmicki <adam@cfar.umd.edu>, 1st January 1997. # Set directories from arguments, or use defaults. -sourcedir=${1-/usr/src/linux} +sourcedir=${1-`echo $0 | sed 's/patch-kernel/../'`} +if [ ! -f $sourcedir/Makefile -a ! -L $sourcedir/Makefile ]; then + sourcedir=/usr/src/linux +fi patchdir=${2-.} # set current VERSION, PATCHLEVEL, SUBLEVEL
astor
-- Alexander Kjeldaas, Guardian Networks AS, Trondheim, Norway http://www.guardian.no/
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html
| |