Let's explore the use of patch commands in Linux.
syntax is patch [options] [Originalfile] [Patchfile]
For example:
Patch-p[num] <patchfile
The-p parameter determines whether to use the prefix directory information of the read out source filename, does not provide the-p parameter, ignores all directory information,-p0 (or-P 0) indicates that all path information is used,-P1 ignores the first "/" previous directory, and so on. A file name such as/usr/src/linux-2.4.16/makefile will use Linux-2.4.16/makefile as the file to patch when providing-P3 parameters.
For the example of the Linux kernel source 2.4.16 upgrade package Just given, assume that the source directory is in/usr/src/linux, then use "Patch-p0 <patch-2.4.16" to work when the current directory is/USR/SRC, in the current directory Usr/src/linux, "Patch-p1 <patch-2.4.16" can also work properly.