Support for Ubuntu x86_64 + GRUB with BIOS legacy boot

Hello,

I am doing a PoC for Mender with our product. We very much like Mender concepts and the option to customize update types.
Our product is built on top of Ubuntu x86_64 generic hardware.
It may be installed with EFI boot (this has proven to work fine in the poc), and is also installed on BIOS legacy VMs/hosts.

Converting the img for the latter has failed (using mender-convert). Reading on the hub I found a post (2 years old) stating that currently only EFI is supported.

On the other hand according to Mender docs for Yocto project there is support for GRUB+BIOS (see here).

Does Mender nowadays support Ubuntu Server x86_64 + GRUB with BIOS legacy boot?

Thanks

Mender-convert (Ubuntu) only supports EFI, yes. Currently there are no plans to support legacy BIOS, since it is slowly being phased out in favor of EFI.

Nevertheless since I see GRUB+Legacy BIOS is supported with Yocto projects, can I assume that generally Mender client (explicitly the grub-mender-grubenv) will execute seemingly on BIOS Legacy hosts (with GPT)?
I am considering my options, and I thought to try and do manually the “conversion” process on a BIOS host for PoC, meaning installing the mender client, the special grub, fixing fstab etc…

Another alternative is maybe to write my own code to switch rootfs for BIOS hosts, and integrate it with Update Modules. Is this an option?

Any advice will be welcomed :blush:

Thanks

The client supports it, so it needs no change.

Most likely it won’t be difficult to support this, especially in the mender-convert 3.x series and later, where GRUB compatibility in general was improved considerably. If you want to try to modify mender-convert to support this, here are the things that come to mind:

  • This check (not released yet, but committed on master) checks for EFI specifically, and if not found, disables integration with grub.d. You almost certainly want grub.d support if you are going to use legacy BIOS, since the Debian /etc/grub.d scripts already support it.
  • However, related to that this section needs to be fixed. It expects a dedicated boot partition to exist on /boot/efi, but this is not the case if using legacy BIOS. In this case you’ll have to reference the boot partition in a different way, and it cannot be /boot, because this is already used for boot files that need to reside on the root filesystem. I suppose it could be something as simple as /boot/boot, although it is a bit weird to read. Obviously you’ll have to make sure that /etc/fstab also contains the right information.

If you fix those things, then install-grub && grub-update should produce a working boot setup, both at build time (which mender-convert already does), and at runtime.

1 Like

Thank you @kacf.

I managed to do rootfs update on a Debian x86_64+grub BIOS legacy host :slight_smile:

I did not fully understand your 2nd bullet about the boot partition at the beginning, because I have BIOS boot partition marked with bios_grub flag so why would I need another one, but apparently I cannot mount this one.
Eventually I had to simply install grub-mender-grubenv on a separate persistent partition (actually for poc I just used the data one that already exist), and link the /boot/grub to it.

In addition I did not use the mender-convert binary, but applied the mender-convert-modify script steps manually. This is because we want to try and convert hosts to use mender without copying a full image.

Thank you for the support!!

1 Like

Ok, I think that should work too. The important part is that it’s not on the same partition as either of the A/B rootfs partitions.

Glad you got it working!