Kernel patch files

Kernel patch file Profile

/ * Diff represents the difference point path, behind -urN follow the path of the original file and the new file path * / 
diff -urN U-boot- 2012.04 . 01 /arch/arm/lib/board.c U-boot- 2012.04 .01_100ask / Arch / ARM / lib / board.c
 / * --- represents the path and version of the original code, new code +++ represents the path and version * / 
--- U-boot- 2012.04 . 01 / Arch / ARM / lib / Board. C     2012 - 04 - 25  21 is : 22 is : 50.000000000 + 0800 
+++ U-boot - 2012.04 .01_100ask / Arch / ARM / lib / board.c     2012 - 06 - 16  09: 56 : 16.529637486 + 0800 
/ * -256,12 original code indicates the start line 256, a total of 12 rows in this range to be altered * / 
/ * +256,14 starts from the line 256, the new code of 14 behavioral changes * / 
@@ - 256 , 12 is + 256 , 14 @@ 
     NULL,     // 256, 256 
 };     // 257, 257
     // 258, 258
 // - followed by the original code, followed by the + code changes, green denote the number of code word, represents a modified code order red 
- void board_init_f ( ulong bootflag)     // 259 
+ unsigned int board_init_f(ulong bootflag)    // 259
 {    //260,260
     bd_t *bd;    //261,261
     init_fnc_t **init_fnc_ptr;    //262,262
     gd_t *id;    //263,263
     ulong addr, addr_sp;    //264,264
+    extern ulong base_sp;    //265
+    //266
 #ifdef CONFIG_PRAM    //265,267
     ulong reg;    //266,268
 #endif    //267,269

 

How to use the patch file

patch -p(n) < /xxx/xxx.patch

 /xxx/xxx.patch is the path to the kernel patch file;

-p (n) represents the n-th path in front of the patch file to ignore differences in terms of the path "/", because the patch file path and the path we are often not the same as the local practice, the option to help us modify the path;

 

For example, we currently have the "u-boot-2012.04.01" this directory:

diff -urN u-boot-2012.04.01/arch/arm/lib/board.c u-boot-2012.04.01_100ask/arch/arm/lib/board.c 
// red part of the code to be modified path

 

Add options -p1:

 

diff -urN u-boot-2012.04.01/arch/arm/cpu/u-boot.lds u-boot-2012.04.01_100ask/arch/arm/lib/board.c
// first-level directory is ignored

 

 

 

Guess you like

Origin www.cnblogs.com/zhaozhenkai/p/11220475.html