History log of /freebsd-current/stand/userboot/test/test.c
Revision Date Author Comments
# 46b606c8 30-Apr-2024 Stephen J. Kiernan <stevek@FreeBSD.org>

userboot: support environment and symlinks in test application

Pass the environment on to the loader.
Also define USERBOOT=1 in the environment varables.

Add support for symlinks in the test application open callback.

stat the root directory when opening file
Without this, running "ls" command on the root directory encounters
issues getting the directory listing.

Reviewed by: jhb
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D44625


# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 942e52f7 01-Jun-2022 Toomas Soome <tsoome@FreeBSD.org>

test_diskread(): detect end of the disk

Detect the end of the disk condition. This may happpen when
disk image is truncated and the reads are addressing blocks past
image end.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35432


# e307eb94 21-Sep-2020 Toomas Soome <tsoome@FreeBSD.org>

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


# 53f151f9 25-Mar-2020 Simon J. Gerraty <sjg@FreeBSD.org>

Fix pkgfs stat so it satisfies libsecureboot

We need a valid st_dev, st_ino and st_mtime
to correctly track which files have been verified
and to update our notion of time.

ve_utc_set(): ignore utc if it would jump our current time
by more than VE_UTC_MAX_JUMP (20 years).

Allow testing of install command via userboot.
Need to fix its stat implementation too.

bhyveload also needs stat fixed - due to change to userboot.h

Call ve_error_get() from vectx_close() when hash is wrong.

Track the names of files we have hashed into pcr

For the purposes of measured boot, it is important
to be able to reproduce the hash reflected in
loader.ve.pcr
so loader.ve.hashed provides a list of names in the order they
were added.

Reviewed by: imp
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org//D24027


# bcbb1e60 03-Nov-2019 Toomas Soome <tsoome@FreeBSD.org>

loader: userboot/test should accept more than one disk

allow to specify multiple -d options, test -d disk1 -d disk2 ..


# 96b2f9c9 24-Oct-2019 Toomas Soome <tsoome@FreeBSD.org>

userboot/test should use PRIx64 as one would expect from prefix 0x

Test is printing decimal value after prefix 0x.


# e8e6a5f9 05-Dec-2017 Warner Losh <imp@FreeBSD.org>

Make putenv and getenv match the userland definition of these
functions, tweak man page and one variable that shouldn't be const
anymore.

Sponsored by: Netflix


# d927d443 23-Nov-2017 Warner Losh <imp@FreeBSD.org>

Mark the func pointer as __dead2. It looks up loader_main, which
either aborts or exits, but never returns. Tag it as a non-returning
function rather than supply a bogus return(0) at the end of main.

CID: 1382885
Sponsored by: Netflix


# ca987d46 14-Nov-2017 Warner Losh <imp@FreeBSD.org>

Move sys/boot to stand. Fix all references to new location

Sponsored by: Netflix