Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115812984
D38005.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D38005.diff
View Options
diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h
--- a/stand/common/bootstrap.h
+++ b/stand/common/bootstrap.h
@@ -415,6 +415,7 @@
/* common code to set currdev variable. */
int gen_setcurrdev(struct env_var *ev, int flags, const void *value);
int mount_currdev(struct env_var *, int, const void *);
+void set_currdev(const char *devname);
#ifndef CTASSERT
#define CTASSERT(x) _Static_assert(x, "compile-time assertion failed")
diff --git a/stand/common/misc.c b/stand/common/misc.c
--- a/stand/common/misc.c
+++ b/stand/common/misc.c
@@ -206,3 +206,20 @@
return (mount_currdev(ev, flags, value));
}
+
+/*
+ * Wrapper to set currdev and loaddev at the same time.
+ */
+void
+set_currdev(const char *devname)
+{
+
+ env_setenv("currdev", EV_VOLATILE, devname, gen_setcurrdev,
+ env_nounset);
+ /*
+ * Don't execute hook here; the loaddev hook makes it immutable
+ * once we've determined what the proper currdev is.
+ */
+ env_setenv("loaddev", EV_VOLATILE | EV_NOHOOK, devname, env_noset,
+ env_nounset);
+}
diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -185,20 +185,6 @@
return retval;
}
-static void
-set_currdev(const char *devname)
-{
-
- env_setenv("currdev", EV_VOLATILE, devname, gen_setcurrdev,
- env_nounset);
- /*
- * Don't execute hook here; the loaddev hook makes it immutable
- * once we've determined what the proper currdev is.
- */
- env_setenv("loaddev", EV_VOLATILE | EV_NOHOOK, devname, env_noset,
- env_nounset);
-}
-
static void
set_currdev_devdesc(struct devdesc *currdev)
{
diff --git a/stand/i386/loader/main.c b/stand/i386/loader/main.c
--- a/stand/i386/loader/main.c
+++ b/stand/i386/loader/main.c
@@ -383,10 +383,7 @@
init_zfs_boot_options(devformat(&new_currdev.dd));
#endif
- env_setenv("currdev", EV_VOLATILE, devformat(&new_currdev.dd),
- gen_setcurrdev, env_nounset);
- env_setenv("loaddev", EV_VOLATILE, devformat(&new_currdev.dd),
- env_noset, env_nounset);
+ set_currdev(devformat(&new_currdev.dd));
}
COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot);
diff --git a/stand/userboot/userboot/main.c b/stand/userboot/userboot/main.c
--- a/stand/userboot/userboot/main.c
+++ b/stand/userboot/userboot/main.c
@@ -224,16 +224,6 @@
exit(0);
}
-static void
-set_currdev(const char *devname)
-{
-
- env_setenv("currdev", EV_VOLATILE, devname,
- gen_setcurrdev, env_nounset);
- env_setenv("loaddev", EV_VOLATILE, devname,
- env_noset, env_nounset);
-}
-
/*
* Set the 'current device' by (if possible) recovering the boot device as
* supplied by the initial bootstrap.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 30, 12:50 AM (18 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17849020
Default Alt Text
D38005.diff (2 KB)
Attached To
Mode
D38005: stand: create common set_currdev
Attached
Detach File
Event Timeline
Log In to Comment