X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fgrub2%2Fbuiltins.c;h=c218bc7d07155bd6426d630f26bf623f0bcb4bb6;hp=1ce63cf13103c8f2157029bca3464a5110e0f1f2;hb=b16b116422f1fb817924f4d2c3d9b1354da35614;hpb=01294f44e244b3c3ab5e19e98a8f98d8eee93922 diff --git a/discover/grub2/builtins.c b/discover/grub2/builtins.c index 1ce63cf..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; @@ -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[] = {