aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorToomas Soome <tsoome@FreeBSD.org>2020-09-21 09:01:10 +0000
committerToomas Soome <tsoome@FreeBSD.org>2020-09-21 09:01:10 +0000
commite307eb94ae520d98dc1d346a0c53667a41beab5d (patch)
tree388cef449cfe2f57e0f2c494db23b11a1390072f /share
parent7d54cc9165a3990849b60835c85ddb388905e1b7 (diff)
loader: zfs should support bootonce an nextboot
bootonce feature is temporary, one time boot, activated by "bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag. By default, the bootonce setting is reset on attempt to boot and the next boot will use previously active BE. By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will be set permanently active. bootonce dataset name is recorded in boot pool labels, bootenv area. in case of nextboot, the nextboot_enable boolean variable is recorded in freebsd:nvstore nvlist, also stored in boot pool label bootenv area. On boot, the loader will process /boot/nextboot.conf if nextboot_enable is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf processing on next boot. bootonce and nextboot features are usable in both UEFI and BIOS boot. To use bootonce/nextboot features, the boot loader needs to be updated on disk; if loader.efi is stored on ESP, then ESP needs to be updated and for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated (gpart or other tools). At this time, only lua loader is updated. Sponsored by: Netflix, Klara Inc. Differential Revision: https://reviews.freebsd.org/D25512
Notes
svn path=/head/; revision=365938
Diffstat (limited to 'share')
-rw-r--r--share/man/man5/rc.conf.58
-rw-r--r--share/mk/bsd.libnames.mk1
-rw-r--r--share/mk/src.libnames.mk5
3 files changed, 12 insertions, 2 deletions
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index 38bb2f953b07..b824426a91d2 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 11, 2020
+.Dd Sep 21, 2020
.Dt RC.CONF 5
.Os
.Sh NAME
@@ -4574,6 +4574,12 @@ If set to
removes empty
.Dq Li rc.conf.d
files.
+.It Va zfs_bootonce_activate
+.Pq Vt bool
+If set to
+.Dq Li YES ,
+and a boot environment marked bootonce is successfully booted,
+it will be made permanently active.
.El
.Sh FILES
.Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact
diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk
index 4e6a387aa39a..ad7d549cad4c 100644
--- a/share/mk/bsd.libnames.mk
+++ b/share/mk/bsd.libnames.mk
@@ -169,6 +169,7 @@ LIBYPCLNT?= ${LIBDESTDIR}${LIBDIR_BASE}/libypclnt.a
LIBZ?= ${LIBDESTDIR}${LIBDIR_BASE}/libz.a
LIBZFS?= ${LIBDESTDIR}${LIBDIR_BASE}/libzfs.a
LIBZFS_CORE?= ${LIBDESTDIR}${LIBDIR_BASE}/libzfs_core.a
+LIBZFSBOOTENV?= ${LIBDESTDIR}${LIBDIR_BASE}/libzfsbootenv.a
LIBZPOOL?= ${LIBDESTDIR}${LIBDIR_BASE}/libzpool.a
LIBZUTIL?= ${LIBDESTDIR}${LIBDIR_BASE}/libzutil.a
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index 8a7768a8318c..612cd6604025 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -202,6 +202,7 @@ _LIBRARIES= \
z \
zfs_core \
zfs \
+ zfsbootenv \
zpool \
zutil
@@ -385,10 +386,11 @@ _DP_tpool= spl
_DP_uutil= avl spl
_DP_zfs= md pthread umem util uutil m avl bsdxml crypto geom nvpair \
z zfs_core zutil
+_DP_zfsbootenv= zfs nvpair
_DP_zfs_core= nvpair
_DP_zpool= md pthread z icp spl nvpair avl umem
_DP_zutil= avl tpool
-_DP_be= zfs spl nvpair
+_DP_be= zfs spl nvpair zfsbootenv
_DP_netmap=
_DP_ifconfig= m
@@ -600,6 +602,7 @@ LIBUMEMDIR= ${OBJTOP}/cddl/lib/libumem
LIBUUTILDIR= ${OBJTOP}/cddl/lib/libuutil
LIBZFSDIR= ${OBJTOP}/cddl/lib/libzfs
LIBZFS_COREDIR= ${OBJTOP}/cddl/lib/libzfs_core
+LIBZFSBOOTENVDIR= ${OBJTOP}/cddl/lib/libzfsbootenv
LIBZPOOLDIR= ${OBJTOP}/cddl/lib/libzpool
LIBZUTILDIR= ${OBJTOP}/cddl/lib/libzutil
LIBTPOOLDIR= ${OBJTOP}/cddl/lib/libtpool