freebsd-dev/stand
Ian Lepore e77f4eb2a0 Restore the ability to open a raw disk or partition in loader(8).
The disk_open() function searches for "the best partition" when slice and
partition information is not provided as part of the device name.  As of
r345477 the slice and partition fields of a disk_devdesc are initialized to
D_SLICEWILD and D_PARTWILD; in the past they were initialized to -1, which
was sometimes interpreted as meaning 'wildcard' and sometimes as 'open the
raw partition' depending on the context.  So as an unintended side effect of
r345477 it became basically impossible to ever open a disk or partition
without doing the 'best partition' search.  One visible effect of that was
the inability to open the raw disk to read the partition table correctly in
zfs_probe_dev(), leading to failures to find the zfs pool unless it was on
the first partition.

Now instead of always initializing slice and partition to wildcards, the
disk_parsedev() function initializes them based on the presence of a
path/file name following the device.  If there is any path or filename
following the ':' that ends the device name, then slice and partition are
initialized to D_SLICEWILD and D_PARTWILD.  If there is nothing after the
':' then it is considered to be a request to open the raw device or
partition itself (not a file stored within it), and the fields are
initialized to D_SLICENONE and D_PARTNONE.

With this change in place, all the tests in src/tools/boot are succesful
again, including the recently-added cases of booting from a zfs pool on
a partition other than slice 1 of the device.

PR:		236981
2019-04-25 15:09:21 +00:00
..
arm Go back to one loader.conf 2018-02-26 03:16:47 +00:00
arm64 No need to make objects here. 2018-04-27 22:15:18 +00:00
common Restore the ability to open a raw disk or partition in loader(8). 2019-04-25 15:09:21 +00:00
defaults Enable lualoader's kernel autodetection, disabled on install media 2018-10-11 17:17:54 +00:00
efi Create boot_img as a global variable 2019-04-22 18:40:24 +00:00
fdt stand: refactor overlay loading a little bit 2019-04-11 13:26:28 +00:00
ficl Enable veriexec for loader 2019-02-26 06:22:10 +00:00
ficl32 Enable veriexec for loader 2019-02-26 06:22:10 +00:00
forth Regularize the Netflix copyright 2019-02-04 21:28:25 +00:00
i386 stand: remove CLANG_NO_IAS from zfsldr 2019-03-26 20:32:05 +00:00
kshim A more definitions to kernel emulation shim in order to build stand/usb. 2018-02-07 18:50:36 +00:00
liblua Enable veriexec for loader 2019-02-26 06:22:10 +00:00
liblua32 Add Lua as a scripting langauge to /boot/loader 2018-02-12 15:31:53 +00:00
libsa Distinguish between "no partition" and "choose best partition" with a constant. 2019-03-24 18:51:52 +00:00
libsa32 Enable veriexec for loader 2019-02-26 06:22:10 +00:00
lua lualoader: Fix up some luacheck concerns 2019-03-26 02:35:58 +00:00
man Improve formatting. 2018-08-15 11:39:13 +00:00
mips Distinguish between "no partition" and "choose best partition" with a constant. 2019-03-24 18:51:52 +00:00
ofw Stop using ../zfs/libzfs.h but instead use libzfs.h. 2018-07-08 07:42:58 +00:00
powerpc stand: refactor overlay loading a little bit 2019-04-11 13:26:28 +00:00
sparc64 MK_ZFS -> {MK_ZFS|MK_LOADER_ZFS}, this is so we can diable userland / kernel 2019-01-05 22:45:20 +00:00
uboot stand: refactor overlay loading a little bit 2019-04-11 13:26:28 +00:00
usb Distinguish between "no partition" and "choose best partition" with a constant. 2019-03-24 18:51:52 +00:00
userboot Distinguish between "no partition" and "choose best partition" with a constant. 2019-03-24 18:51:52 +00:00
defs.mk Move inclusion of src.opts.mk later. 2018-12-03 17:51:10 +00:00
fdt.mk
ficl.mk Remove redundant defs.mk includes. They aren't needed. 2018-06-14 06:14:48 +00:00
loader.mk Create kernel module to parse Veriexec manifest based on envs 2019-04-03 03:57:37 +00:00
lua.mk Do not include float interfaces when using libsa. 2018-02-23 04:04:25 +00:00
Makefile Move ZFS files into libsa 2018-07-08 07:42:49 +00:00
Makefile.amd64 Create LOADER_UBOOT, and LOADER_OFW. Move these options out of 2018-03-01 19:50:55 +00:00
Makefile.inc Minor flags cleanup 2017-12-02 00:06:58 +00:00
uboot.mk Unify metadata load files for arm, mips, powerpc, sparc64 2018-02-13 03:44:50 +00:00