diff mbox series

[v2,2/3] discover/grub: Don't add discover context boot options in blscfg handler

Message ID 20180417170900.31045-2-javierm@redhat.com
State Accepted
Headers show
Series [v2,1/3] discover/grub: Reverse BLS entries sorting to match Petitboot's boot order | expand

Commit Message

Javier Martinez Canillas April 17, 2018, 5:08 p.m. UTC
Instead of adding a boot option explicitly, just add it to the grub script
boot option list and increment the number of options. That way BLS entries
will be known by the grub script handler and can check if is a valid index.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---

Changes in v2: None

 discover/grub2/blscfg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/discover/grub2/blscfg.c b/discover/grub2/blscfg.c
index d20dde20bb9c..5dadd2c6e8ef 100644
--- a/discover/grub2/blscfg.c
+++ b/discover/grub2/blscfg.c
@@ -143,7 +143,8 @@  static void bls_finish(struct conf_context *conf)
 
 	option->is_default = option_is_default(state->script, option);
 
-	discover_context_add_boot_option(dc, opt);
+	list_add_tail(&state->script->options, &opt->list);
+	state->script->n_options++;
 
 	device_handler_status_dev_info(dc->handler, dc->device,
 				       _("Created menu entry from BLS file %s"),