Mender-repopulate-inactive-partition breaks squashfs

Hi,

It seems this issue is present in the kirkstone branch. The commit 24d2fe0c adds the line below in the file meta-mender/meta-mender-core/classes/mender-part-images.bbclass:

if [ “${ARTIFACTIMG_FSTYPE}” = “squashfs” || ${@bb.utils.contains(‘MENDER_FEATURES’, ‘mender-prepopulate-inactive-partition’, ‘true’, ‘false’, d)} ]; then

At runtime, this fails at the do_image_uefiimg step. The executed code looks like below:

    # By default the inactive partition filesystem is empty to allow for more efficient compression.
    # A full filesystem is populated if one of the following applies
    # - ARTIFACTIMG_FSTYPE is squashfs, because it doesn not allow empty partitions.
    # - the "mender-prepopulate-inactive-partition" MENDER_FEATURE is enabled
    if [ "squashfs" = "squashfs" || false ]; then
        part2_content="--source rawcopy --sourceparams=\"file=....../image-name-rt.squashfs\""
    else
        part2_content=
    fi

The code above is incorrect. Probably an easy fix is to use double [ ] for the if statement.

The commit before (ed0b3f7f) looks OK.

Additional info: I have a project based on the kirkstone branch, the file system is read-only (squashfs).

Please let me know if you have further questions.

Radu

Hi @rcernea,

Very good catch, thanks for reporting. The fix is already in flight as PR fix: mender-part-images handling of inactive partition by TheYoctoJester · Pull Request #2297 · mendersoftware/meta-mender · GitHub.

Can you confirm that it resolves the issue for you?

Greetz,
Josef

@rcernea just a short heads up, merged into the master, scarthgap and kirkstone branches.

Hi @TheYoctoJester ! THank you for the quick response and fix. I can confirm, now it builds.

1 Like