]> git.ozlabs.org Git - petitboot/blobdiff - discover/grub2/builtins.c
lib: consolidate util macros in util/util.h
[petitboot] / discover / grub2 / builtins.c
index 0716276e9bbf78bcafdfabce36e8c38bbcd8556e..668ed93aa10e6db074d3a7736d473f21446085dc 100644 (file)
@@ -5,7 +5,7 @@
 #include <log/log.h>
 #include <types/types.h>
 #include <talloc/talloc.h>
-#include <array-size/array-size.h>
+#include <util/util.h>
 
 #include "grub2.h"
 
@@ -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,14 @@ 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[]);
+int builtin_save_env(struct grub2_script *script,
+               void *data __attribute__((unused)),
+               int argc, char *argv[]);
+
+
 static struct {
        const char *name;
        grub2_function fn;
@@ -295,6 +304,14 @@ static struct {
                .name = "false",
                .fn = builtin_false,
        },
+       {
+               .name = "load_env",
+               .fn = builtin_load_env,
+       },
+       {
+               .name = "save_env",
+               .fn = builtin_save_env,
+       },
 };
 
 static const char *nops[] = {