freebsd-dev/stand
Kirk McKusick b21582ee03 Add a flags parameter to the ffs_sbget() function that reads UFS superblocks.
Rather than trying to shoehorn flags into the requested superblock
address, create a separate flags parameter to the ffs_sbget()
function in sys/ufs/ffs/ffs_subr.c. The ffs_sbget() function is
used both in the kernel and in user-level utilities through export
to the sbget() function in the libufs(3) library (see sbget(3)
for details). The kernel uses ffs_sbget() when mounting UFS
filesystems, in the glabel(8) and gjournal(8) GEOM utilities,
and in the standalone library used when booting the system
from a UFS root filesystem.

The ffs_sbget() function reads the superblock located at the byte
offset specified by its sblockloc parameter. The value UFS_STDSB
may be specified for sblockloc to request that the standard
location for the superblock be read.

The two existing options are now flags:

UFS_NOHASHFAIL will note if the check hash is wrong but will still
   return the superblock. This is used by the bootstrap code to
   give the system a chance to come up so that fsck can be run to
   correct the problem.

UFS_NOMSG indicates that superblock inconsistency error messages
   should not be printed. It is used by programs like fsck that
   want to print their own error message and programs like glabel(8)
   that just want to know if a UFS filesystem exists on a partition.

One additional flag is added:

UFS_NOCSUM causes only the superblock itself to be returned, but does
   not read in any auxiliary data structures like the cylinder group
   summary information. It is used by clients like glabel(8) that
   just want to check for possible filesystem types. Using UFS_NOCSUM
   skips the superblock checks for csum data which allows superblocks
   that have corrupted csum data to be read and used.

The validate_sblock() function checks that the superblock has not
been corrupted in a way that can crash or hang the system. Unless
the UFS_NOMSG flag is specified, it will print out any errors that
it finds. Prior to this commit, validate_sblock() returned as soon
as it found an inconsistency so would print at most one message.
It now does all its checks so when UFS_NOMSG has not been specified
will print out everything that it finds inconsistent.

Sponsored by: The FreeBSD Foundation
2022-07-30 22:51:38 -07:00
..
arm64 stand: Remove extra efi.h include 2022-07-15 12:00:49 -06:00
common stand: Move quit command to common commands 2022-07-30 04:48:35 -06:00
defaults Add support for getting early entropy from UEFI 2022-02-17 13:01:11 -08:00
efi stand: Move quit command to common commands 2022-07-30 04:48:35 -06:00
fdt Remove "All Rights Reserved" from Foundation copyrights 2022-06-30 10:49:09 -04:00
ficl ficl: Fix a typo in a comment 2021-11-30 10:36:29 +01:00
ficl32 Enable veriexec for loader 2019-02-26 06:22:10 +00:00
fonts loader: really use bold font for vga text mode 2021-01-08 01:24:30 +02:00
forth loader.4th(8): Fix a typo in the manual page 2022-04-02 15:11:59 +02:00
i386 stand: Make sure nobody has a NULL pointer for dv_cleanup 2022-07-27 09:04:13 -06:00
images loader: implement framebuffer console 2021-01-02 21:41:36 +02:00
kboot kboot: Make console raw when we start 2022-07-28 15:35:42 -06:00
kshim stand/usb: Fix build by declaring missing functions and types. 2022-03-17 15:26:24 +01:00
liblua EFI secure boot VECTX related changes 2021-04-30 12:53:45 -05:00
liblua32
libofw stand: Make sure nobody has a NULL pointer for dv_cleanup 2022-07-27 09:04:13 -06:00
libsa Add a flags parameter to the ffs_sbget() function that reads UFS superblocks. 2022-07-30 22:51:38 -07:00
libsa32 Enable veriexec for loader 2019-02-26 06:22:10 +00:00
lua Add support for getting early entropy from UEFI 2022-02-17 13:01:11 -08:00
man loader.efi: add cross-reference to loader(8) 2022-05-18 10:33:20 -04:00
powerpc loader: fix powerpc64le ofw loader 2022-07-29 05:13:19 -03:00
uboot stand: Use c99 structure initialization for uboot block device 2022-07-24 16:53:34 -06:00
usb mips: remove saf1761 2022-01-04 16:01:14 -07:00
userboot stand: Make sure nobody has a NULL pointer for dv_cleanup 2022-07-27 09:04:13 -06:00
defs.mk stand: remove mips support 2021-12-10 11:05:31 -07:00
fdt.mk
ficl.mk stand: remove mips support 2021-12-10 11:05:31 -07:00
loader.mk stand: Fix a common typo in source code comments 2022-06-05 09:49:51 +02:00
lua.mk
Makefile stand: Add a helper 'universe' target 2022-07-30 05:01:47 -06:00
Makefile.amd64 stand: properly declare subdir deps or .WAIT, do parallel build 2020-12-31 11:15:45 -06:00
Makefile.inc stand: properly declare subdir deps or .WAIT, do parallel build 2020-12-31 11:15:45 -06:00
veriexec.mk EFI secure boot VECTX related changes 2021-04-30 12:53:45 -05:00