summaryrefslogtreecommitdiffstats
path: root/discover/grub2/builtins.c
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javierm@redhat.com>2018-03-22 09:41:23 +0100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-03-23 11:39:35 +1100
commit91ce1a8f8863d8f740188236f138421d17292d6c (patch)
treef39fa6f339e8c8f3e3ec20052acc33b806aa040b /discover/grub2/builtins.c
parent3dfa4123bdf987aaa0e4bfd73d436c6bab0184ce (diff)
downloadtalos-petitboot-91ce1a8f8863d8f740188236f138421d17292d6c.tar.gz
talos-petitboot-91ce1a8f8863d8f740188236f138421d17292d6c.zip
discover/grub: Add blscfg command support to parse BootLoaderSpec files
The BootLoaderSpec (BLS) defines a file format for boot configurations, so bootloaders can parse these files and create their boot menu entries by using the information provided by them [0]. This allow to configure the boot items as drop-in files in a directory instead of having to parse and modify a bootloader configuration file. The GRUB 2 bootloader provides a blscfg command that parses these files and creates menu entries using this information. Add support for it. [0]: https://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover/grub2/builtins.c')
-rw-r--r--discover/grub2/builtins.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/discover/grub2/builtins.c b/discover/grub2/builtins.c
index c16b639..e42821a 100644
--- a/discover/grub2/builtins.c
+++ b/discover/grub2/builtins.c
@@ -330,7 +330,10 @@ extern int builtin_load_env(struct grub2_script *script,
int builtin_save_env(struct grub2_script *script,
void *data __attribute__((unused)),
int argc, char *argv[]);
-
+int builtin_blscfg(struct grub2_script *script,
+ void *data __attribute__((unused)),
+ int argc __attribute__((unused)),
+ char *argv[] __attribute__((unused)));
static struct {
const char *name;
@@ -380,6 +383,10 @@ static struct {
.name = "save_env",
.fn = builtin_save_env,
},
+ {
+ .name = "blscfg",
+ .fn = builtin_blscfg,
+ }
};
static const char *nops[] = {
OpenPOWER on IntegriCloud