uboot study notes | 11 - transplant uboot 2012.04 to JZ2440 (migration, make uboot patch)

1. Why do you need the patch

After the patch file is by comparing the current file and source files, modify the contents of the document obtained.

With the patch file, it can over uboot2012.04 source, direct patch, it will become a good fit uboot JZ2440 transplant, and very convenient,

When sharing or released, because Uboot source is uniform, so only need to share or publish this patch file.

2. How to Make Patch

  • ① Clear compiler generated file
make distclean
  • ② to Rename the folder
mv u-boot-2012.04.01 u-boot-2012.04.01-jz2440
  • ③ re-extract uboot2012.04.01 source
tar -jxvf u-boot-2012.04.01.tar.bz2

  • make patches (diff command)
diff -urN <旧的文件> <新的文件> > <补丁文件名.patch>


Patch finished.

3. How to patch (patch command)

Patch command as follows:

patch -p<数字n> < <补丁文件路径和位置>

Where the number n, the patch file location information, ignore the first n items.

For example, here I uboot source code into the folder, execute the command patch, as it has been in uboot-2012.04.01 this directory, so n = 1, it represents a first-level directory is ignored.

As follows, patching success:

4. The test patch is available

After the patch directly translated:

make distclean
make smdk2440_config
make

Compile successfully:

downloaded to the development board test, Linux started successfully:

receiving more exciting articles and resources push, welcome to subscribe to my micro-channel public number: "mculover666」 .

Published 234 original articles · won praise 610 · views 270 000 +

Guess you like

Origin blog.csdn.net/Mculover666/article/details/104588755