aboutsummaryrefslogtreecommitdiff
path: root/stand/uboot
diff options
context:
space:
mode:
authorToomas Soome <tsoome@FreeBSD.org>2021-08-12 05:45:52 +0000
committerToomas Soome <tsoome@FreeBSD.org>2021-09-08 01:01:20 +0000
commitb4cb3fe0e39a31e60292018dc9fb7510b3de92bf (patch)
treedf930aa46831d65bd291028da6d4032698a82e3d /stand/uboot
parentc90cab0d668af5d947054e47184d4f8dcb874ec8 (diff)
downloadsrc-b4cb3fe0e39a31e60292018dc9fb7510b3de92bf.tar.gz
src-b4cb3fe0e39a31e60292018dc9fb7510b3de92bf.zip
loader: implement mount/unmount rootfs
We want to keep our root file system open to preserve bcache segment between file accesses, thus reducing physical disk IO. Reviewed by: imp, allanjude, kevans (previous version) Differential Revision: https://reviews.freebsd.org/D30848 MFC after: 1 month
Diffstat (limited to 'stand/uboot')
-rw-r--r--stand/uboot/common/main.c3
-rw-r--r--stand/uboot/lib/devicename.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/stand/uboot/common/main.c b/stand/uboot/common/main.c
index b8bd1cf05089..85ddf5db1f90 100644
--- a/stand/uboot/common/main.c
+++ b/stand/uboot/common/main.c
@@ -475,6 +475,9 @@ main(int argc, char **argv)
meminfo();
+ /* Set up currdev variable to have hooks in place. */
+ env_setenv("currdev", EV_VOLATILE, "", uboot_setcurrdev, env_nounset);
+
/*
* Enumerate U-Boot devices
*/
diff --git a/stand/uboot/lib/devicename.c b/stand/uboot/lib/devicename.c
index cda16ded62a7..b6b0e6e40639 100644
--- a/stand/uboot/lib/devicename.c
+++ b/stand/uboot/lib/devicename.c
@@ -195,6 +195,6 @@ uboot_setcurrdev(struct env_var *ev, int flags, const void *value)
if ((rv = uboot_parsedev(&ncurr, value, NULL)) != 0)
return (rv);
free(ncurr);
- env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL);
- return (0);
+
+ return (mount_currdev(ev, flags, value));
}