# Yocto Build u-boot fails by applying wrong patch

**URL:** https://hub.mender.io/t/yocto-build-u-boot-fails-by-applying-wrong-patch/7913
**Category:** General Discussions
**Tags:** raspberry-pi-3, u-boot
**Created:** [July 22, 2025, 5:10pm UTC](https://hub.mender.io/t/yocto-build-u-boot-fails-by-applying-wrong-patch/7913 "2025-07-22T17:10:08Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mark-berner](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mark-berner](https://hub.mender.io/u/mark-berner)
#### Post date: [July 22, 2025, 5:10pm UTC](https://hub.mender.io/t/yocto-build-u-boot-fails-by-applying-wrong-patch/7913/1 "2025-07-22T17:10:08Z")

</div>

I build rootfs for RPI Zero W  
Yocto build started fail after commit [“meta-mender-raspberrypi: Adjust to U-Boot 2025.04”](https://github.com/mendersoftware/meta-mender-community/commit/0bc7f548371535cdd9a871201df85fa9decdb3a2)  
The problem is in the **openembedded-core** there is no U-Boot 2025.04 on the branch **scarthgap**  
So patch fails trying to patch U-Boot-2024.01 by patch for 2025.04

```auto
ERROR: u-boot-1_2024.01-r0 do_patch: Applying patch '0001-configs-rpi-enable-mender-requirements.patch' on target directory '/workspace/tmp/work/sun_rpi0w-poky-linux-gnueabi/u-boot/2024.01/git'
CmdError('quilt --quiltrc /workspace/tmp/work/sun_rpi0w-poky-linux-gnueabi/u-boot/2024.01/recipe-sysroot-native/etc/quiltrc push', 0, 'stdout: Applying patch 0001-configs-rpi-enable-mender-requirements.patch
patching file configs/rpi_0_w_defconfig
Hunk #1 FAILED at 25.
Hunk #2 FAILED at 49.
2 out of 2 hunks FAILED -- rejects in file configs/rpi_0_w_defconfig
patching file configs/rpi_2_defconfig
Hunk #1 FAILED at 25.
Hunk #2 succeeded at 50 (offset 1 line).
1 out of 2 hunks FAILED -- rejects in file configs/rpi_2_defconfig
patching file configs/rpi_3_32b_defconfig
Hunk #1 FAILED at 24.
Hunk #2 succeeded at 51 (offset 1 line).
1 out of 2 hunks FAILED -- rejects in file configs/rpi_3_32b_defconfig
patching file configs/rpi_3_b_plus_defconfig
Hunk #1 FAILED at 27.
Hunk #2 FAILED at 57.
2 out of 2 hunks FAILED -- rejects in file configs/rpi_3_b_plus_defconfig
patching file configs/rpi_3_defconfig
Hunk #1 FAILED at 27.
Hunk #2 FAILED at 57.
2 out of 2 hunks FAILED -- rejects in file configs/rpi_3_defconfig
patching file configs/rpi_4_32b_defconfig
patching file configs/rpi_4_defconfig
Hunk #1 succeeded at 26 with fuzz 2 (offset -4 lines).
Hunk #2 FAILED at 69.
1 out of 2 hunks FAILED -- rejects in file configs/rpi_4_defconfig
patching file configs/rpi_arm64_defconfig
Hunk #1 succeeded at 25 with fuzz 2 (offset -2 lines).
Hunk #2 FAILED at 63.
1 out of 2 hunks FAILED -- rejects in file configs/rpi_arm64_defconfig
patching file configs/rpi_defconfig
Hunk #1 FAILED at 25.
Hunk #2 FAILED at 49.
2 out of 2 hunks FAILED -- rejects in file configs/rpi_defconfig
patching file env/Kconfig
Hunk #1 succeeded at 96 (offset -13 lines).
patching file include/configs/rpi.h
Patch 0001-configs-rpi-enable-mender-requirements.patch does not apply (enforce with -f)

stderr: ')
ERROR: Logfile of failure stored in: /workspace/tmp/work/sun_rpi0w-poky-linux-gnueabi/u-boot/2024.01/temp/log.do_patch.1821

```

---

<div class="post-metadata">

### Author: ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)
#### Post date: [July 22, 2025, 5:17pm UTC](https://hub.mender.io/t/yocto-build-u-boot-fails-by-applying-wrong-patch/7913/2 "2025-07-22T17:17:47Z")

</div>

Hi @mark-berner,

Thanks for reaching out! The Raspberry Pi builds in `meta-mender-community` depend on `meta-lts-mixins` to provide a more up-to-date version of `u-boot`. See [meta-mender-community/kas/include/raspberrypi.yml at 6898594833c6c2836d74a3d96d16ffa7ab05a368 · mendersoftware/meta-mender-community · GitHub](https://github.com/mendersoftware/meta-mender-community/blob/6898594833c6c2836d74a3d96d16ffa7ab05a368/kas/include/raspberrypi.yml#L9).

After adding that layer/branch on the given revision, the patches should apply.

Greetz,  
Josef

---

<div class="post-metadata">

### Author: ![mark-berner](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mark-berner](https://hub.mender.io/u/mark-berner)
#### Post date: [July 22, 2025, 5:35pm UTC](https://hub.mender.io/t/yocto-build-u-boot-fails-by-applying-wrong-patch/7913/3 "2025-07-22T17:35:59Z")

</div>

Adding **meta-lts-mixing** didn’t help, sure I do simething wrong

Is it right set of repos should I download ?

```auto
RUN git clone -b scarthgap git://git.yoctoproject.org/poky /yocto/poky
RUN git clone -b scarthgap git://git.openembedded.org/openembedded-core /yocto/poky/meta-openembedded-core
RUN git clone -b scarthgap git://git.openembedded.org/meta-openembedded /yocto/poky/meta-openembedded
RUN git clone -b scarthgap git://git.yoctoproject.org/meta-raspberrypi /yocto/poky/meta-raspberrypi
RUN git clone -b scarthgap/u-boot git://git.yoctoproject.org/meta-lts-mixins /yocto/poky/meta-lts-mixins
RUN git clone -b scarthgap https://github.com/mendersoftware/meta-mender /yocto/poky/meta-mender
RUN git clone -b scarthgap https://github.com/mendersoftware/meta-mender-community /yocto/poky/meta-mender-community

```

---

<div class="post-metadata">

### Author: ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)
#### Post date: [July 22, 2025, 5:42pm UTC](https://hub.mender.io/t/yocto-build-u-boot-fails-by-applying-wrong-patch/7913/4 "2025-07-22T17:42:43Z")

</div>

Hi @mark-berner,

That looks a bit strange, but at least at first glance should probably work. In any case, can you try to build using the provided `kas` configuration ([meta-mender-community/kas/raspberrypi0-wifi.yml at scarthgap · mendersoftware/meta-mender-community · GitHub](https://github.com/mendersoftware/meta-mender-community/blob/scarthgap/kas/raspberrypi0-wifi.yml))? It’s there for exactly that reason, being able to have a reproducible build setup. The last weekly build a couple of days was successful, see [build\_boards · mendersoftware/meta-mender-community@6898594 · GitHub](https://github.com/mendersoftware/meta-mender-community/actions/runs/16384074434/job/46300715823).

Greetz,  
Josef

---

<div class="post-metadata">

### Author: ![mark-berner](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mark-berner](https://hub.mender.io/u/mark-berner)
#### Post date: [July 22, 2025, 6:10pm UTC](https://hub.mender.io/t/yocto-build-u-boot-fails-by-applying-wrong-patch/7913/5 "2025-07-22T18:10:50Z")

</div>

Actualy I don’t use **kas**. Is it must for now using **kas**?

---

<div class="post-metadata">

### Author: ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)
#### Post date: [July 22, 2025, 7:22pm UTC](https://hub.mender.io/t/yocto-build-u-boot-fails-by-applying-wrong-patch/7913/6 "2025-07-22T19:22:07Z")

</div>

@mark-berner well, its not a must. But it would definitely help in understanding where the problem is. As I said, its purpose is providing a reproducible build with known good versions.

Greetz,  
Josef

---

<div class="post-metadata">

### Author: ![mark-berner](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mark-berner](https://hub.mender.io/u/mark-berner)
#### Post date: [July 23, 2025, 8:28am UTC](https://hub.mender.io/t/yocto-build-u-boot-fails-by-applying-wrong-patch/7913/7 "2025-07-23T08:28:04Z")

</div>

I have complex dockerized build, and migrate to kas will take a time, but just taking from kas dependencies valid commit SHA, did solve the problem

Thanks a lot for help.

Mark

```auto
RUN git clone -b scarthgap git://git.yoctoproject.org/poky /yocto/poky
RUN git --git-dir=/yocto/poky/.git --work-tree=/yocto/poky checkout c162696dae5798e2ab1198403d0bc1d65d64068d

RUN git clone -b scarthgap git://git.openembedded.org/meta-openembedded /yocto/poky/meta-openembedded
RUN git --git-dir=/yocto/poky/meta-openembedded/.git --work-tree=/yocto/poky/meta-openembedded checkout e92d0173a80ea7592c866618ef5293203c50544c

RUN git clone -b scarthgap https://github.com/agherzan/meta-raspberrypi.git /yocto/poky/meta-raspberrypi
RUN git --git-dir=/yocto/poky/meta-raspberrypi/.git --work-tree=/yocto/poky/meta-raspberrypi checkout 1091bde25e9ebaea33114edb85e4aee931d105f3

RUN git clone -b scarthgap/u-boot git://git.yoctoproject.org/meta-lts-mixins /yocto/poky/meta-lts-mixins
RUN git --git-dir=/yocto/poky/meta-lts-mixins/.git --work-tree=/yocto/poky/meta-lts-mixins checkout a44882db02a0ed0f149371831bfbe067665eb42b

RUN git clone -b scarthgap https://github.com/mendersoftware/meta-mender /yocto/poky/meta-mender
RUN git --git-dir=/yocto/poky/meta-mender/.git --work-tree=/yocto/poky/meta-mender checkout 0d393c2267a92091f975eb932338c07109f5f5fd

RUN git clone -b scarthgap https://github.com/mendersoftware/meta-mender-community /yocto/poky/meta-mender-community
RUN git --git-dir=/yocto/poky/meta-mender-community/.git --work-tree=/yocto/poky/meta-mender-community checkout 6898594833c6c2836d74a3d96d16ffa7ab05a368

```

---

<div class="post-metadata">

### Author: ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)
#### Post date: [July 23, 2025, 9:05am UTC](https://hub.mender.io/t/yocto-build-u-boot-fails-by-applying-wrong-patch/7913/8 "2025-07-23T09:05:27Z")

</div>

Hi @mark-berner,

Thanks, I consider the topic solved then. Just for future reference, `kas` also supports containerized builds: [Building in a Container — kas 4.8.1 documentation](https://kas.readthedocs.io/en/latest/userguide/kas-container.html)

Greetz,  
Josef
