]> git.ozlabs.org Git - petitboot/blobdiff - discover/grub2/builtins.c
discover/grub2: Implement load_env
[petitboot] / discover / grub2 / builtins.c
index 0716276e9bbf78bcafdfabce36e8c38bbcd8556e..71ae61a3ae97118ed63e7f30303e2c4d4c09dd7c 100644 (file)
@@ -178,6 +178,7 @@ static bool builtin_test_op(int argc, char **argv, int *consumed)
                }
        }
 
+       op = argv[0];
        *consumed = 1;
        return strlen(op) > 0;
 }
@@ -255,6 +256,10 @@ static int builtin_nop(struct grub2_script *script __attribute__((unused)),
        return 0;
 }
 
+extern int builtin_load_env(struct grub2_script *script,
+               void *data __attribute__((unused)),
+               int argc, char *argv[]);
+
 static struct {
        const char *name;
        grub2_function fn;
@@ -295,6 +300,10 @@ static struct {
                .name = "false",
                .fn = builtin_false,
        },
+       {
+               .name = "load_env",
+               .fn = builtin_load_env,
+       },
 };
 
 static const char *nops[] = {