summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f465fce)
This will allow menuentry-specific commands to populate boot option
data.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
struct list commands;
struct list symtab;
struct discover_context *ctx;
struct list commands;
struct list symtab;
struct discover_context *ctx;
+ struct discover_boot_option *opt;
#include <sys/types.h>
#include <string.h>
#include <sys/types.h>
#include <string.h>
+#include <types/types.h>
#include <talloc/talloc.h>
#include "grub2.h"
#include <talloc/talloc.h>
#include "grub2.h"
struct grub2_statement *statement)
{
struct grub2_statement_menuentry *st = to_stmt_menuentry(statement);
struct grub2_statement *statement)
{
struct grub2_statement_menuentry *st = to_stmt_menuentry(statement);
+ struct discover_boot_option *opt;
process_expansions(script, st->argv);
process_expansions(script, st->argv);
+
+ opt = discover_boot_option_create(script->ctx, script->ctx->device);
+ if (st->argv->argc > 0) {
+ opt->option->name = talloc_strdup(opt, st->argv->argv[0]);
+ } else {
+ opt->option->name = talloc_strdup(opt, "(unknown)");
+ }
+
+ script->opt = opt;
+
statements_execute(script, st->statements);
statements_execute(script, st->statements);
+ discover_context_add_boot_option(script->ctx, opt);
+ script->opt = NULL;
+
init_env(script);
script->ctx = ctx;
init_env(script);
script->ctx = ctx;
list_init(&script->commands);
register_builtins(script);
list_init(&script->commands);
register_builtins(script);