[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: this was answered
On Mon, 15 May 2000, Charles Menzes wrote:
> what is the correct syntax for a patch to the kernel?
>
> patch p0 < /home/charles/lids-0.9.3/lids-0.9.3-2.2.15.patch
>
> i think tim mentioned before that there was something wrong with the
> syntax...
Yeah, the way it shoud be done is
cd /usr/src/kernel-patches
wget ftp://nearest.mirror/newest/source.patch.bz2
../linux/scripts/patch-kernel
:)
based on that script, the command to use is
patch -p1 -s -N -E -d $sourcedir < $patchfile
because
-p1 strips the leading slash on filenames if present
-s makes it silent (nto neccesarily needed)
-N ignores patches already applied or reversed
-E forces removal of empty files (which should be done
automatically anyway
-d changes to the specified directory before proceeding
assuming that $sourcedir is your kernel source directory and $patchfile is
your patch file.
However, in the README file in the kernel docs, it is advised that one uses
bzip2 -dc patchXX.bz2 | patch -p0
which implies that what you have above will work if you've already got the
patch file uncompressed. It may be better to use
patch -p1 -d /usr/src/linux < ~charles/lids-0.9.3/lids-0.9.3-2.2.15.patch
anyway, so you don't have to worry about your source tree being in
/home/kernel/place and the patch generator using /usr/src/linux, however.
I'm partial to just leaving the patches compressed and using the
patch-kernel script to take all the hard work out of typing
"patch -p0 < bzcat patch.bz2". Mmmm, learning how "patch" works...
--Danny, doing little more than reading man pages and kernel docs
--
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.