Skip to contentSkip to conversation

grub-efi-cfg: enable per-label APPEND override

PATCH New Rich Persaud 1 participant 1 message Mar 9, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 grub-efi-cfg: enable per-label APPEND override

For legacy bios boot configurations, syslinux supports multiple labels with per-label APPEND definitions. grub-efi-cfg supports multiple labels, but only a single APPEND definition.

Enable optional per-label APPEND definitions for grub EFI, with variable names prefixed by "grub_" to isolate grub definitions from syslinux defintions.

Example use from an ISO image recipe that inherits grub-efi-cfg:

LABELS_LIVE="foo bar"
APPEND_grub_foo = "linuxcmdline"

No change in behavior for those using APPEND without overrides.

---
 meta/classes/grub-efi-cfg.bbclass | 6 ++++++
 1 file changed, 6 insertions(+)
meta/classes/grub-efi-cfg.bbclass +6 -0
index 8b5ff20c72..3a2cdd698b 100644
@@ -88,6 +88,12 @@ python build_efi_cfg() {
     for label in labels.split():
         localdata = d.createCopy()
 
+        overrides = localdata.getVar('OVERRIDES')
+        if not overrides:
+            bb.fatal('OVERRIDES not defined')
+
+        localdata.setVar('OVERRIDES', 'grub_' + label + ':' + overrides)
+
         for btype in btypes:
             cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0]))
             lb = label
Signature · 1 line
2.20.1