]> git.ozlabs.org Git - petitboot/blobdiff - discover/grub2/builtins.c
discover: remove register_parser printf
[petitboot] / discover / grub2 / builtins.c
index 1ce63cf13103c8f2157029bca3464a5110e0f1f2..c218bc7d07155bd6426d630f26bf623f0bcb4bb6 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;
 }
@@ -231,6 +232,22 @@ static int builtin_test(struct grub2_script *script __attribute__((unused)),
        return rc ? 0 : 1;
 }
 
+static int builtin_true(struct grub2_script *script __attribute__((unused)),
+               void *data __attribute__((unused)),
+               int argc __attribute__((unused)),
+               char *argv[] __attribute__((unused)))
+{
+       return 0;
+}
+
+static int builtin_false(struct grub2_script *script __attribute__((unused)),
+               void *data __attribute__((unused)),
+               int argc __attribute__((unused)),
+               char *argv[] __attribute__((unused)))
+{
+       return 1;
+}
+
 static int builtin_nop(struct grub2_script *script __attribute__((unused)),
                void *data __attribute__((unused)),
                int argc __attribute__((unused)),
@@ -239,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;
@@ -251,6 +276,10 @@ static struct {
                .name = "linux",
                .fn = builtin_linux,
        },
+       {
+               .name = "linux16",
+               .fn = builtin_linux,
+       },
        {
                .name = "initrd",
                .fn = builtin_initrd,
@@ -267,6 +296,22 @@ static struct {
                .name = "test",
                .fn = builtin_test,
        },
+       {
+               .name = "true",
+               .fn = builtin_true,
+       },
+       {
+               .name = "false",
+               .fn = builtin_false,
+       },
+       {
+               .name = "load_env",
+               .fn = builtin_load_env,
+       },
+       {
+               .name = "save_env",
+               .fn = builtin_save_env,
+       },
 };
 
 static const char *nops[] = {