summaryrefslogtreecommitdiffstats
path: root/discover/grub2/grub2.h
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2019-11-05 16:42:14 +0800
committerJeremy Kerr <jk@ozlabs.org>2019-11-29 13:54:10 +0800
commit8cb74c4502712162ba899bc06e2d0cf249a8697b (patch)
tree6e926be8a22c915e18705ed3bc2b8ae5a27f5cc8 /discover/grub2/grub2.h
parent1580c6557d4e703348edb0dda83814f8972e9f3d (diff)
downloadtalos-petitboot-8cb74c4502712162ba899bc06e2d0cf249a8697b.tar.gz
talos-petitboot-8cb74c4502712162ba899bc06e2d0cf249a8697b.zip
discover/grub2: expose a struct for grub2 file references
Currently, we have struct grub2_resource_info to keep references to boot payloads that may be returned in boot options, and be (conditionally) resolved by the parser. We'd also like to use the same semantics for other file references in the grub2 parser, for arbitrary usage in scripts - where files are also referenced by a path and an optional device. To do this, this change moves struct grub2_resource_info to grub2.h, and renames to struct grub2_file. Future changes will use this for script-internal file handling. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/grub2/grub2.h')
-rw-r--r--discover/grub2/grub2.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/discover/grub2/grub2.h b/discover/grub2/grub2.h
index 68176fb..73d91b2 100644
--- a/discover/grub2/grub2.h
+++ b/discover/grub2/grub2.h
@@ -107,6 +107,14 @@ struct grub2_parser {
bool inter_word;
};
+/* References to files in grub2 consist of an optional device and a path
+ * (specified here by UUID). If the dev is unspecified, we fall back to a
+ * default - usually the 'root' environment variable. */
+struct grub2_file {
+ char *dev;
+ char *path;
+};
+
/* type for builtin functions */
typedef int (*grub2_function)(struct grub2_script *script, void *data,
int argc, char *argv[]);
OpenPOWER on IntegriCloud