diff options
| author | Simon A. Eugster <simon.eu@gmail.com> | 2025-01-15 09:55:21 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-01-20 13:38:59 +0000 |
| commit | 11098a9725e60193ca3514cb8ac413932cbe8553 (patch) | |
| tree | 1ad2f09a24a7541bab56f670cf97d81e46a797cc /meta | |
| parent | 5b6c0bfbf5a9b25c38fa7e1bc637f2eba151e73d (diff) | |
| download | poky-11098a9725e60193ca3514cb8ac413932cbe8553.tar.gz | |
grub-efi-cfg: Add GRUB_TITLE for custom GRUB titles
Until now, the default title of a boot entry is its label. The label is
a variable which determines the script to run during an early boot stage
and is not necessarily human readable.
This patch allows to provide a human-readable title for each boot entry.
(From OE-Core rev: a5a7f6ada786b7f2c1a317f20b7e642f1e978de9)
Signed-off-by: Simon A. Eugster <simon.eu@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/classes-recipe/grub-efi-cfg.bbclass | 8 | ||||
| -rw-r--r-- | meta/recipes-bsp/grub/grub-bootconf_1.00.bb | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/meta/classes-recipe/grub-efi-cfg.bbclass b/meta/classes-recipe/grub-efi-cfg.bbclass index 52e85a3bb0..9a5cb99c52 100644 --- a/meta/classes-recipe/grub-efi-cfg.bbclass +++ b/meta/classes-recipe/grub-efi-cfg.bbclass | |||
| @@ -23,6 +23,7 @@ GRUB_TIMEOUT ?= "10" | |||
| 23 | GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" | 23 | GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" |
| 24 | 24 | ||
| 25 | GRUB_ROOT ?= "${ROOT}" | 25 | GRUB_ROOT ?= "${ROOT}" |
| 26 | GRUB_TITLE ?= "" | ||
| 26 | APPEND ?= "" | 27 | APPEND ?= "" |
| 27 | 28 | ||
| 28 | # Uses MACHINE specific KERNEL_IMAGETYPE | 29 | # Uses MACHINE specific KERNEL_IMAGETYPE |
| @@ -91,10 +92,15 @@ python build_efi_cfg() { | |||
| 91 | if not overrides: | 92 | if not overrides: |
| 92 | bb.fatal('OVERRIDES not defined') | 93 | bb.fatal('OVERRIDES not defined') |
| 93 | 94 | ||
| 95 | localdata.need_overrides() | ||
| 94 | localdata.setVar('OVERRIDES', 'grub_' + label + ':' + overrides) | 96 | localdata.setVar('OVERRIDES', 'grub_' + label + ':' + overrides) |
| 95 | 97 | ||
| 96 | for btype in btypes: | 98 | for btype in btypes: |
| 97 | cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0])) | 99 | title = localdata.getVar('GRUB_TITLE') |
| 100 | if not title or len(title) == 0: | ||
| 101 | title = label | ||
| 102 | |||
| 103 | cfgfile.write('\nmenuentry \'%s%s\'{\n' % (title, btype[0])) | ||
| 98 | lb = label | 104 | lb = label |
| 99 | if label == "install": | 105 | if label == "install": |
| 100 | lb = "install-efi" | 106 | lb = "install-efi" |
diff --git a/meta/recipes-bsp/grub/grub-bootconf_1.00.bb b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb index fed3c7e9a3..a004e3a3b2 100644 --- a/meta/recipes-bsp/grub/grub-bootconf_1.00.bb +++ b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb | |||
| @@ -23,7 +23,7 @@ python do_configure() { | |||
| 23 | bb.build.exec_func('build_efi_cfg', d) | 23 | bb.build.exec_func('build_efi_cfg', d) |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | do_configure[vardeps] += "APPEND ROOT" | 26 | do_configure[vardeps] += "APPEND ROOT GRUB_TITLE" |
| 27 | 27 | ||
| 28 | do_install() { | 28 | do_install() { |
| 29 | install -d ${D}${EFI_FILES_PATH} | 29 | install -d ${D}${EFI_FILES_PATH} |
