balena-os / meta-balena

A collection of Yocto layers used to build balenaOS images
https://www.balena.io/os
971 stars 115 forks source link

hostapp-update-hooks: Re-add check for UEFI to signed-update hook #3439

Closed mtoman closed 1 month ago

mtoman commented 1 month ago

In 328222014146f0116e0208443f3e255d0e85ef15 we have removed the signed-update hook from systems that do not have EFI in MACHINE_FEATURES. This on its own makes sense, however together with it we have also removed the runtime check for whether the running system is actually booted in UEFI mode.

This effectively means it is no longer possible to update the host OS on a device type able to boot in both UEFI and BIOS modes (intel-nuc and genericx86-64-ext) when booted in BIOS mode, as the signed-update hook is executed unconditionally and fails if the device is not running UEFI.

This patch re-adds the runtime check to only execute the hook if the system is actually booted in UEFI mode.


Contributor checklist

Reviewer Guidelines

mtoman commented 1 month ago

@jakogut I think we always run QEMU tests in UEFI mode, don't we?

jakogut commented 1 month ago

@mtoman I suppose we do, and our testing on NUCs is probably also booting in UEFI mode.

mtoman commented 1 month ago

@resin-jenkins retest this please