summaryrefslogtreecommitdiffstats
path: root/discover
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-09-17 15:09:41 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-09-24 13:14:59 +0800
commit27037bcd151ff8ecad1aaca7eaa06fb5c3f9fd1f (patch)
tree87e53d144c1f1c7aee360985fd8940a90336cfe1 /discover
parenta33e7992485e95a60add27af37327dc9f0eb3a34 (diff)
downloadtalos-petitboot-27037bcd151ff8ecad1aaca7eaa06fb5c3f9fd1f.tar.gz
talos-petitboot-27037bcd151ff8ecad1aaca7eaa06fb5c3f9fd1f.zip
discover/grub2: Add nops for unnecessary builtins
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover')
-rw-r--r--discover/grub2/builtins.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/discover/grub2/builtins.c b/discover/grub2/builtins.c
index 8171b8d..4261eeb 100644
--- a/discover/grub2/builtins.c
+++ b/discover/grub2/builtins.c
@@ -123,6 +123,14 @@ static int builtin_search(struct grub2_script *script,
return 0;
}
+static int builtin_nop(struct grub2_script *script __attribute__((unused)),
+ void *data __attribute__((unused)),
+ int argc __attribute__((unused)),
+ char *argv[] __attribute__((unused)))
+{
+ return 0;
+}
+
static struct {
const char *name;
grub2_function fn;
@@ -145,6 +153,10 @@ static struct {
}
};
+static const char *nops[] = {
+ "echo", "export", "insmod", "loadfont", "terminfo",
+};
+
void register_builtins(struct grub2_script *script)
{
unsigned int i;
@@ -152,4 +164,7 @@ void register_builtins(struct grub2_script *script)
for (i = 0; i < ARRAY_SIZE(builtins); i++)
script_register_function(script, builtins[i].name,
builtins[i].fn, NULL);
+
+ for (i = 0; i < ARRAY_SIZE(nops); i++)
+ script_register_function(script, nops[i], builtin_nop, NULL);
}
OpenPOWER on IntegriCloud