I am using an Upboard so a x86 system with Grub as bootloader.
When booting, the eMMC is referred as hd0 by Grub so the script grub.cfg handle the partitions properly.
But for my system I need an external flash drive to be plugged at boot some time.
But in that case, Grub refers the USB flash drive as hd0 and the eMMC as hd1 so the Grub script do not work and ends with the Grub command line.
Is there a mean to force grub to always use hd0 for the eMMC?
Makes sense now, that partuuid only applies to the mender_root variable and not to the mender_grub_storage_device.
I can not think of an easy way to get around this, because GRUB is not able to scan/probe for a partuuid.
But I know of one user who has solved a similar problem using the GRUB search command, which supports looking up filesystem image by label or fs-uuid. But this would require changes to the grub.cfg file + making sure that the partitions are labeled accordingly on each update.
Copy and paste my response from 992 so people can find it in either place.
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.
Unfortunately that is why I had to add the caveat of in most cases. It is supposed to be 100%, but not every BIOS does the magic grub is expecting.
You may want to contact UP and see if they have something in the BIOS that is forcing USB to always be higher in boot priority.
Also make sure to check the setting with the USB drive inserted. Sometimes they only show the devices connected in the priority list.