Commit Graph

13 Commits

Author SHA1 Message Date
Warner Losh
4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Allan Jude
c6a311678d nextboot: Improve the shell code used to figure out the zpool name
Reported by:	imp
Reviewed by:	imp, tsoome
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D30650
2021-06-05 14:32:18 +00:00
Conrad Meyer
eb7e125e58 nextboot(8): Fix behavior on non-ZFS /boot systems
Fix unquoted test for an empty value, which broke nextboot(8) on non-ZFS /boot
systems after r365938.

Discussed with:	allanjude, tsoome
X-MFC-With:	r365938
2020-09-23 17:04:27 +00:00
Toomas Soome
e307eb94ae 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
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Mark Johnston
ce2761f128 Include -a in the nextboot(8) usage string.
X-MFC-With: r297772
2016-04-14 18:03:55 +00:00
Mark Johnston
8553156023 nextboot(8): add a -a option for appending to a configuration.
By default, a nextboot invocation will clobber any existing nextboot
configuration.

MFC after:	2 weeks
Relnotes:	yes
2016-04-10 01:25:12 +00:00
Ed Maste
9a50115921 Add BSD copyright notice.
Approved by:	gordon@
2012-02-07 14:06:30 +00:00
Ed Maste
b7fa166b60 Add -e to set arbitrary kernel environment variables.
Nextboot(8) can now set any combination of kernel name (-k), kernel
options (-o), and environment strings (-e).  As a result of this change
-k also becomes optional.

Reviewed by:	freebsd-current (Ian Lepore, pluknet@, jhb@)
2012-01-31 15:32:05 +00:00
Andriy Gapon
aa997bb947 nextboot: warn about limitations of /boot/nextboot.conf on ZFS
MFC after:	1 week
2010-09-17 09:50:36 +00:00
Wes Peters
52488123f3 Revert previous change, "getopts" (with an 's') is a builtin in
/bin/sh.
2006-01-18 04:48:45 +00:00
Wes Peters
8812100321 Remove dependency on getopts because it is on /usr and we want to
use 'nextboot -D' in rc.  Option parsing cribbed from vgrind.sh.
2006-01-16 16:18:54 +00:00
Gordon Tetlow
a119f25995 Add a nextboot script to make it easier to control the loader nextboot
support. Also, hook it up to the build.

Approved by:	jake (mentor)
2002-05-24 04:06:03 +00:00