X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=discover%2Fgrub2%2Fbuiltins.c;h=c218bc7d07155bd6426d630f26bf623f0bcb4bb6;hb=089d0a6eb769d531129a7cd1061493a1a24b4bef;hp=2e63fcd09b0733e5fc2ea143f4aab2d79da9328e;hpb=9cf9430d5a1db0addd4788798fd7275d2c514f3c;p=petitboot diff --git a/discover/grub2/builtins.c b/discover/grub2/builtins.c index 2e63fcd..c218bc7 100644 --- a/discover/grub2/builtins.c +++ b/discover/grub2/builtins.c @@ -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; @@ -271,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[] = {