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
2020-09-21 09:01:10 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfsbootenv
|
|
|
|
.PATH: ${SRCTOP}/sys/contrib/openzfs/include
|
|
|
|
|
2022-07-22 08:43:39 +00:00
|
|
|
PACKAGE= zfs
|
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
2020-09-21 09:01:10 +00:00
|
|
|
LIB= zfsbootenv
|
|
|
|
SHLIB_MAJOR= 1
|
|
|
|
|
|
|
|
LIBADD= zfs
|
|
|
|
LIBADD+= nvpair
|
|
|
|
|
|
|
|
INCS= libzfsbootenv.h
|
|
|
|
USER_C= \
|
|
|
|
lzbe_device.c \
|
|
|
|
lzbe_util.c \
|
|
|
|
lzbe_pair.c
|
|
|
|
|
|
|
|
SRCS= $(USER_C)
|
|
|
|
|
|
|
|
CSTD= c99
|
|
|
|
CFLAGS+= -DIN_BASE
|
|
|
|
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
|
|
|
|
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/
|
|
|
|
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
|
|
|
|
CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
|
|
|
|
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include
|
|
|
|
CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
|
|
|
|
CFLAGS+= -DHAVE_ISSETUGID
|
|
|
|
CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h
|
|
|
|
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs
|
2022-01-22 22:05:15 +00:00
|
|
|
CFLAGS.lzbe_device.c= -Wno-cast-qual
|
|
|
|
CFLAGS.lzbe_util.c= -Wno-cast-qual
|
|
|
|
CFLAGS.lzbe_pair.c= -Wno-cast-qual
|
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
2020-09-21 09:01:10 +00:00
|
|
|
|
|
|
|
.include <bsd.lib.mk>
|