Problem updating from 5.2.0 to 5.7.1 in customized TorizonCore build

I’ve inherited a customized build of TorizonCore build project (manifest and custom layers) to use with iMX6 and iMX8.

The last time this build was synced with a quarterly release was for version 5.2.0. I do have git history showing how Torizon was updated prior to that…basically by updating relevant hashes in various manifest files.

When attempting to follow this same update pattern to bring this build to the latest quarterly release (5.7.1) the build runs for about an hour and then halts with these errors:

WARNING: gmp-native-6.2.0-r0 do_fetch: Failed to fetch URL https://gmplib.org/download/gmp/gmp-6.2.0.tar.bz2, attempting MIRRORS if available
WARNING: unifdef-native-2.12-r0 do_fetch: Failed to fetch URL http://dotat.at/prog/unifdef/unifdef-2.12.tar.xz, attempting MIRRORS if available
WARNING: rsync-native-3.1.3-r0 do_fetch: Failed to fetch URL https://download.samba.org/pub/rsync/src/rsync-3.1.3.tar.gz, attempting MIRRORS if available
ERROR: systemd-1_244.5-r0 do_patch: Applying patch '0002-systemd-networkd-wait-online.service.in-use-any-by-d.patch' on target directory '/build/build-ramp/tmp/work/aarch64-tdx-linux/systemd/1_244.5-r0/git'
Command Error: 'quilt --quiltrc /build/build-ramp/tmp/work/aarch64-tdx-linux/systemd/1_244.5-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
Applying patch 0002-systemd-networkd-wait-online.service.in-use-any-by-d.patch
patching file units/systemd-networkd-wait-online.service.in
Hunk #1 FAILED at 18.
1 out of 1 hunk FAILED -- rejects in file units/systemd-networkd-wait-online.service.in
Patch 0002-systemd-networkd-wait-online.service.in-use-any-by-d.patch can be reverse-applied
ERROR: Logfile of failure stored in: /build/build-ramp/tmp/work/aarch64-tdx-linux/systemd/1_244.5-r0/temp/log.do_patch.25729
ERROR: Task (/build/build-ramp/conf/../../layers/openembedded-core/meta/recipes-core/systemd/systemd_244.5.bb:do_patch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1458 tasks of which 216 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 12 seconds

What should I be looking at to try to fix this “quilt” issue and the the failed patch? I have reviewed the log, but I didn’t see any further information about how the process has been broken.

Greetings @Hank,

The errors you are seeing here basically translate to, this patch can’t be cleanly applied. The patch in question is located in our meta layer meta-toradex-torizon, as seen here: meta-toradex-torizon/0002-systemd-networkd-wait-online.service.in-use-any-by-d.patch at dunfell-5.x.y · toradex/meta-toradex-torizon · GitHub

However, in our default build this patch applies cleanly on the systemd source. Either some customization on your custom build must be messing with this. Or perhaps the layers in your build weren’t cleanly updated to what we have in our 5.7.1 build.

Best Regards,
Jeremias

Thanks for the quick reply!

I found that the only customized layer that could be impacting systemd and networkd is the following file in my project’s “recipes-core > systemd” folder (systemd_%.bbappend):

# Installs systemd-networkd network configuration files

# Make systemd-resolved the default provider for resolv.conf. NetworkManager
# can cooperate with networkd.
# See meta-lmp/recipes-core/systemd/systemd_%.bbappend
ALTERNATIVE_PRIORITY[resolv-conf] = "300"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

SRC_URI_append = " \
	file://10-nxp-wifi-ifnames.link \
"

PACKAGECONFIG_append = " resolved networkd"
do_install_append() {
    # Install a rule to ensure consistent wifi interface names when
    # using the NXP moal driver
    install -d ${D}${sysconfdir}/systemd/network
    install -m 0644 ${WORKDIR}/10-nxp-wifi-ifnames.link ${D}${sysconfdir}/systemd/network/
}

All other Torizon and Yocto references are pointing to the same hashes used in the *.xml files in subdirectories here:
https://git.toradex.com/cgit/toradex-manifest.git/tree/?h=5.7.1

If the file above is the culprit, what would I need to do to ensure this configuration is applied without messing up the original patch?

It doesn’t appear this your append from your meta-layer should affect anything. Could you try doing a test where you exclude this append file. Or just do a default build of TorizonCore 5.7.1 without any of your customization. That way we at least narrow down whether the error is due to something in your meta-layer or not.

Best Regards,
Jeremias

meta-lmp is an added layer in my custom build. After looking though that I found some patches that were the same name and I assume they were conflicting.

I updated my manifest to use the latest “dunfell” commit for meta-lmp where some of the redundant patches have been removed.

This updated meta-lmp commit did get me past the the error I was having, but then immediately into another similar one:

WARNING: gmp-native-6.2.0-r0 do_fetch: Failed to fetch URL https://gmplib.org/download/gmp/gmp-6.2.0.tar.bz2, attempting MIRRORS if available
WARNING: unifdef-native-2.12-r0 do_fetch: Failed to fetch URL http://dotat.at/prog/unifdef/unifdef-2.12.tar.xz, attempting MIRRORS if available
WARNING: rsync-native-3.1.3-r0 do_fetch: Failed to fetch URL https://download.samba.org/pub/rsync/src/rsync-3.1.3.tar.gz, attempting MIRRORS if available
ERROR: base-passwd-3.5.29-r0 do_patch: Applying patch '0001-Add-TorizonCore-specific-groups.patch' on target directory '/build/build-ramp/tmp/work/aarch64-tdx-linux/base-passwd/3.5.29-r0/base-passwd-3.5.29'
Command Error: 'quilt --quiltrc /build/build-ramp/tmp/work/aarch64-tdx-linux/base-passwd/3.5.29-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
Applying patch 0001-Add-TorizonCore-specific-groups.patch
patching file group.master
Hunk #1 FAILED at 35.
1 out of 1 hunk FAILED -- rejects in file group.master
Patch 0001-Add-TorizonCore-specific-groups.patch does not apply (enforce with -f)
ERROR: Logfile of failure stored in: /build/build-ramp/tmp/work/aarch64-tdx-linux/base-passwd/3.5.29-r0/temp/log.do_patch.39533
ERROR: Task (/build/build-ramp/conf/../../layers/openembedded-core/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb:do_patch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1161 tasks of which 216 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 12 seconds

Summary: 1 task failed:
  /build/build-ra-manpack/conf/../../layers/openembedded-core/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb:do_patch
Summary: There were 3 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

My build does override the built-in torizon account with a custom one and creates some other groups and user accounts. All this is done with commands and not patching. I’m not sure if that would effect the failure of the 0001-Add-TorizonCore-specific-groups.patch.

I’ll try to build without meta-lmp and see if that makes a difference and post back eventually.
If that fails I’ll try a clean torizon build without the mods just to get a baseline.

Please let me know if there’s any thing else I should be looking at as well.

After removing meta-lmp from my manifest and its references in my custom layers, I did get my custom build with the 5.7.1. core to finally complete.

I’ve ostree’d the image to my iMX8 and have it currently installed and running without incident.

So far, I haven’t been able to detect any “consequences” from pulling out meta-lmp, but I still have a lot of testing to do yet to make sure it’s all still good.

Thanks for the help!

I’m glad you were able to resolve this issue. For further reference when updating the entire build project from 5.2.0 to 5.7.1 you must’ve missed this commit in our manifest: toradex-manifest.git - Repo manifest for Toradex Embedded Linux TorizonCore and BSP layer setup for Yocto Project/Openembedded

We removed the meta-lmp layer as a required layer in our TorizonCore builds. I imagine these issues you were having were due to still having this layer and thus introducing conflicts.

Best Regards,
Jeremias