Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F165767225
D39407.id121341.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D39407.id121341.diff
View Options
diff --git a/stand/efi/boot1/boot1.c b/stand/efi/boot1/boot1.c
--- a/stand/efi/boot1/boot1.c
+++ b/stand/efi/boot1/boot1.c
@@ -96,6 +96,26 @@
buf = NULL;
}
+ /*
+ * See if there's any env variables the module wants to set. If so,
+ * append it to any config present.
+ */
+ if (mod->extra_env != NULL) {
+ const char *env = mod->extra_env();
+ if (env != NULL) {
+ size_t newlen = cmdsize + strlen(env) + 1;
+
+ cmd = realloc(cmd, newlen);
+ if (cmd == NULL)
+ goto errout;
+ if (cmdsize > 0)
+ strlcat(cmd, " ", newlen);
+ strlcat(cmd, env, newlen);
+ cmdsize = strlen(cmd);
+ free(__DECONST(char *, env));
+ }
+ }
+
if ((status = BS->LoadImage(TRUE, IH, efi_devpath_last_node(dev->devpath),
loaderbuf, loadersize, &loaderhandle)) != EFI_SUCCESS) {
printf("Failed to load image provided by %s, size: %zu, (%lu)\n",
diff --git a/stand/efi/boot1/boot_module.h b/stand/efi/boot1/boot_module.h
--- a/stand/efi/boot1/boot_module.h
+++ b/stand/efi/boot1/boot_module.h
@@ -94,6 +94,9 @@
/* valid devices as found by probe. */
dev_info_t *(*devices)(void);
+
+ /* return any environment variables to pass to next stage */
+ const char *(*extra_env)(void);
} boot_module_t;
extern const boot_module_t *boot_modules[];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 10, 5:50 PM (1 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36425941
Default Alt Text
D39407.id121341.diff (1 KB)
Attached To
Mode
D39407: stand/boot1.efi: Allow modules to add env variables
Attached
Detach File
Event Timeline
Log In to Comment