Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177306558
D39412.1794117710.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D39412.1794117710.diff
View Options
diff --git a/stand/efi/boot1/zfs_module.c b/stand/efi/boot1/zfs_module.c
--- a/stand/efi/boot1/zfs_module.c
+++ b/stand/efi/boot1/zfs_module.c
@@ -40,6 +40,8 @@
static dev_info_t *devices;
+static char zfs_bootonce[VDEV_PAD_SIZE];
+
uint64_t
ldi_get_size(void *priv)
{
@@ -165,6 +167,16 @@
return (EFI_NOT_FOUND);
}
+ /*
+ * OK. We've found a filesystem. Any attempt to use it should clear the
+ * 'once' flag. Prior to now, we'd not be able to clear it anyway. We
+ * don't care if we can't find the files to boot, or if there's a
+ * problem with it: we've tried to use it once we're able to mount the
+ * ZFS dataset.
+ */
+ *zfs_bootonce = '\0';
+ zfs_get_bootonce_spa(spa, OS_BOOTONCE, zfs_bootonce, sizeof(zfs_bootonce));
+
if ((err = zfs_lookup(&zmount, filepath, &dn)) != 0) {
if (err == ENOENT) {
DPRINTF("Failed to find '%s' on pool '%s' (%d)\n",
@@ -220,6 +232,18 @@
printf("\n");
}
+static const char *
+extra_env(void)
+{
+ char *rv = NULL; /* So we return NULL if asprintf fails */
+
+ if (*zfs_bootonce == '\0')
+ return NULL;
+ asprintf(&rv, "zfs-bootonce=%s", zfs_bootonce);
+ return (rv);
+}
+
+
static void
init(void)
{
@@ -241,5 +265,6 @@
.probe = probe,
.load = load,
.status = status,
- .devices = _devices
+ .devices = _devices,
+ .extra_env = extra_env,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 8, 6:01 AM (23 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41568646
Default Alt Text
D39412.1794117710.diff (1 KB)
Attached To
Mode
D39412: stand/boot1.efi: Implement bootonce for ZFS
Attached
Detach File
Event Timeline