freebsd-dev/sys/boot/common
Andriy Gapon 1702e62f67 zfsboot/zfsloader: support accessing filesystems within a pool
In zfs loader zfs device name format now is "zfs:pool/fs",
fully qualified file path is "zfs:pool/fs:/path/to/file"
loader allows accessing files from various pools and filesystems as well
as changing currdev to a different pool/filesystem.

zfsboot accepts kernel/loader name in a format pool:fs:path/to/file or,
as before, pool:path/to/file; in the latter case a default filesystem
is used (pool root or bootfs).  zfsboot passes guids of the selected
pool and dataset to zfsloader to be used as its defaults.

zfs support should be architecture independent and is provided
in a separate library, but architectures wishing to use this zfs support
still have to provide some glue code and their devdesc should be
compatible with zfs_devdesc.
arch_zfs_probe method is used to discover all disk devices that may
be part of ZFS pool(s).

libi386 unconditionally includes zfs support, but some zfs-specific
functions are stubbed out as weak symbols.  The strong definitions
are provided in libzfsboot.
This change mean that the size of i386_devspec becomes larger
to match zfs_devspec.

Backward-compatibility shims are provided for recently added sparc64
zfs boot support.  Currently that architecture still works the old
way and does not support the new features.

TODO:
- clear up pool root filesystem vs pool bootfs filesystem distinction
- update sparc64 support
- set vfs.root.mountfrom based on currdev (for zfs)

Mid-future TODO:
- loader sub-menu for selecting alternative boot environment

Distant future TODO:
- support accessing snapshots, using a snapshot as readonly root

Reviewed by:	marius (sparc64),
		Gavin Mu <gavin.mu@gmail.com> (sparc64)
Tested by:	Florian Wagner <florian@wagner-flo.net> (x86),
		marius (sparc64)
No objections:	fs@, hackers@
MFC after:	1 month
2012-05-12 09:03:30 +00:00
..
bcache.c
boot.c
bootstrap.h zfsboot/zfsloader: support accessing filesystems within a pool 2012-05-12 09:03:30 +00:00
commands.c
console.c
crc32.c Remove second consts in r233288 in order to appease C++ compilers. 2012-03-26 18:22:04 +00:00
crc32.h - Split code shared by almost any boot loader into separate files and 2010-09-24 19:49:12 +00:00
dev_net.c
dev_net.h
devopen.c
disk.c With LOADER_MBR_SUPPORT defined and LOADER_GPT_SUPPORT undefined we would 2011-10-20 15:46:54 +00:00
disk.h Add a version of the FreeBSD bootloader which can run in userland, packaged 2011-06-30 16:08:56 +00:00
gpt.c Read backup GPT header from the last LBA only when primary GPT header and 2012-04-12 12:37:53 +00:00
gpt.h - Split code shared by almost any boot loader into separate files and 2010-09-24 19:49:12 +00:00
help.common
interp_backslash.c
interp_forth.c
interp_parse.c Replace index() and rindex() calls with strchr() and strrchr(). 2012-01-03 18:51:58 +00:00
interp.c a whitespace nit 2011-05-07 13:57:30 +00:00
isapnp.c
isapnp.h
load_elf32_obj.c
load_elf32.c
load_elf64_obj.c
load_elf64.c
load_elf_obj.c Minimize backward seeks when trying to load ELF relocatable modules. 2011-06-19 13:35:41 +00:00
load_elf.c Add a version of the FreeBSD bootloader which can run in userland, packaged 2011-06-30 16:08:56 +00:00
loader.8 Remove trailing whitespace per mdoc lint warning 2012-03-29 05:02:12 +00:00
ls.c
Makefile.inc Add a version of the FreeBSD bootloader which can run in userland, packaged 2011-06-30 16:08:56 +00:00
md.c
merge_help.awk
misc.c
module.c Fix a long standing bug where file_load() passes down the global loadaddr 2011-04-04 16:59:46 +00:00
newvers.sh
panic.c
pnp.c
reloc_elf32.c
reloc_elf64.c
reloc_elf.c Add a version of the FreeBSD bootloader which can run in userland, packaged 2011-06-30 16:08:56 +00:00
ufsread.c Declare some variables static in order to reduce the object size and 2012-03-18 02:19:30 +00:00
util.c Fix buffer overflow in sys/boot/common/util.c's printf(), when printing 2011-08-08 20:53:04 +00:00
util.h Rename bcpy() macro to bcopy(). 2011-02-27 12:25:47 +00:00