Adding mender-partuuid causes an error: "/dev/sda1 Does not contain a valid PARTUUID path"

Hello,

my device uses it’s USB ports for the initial network configuration, so the user plugs in USB drives which makes it very likely that someday my device will be rebooted while a USB drive is still present.

As rreignier mentiond in his thread booting with a plugged in flash drive, grup boots into the grub cli instead of starting the os from the internal drive (An SSD in my case). As I am using yocto-thud I am trying the suggested solution from rreignier’s thread: I have added “mender-partuuid” to “MENDER_FEATURES_ENABLE_append”, but now when I am trying to build an Image I am getting the following errors:

Loading cache: 100% |####################################################################################################################################################| Time: 0:00:00
Loaded 98 entries from dependency cache.
ERROR: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/xen-image-minimal.bb: /dev/sda1 Does not contain a valid PARTUUID path           | ETA:  0:00:40
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/xen-image-minimal.bb: Exception during build_dependencies for mender_update_fstab_file
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/xen-image-minimal.bb: Error during finalise of /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/xen-image-minimal.bb
ERROR: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-controller.bb: /dev/sda1 Does not contain a valid PARTUUID path
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-controller.bb: Exception during build_dependencies for mender_update_fstab_file
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-controller.bb: Error during finalise of /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-controller.bb
ERROR: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb: /dev/sda1 Does not contain a valid PARTUUID path
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb: Exception during build_dependencies for mender_update_fstab_file
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb: Error during finalise of /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb
ERROR: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-guest.bb: /dev/sda1 Does not contain a valid PARTUUID path
ERROR: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-compute.bb: /dev/sda1 Does not contain a valid PARTUUID path
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-guest.bb: Exception during build_dependencies for mender_update_fstab_file
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-guest.bb: Error during finalise of /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-guest.bb
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-compute.bb: Exception during build_dependencies for mender_update_fstab_file
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-compute.bb: Error during finalise of /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-compute.bb
ERROR: ExpansionError during parsing /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/xen-image-minimal.bb
Traceback (most recent call last):
bb.data_smart.ExpansionError: Failure expanding variable mender_update_fstab_file, expression was     local tmpBootPart="/dev/sda1"
    local tmpDataPart="/dev/sda4"
    if ${@bb.utils.contains('DISTRO_FEATURES', 'mender-partuuid', 'true', 'false', d)}; then
        tmpBootPart="PARTUUID=${@mender_get_partuuid_from_device(d, '/dev/sda1')}"
        tmpDataPart="PARTUUID=${@mender_get_partuuid_from_device(d, '/dev/sda4')}"
    fi

    if ! ${@bb.utils.contains('DISTRO_FEATURES', 'mender-image-ubi', 'true', 'false', d)}; then
        if [ "16" != "0" ] && [ -n "/dev/sda1" ]; then
            echo "# Where the U-Boot environment resides; for devices with SD card support ONLY!" >> /home/parallels/Documents/yocto/poky/build/tmp/work/intel_corei7_64-poky-linux/xen-image-minimal/1.0-r0/rootfs/etc/fstab
            mkdir -p /home/parallels/Documents/yocto/poky/build/tmp/work/intel_corei7_64-poky-linux/xen-image-minimal/1.0-r0/rootfs//boot/efi
            printf "%-20s %-20s %-10s %-21s %-2s %s\n" ${tmpBootPart} /boot/efi auto defaults,sync 0 0 >> /home/parallels/Documents/yocto/poky/build/tmp/work/intel_corei7_64-poky-linux/xen-image-minimal/1.0-r0/rootfs/etc/fstab
        else
            bbdebug 2 "MENDER_BOOT_PART not applicable. Not adding to fstab..."
        fi
    fi

    mkdir -p /home/parallels/Documents/yocto/poky/build/tmp/work/intel_corei7_64-poky-linux/xen-image-minimal/1.0-r0/rootfs/data
    printf "%-20s %-20s %-10s %-21s %-2s %s\n" ${tmpDataPart} /data auto defaults 0 0 >> /home/parallels/Documents/yocto/poky/build/tmp/work/intel_corei7_64-poky-linux/xen-image-minimal/1.0-r0/rootfs/etc/fstab
 which triggered exception BBHandledException: 


Summary: There were 11 WARNING messages shown.
Summary: There were 6 ERROR messages shown, returning a non-zero exit code.

I know, as mentioned in the other thread, the feature isn’t fully documented yet, but maybe someone knows what the problem is.

Any help would be greatly appreciated.

Best regards,
c3ntry

You are using thud branch of meta-mender? Can you also share the configuration options in local.conf.

Also please note that mender-partuuid will not solve your problem, see my comment here,

I am using the the thud branch of meta-mender.

I somehow missed your answer on the other thread, sorry.

If I use the search command with the fs-uuid, how could I update the grub.cfg without interfering with the mender configuration for grub? Can the fs-uuid change between older & newer .uefiimg images (installed directly using dd, not via mender update - for newer devices)?

If I use the search command with the fs-uuid, how could I update the grub.cfg without interfering with the mender configuration for grub?

This would require some significant effort to do, but this is probably the location to update.

Can the fs-uuid change between older & newer .uefiimg images (installed directly using dd, not via mender update - for newer devices)?

Yes, fs-uuid changes between uefiimgs, it also changes between Mender Artifact updates. So this needs to be resolving using some “smart” state-scripting.

I somewhat solved this issue back when I implemented partuuid.
A small secret about the grub disk order is that it is derived from the BIOS boot priority order (in most cases). So if the disk you have grub on is highest in boot priority there is a good chance it will always be hd0 regardless of new media being added.

Not a perfect solution but it should cover most embedded cases where someone isn’t expecting to boot from a different device.

1 Like

FYI, there are changed up for merge that will resolve this, meaning that mender_grub_storage_device is dynamically determined at run-time.