U-boot patch failed

  1. bitbake virtual/bootloader -c devshell

  2. Edit “include/configs/apalis-imx8.h”

  3. Then “git diff” → Dump output and store it into separate file “0001-faster-baudrate.patch” iand edit .bbappend like the followings.

    DEFCFG = “apalis-imx8-demo_defconfig”

    SRC_URI_append = "
    file://${DEFCFG}
    file://0001-faster-baudrate.patch
    "

  4. bitbake virtual/bootloader -c devshell

    ERROR: u-boot-toradex-2020.04-r0 do_patch: Command Error: ‘quilt --quiltrc /home/infot/karma/yocto/toradex/oe-core/build/tmp/work/apalis_imx8_demo-tdx-linux/u-boot-toradex/2020.04-r0/recipe-sysroot-native/etc/quiltrc push’ exited with 0 Output:
    Applying patch 0001-faster-baudrate.patch
    patching file include/configs/apalis-imx8.h
    Hunk #1 FAILED at 147.
    1 out of 1 hunk FAILED – rejects in file include/configs/apalis-imx8.h
    Patch 0001-faster-baudrate.patch does not apply (enforce with -f)
    ERROR: Logfile of failure stored in: /home/infot/karma/yocto/toradex/oe-core/build/tmp/work/apalis_imx8_demo-tdx-linux/u-boot-toradex/2020.04-r0/temp/log.do_patch.3423198
    ERROR: Task (/home/infot/karma/yocto/toradex/oe-core/build/…/layers/meta-toradex-nxp/recipes-bsp/u-boot/u-boot-toradex_2020.04.bb:do_patch) failed with exit code ‘1’

What’s wrong? “git diff” cannot be used with u-boot source code ?

Hi

To create a patch by this procedure should work.I would add between 3 and 4 a ‘bitbake virtual/bootloader -c clean’ to make sure that the ‘devshell’ changes are replaced with a clean checkout.

I tend to create the patch in step 3 with a ‘git commit …’ followed by a ‘git format-patch -1’. This allows to have a commit message in the patch which explains why the patch exists and what it does.

Max

P.S.: I haven’t seen the use of a variable DEFCFG and unless you have changes elsewhere I don’t think the additional file installed and the existence of that variable influences the build of U-Boot.

Hi Max.

Oh, I used “DEFCFG” only for just my private use. Was the name wrong? It might look to have been used somewhere in the code well. Very plain name. Thank you for your comment I will try that.

Hi @toddhwang the way you are using “DEFCFG” should work since you are also defining it but if you are expecting that to be somehow overriding an existing definition then that probably will not be the case.

Drew