diff options
author | Alan Dunn <amdunn@google.com> | 2016-03-02 08:59:02 -0800 |
---|---|---|
committer | Sam Mendoza-Jonas <sam@mendozajonas.com> | 2016-03-15 14:10:22 +1100 |
commit | c19daa69bc15e73b7ebf79d5280ba62c86c20b6f (patch) | |
tree | 2cb1d9620a3e8d96fc3d3285b568e0e126591c98 /discover/grub2 | |
parent | 939660528bf1568c55b6dcf982cc9020c1dbcdd2 (diff) | |
download | talos-petitboot-c19daa69bc15e73b7ebf79d5280ba62c86c20b6f.tar.gz talos-petitboot-c19daa69bc15e73b7ebf79d5280ba62c86c20b6f.zip |
discover/grub2: Fix handling of positional parameters
Positional parameters are set in the environment with '$' prepended to
the name. This causes lookups to fail because parameter lookups don't
include the '$'.
TESTED:
Added a test that covers positional parameters in GRUB2 parser.
Build succeeds, tests pass.
Bootstrapped-by: Nancy Yuen <yuenn@google.com>
Signed-off-by: Alan Dunn <amdunn@google.com>
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover/grub2')
-rw-r--r-- | discover/grub2/script.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/discover/grub2/script.c b/discover/grub2/script.c index f521681..48c963e 100644 --- a/discover/grub2/script.c +++ b/discover/grub2/script.c @@ -380,7 +380,7 @@ static int function_invoke(struct grub2_script *script, /* set positional parameters */ for (i = 0; i < argc; i++) { - name = talloc_asprintf(script, "$%d", i); + name = talloc_asprintf(script, "%d", i); script_env_set(script, name, argv[i]); } |