summaryrefslogtreecommitdiffstats
path: root/discover
diff options
context:
space:
mode:
authorAlan Dunn <amdunn@google.com>2016-03-02 08:59:02 -0800
committerSam Mendoza-Jonas <sam@mendozajonas.com>2016-03-15 14:10:22 +1100
commitc19daa69bc15e73b7ebf79d5280ba62c86c20b6f (patch)
tree2cb1d9620a3e8d96fc3d3285b568e0e126591c98 /discover
parent939660528bf1568c55b6dcf982cc9020c1dbcdd2 (diff)
downloadtalos-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')
-rw-r--r--discover/grub2/script.c2
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]);
}
OpenPOWER on IntegriCloud