freebsd-dev/sys/boot/i386
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
..
boot0 Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to 2012-02-28 18:30:18 +00:00
boot0ext
boot0sio
boot2 Make boot2 build with Clang again. 2012-03-09 23:30:30 +00:00
btx btxldr: future-proof argument passing from boot1/2-ish to loader 2012-05-09 08:04:29 +00:00
cdboot Fix sys/boot/i386/cdboot/cdboot.S compilation with clang after r235219. 2012-05-11 18:07:23 +00:00
common btxldr: future-proof argument passing from boot1/2-ish to loader 2012-05-09 08:04:29 +00:00
efi sys/boot: add common CTASSERT definition 2012-05-09 07:55:42 +00:00
gptboot Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to 2012-02-28 18:30:18 +00:00
gptzfsboot Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to 2012-02-28 18:30:18 +00:00
kgzldr
libfirewire MF tbemd: Minor tweaks, prefer MACHINE_CPUARCH generally to MACHINE_ARCH 2010-08-23 01:42:09 +00:00
libi386 zfsboot/zfsloader: support accessing filesystems within a pool 2012-05-12 09:03:30 +00:00
loader zfsboot/zfsloader: support accessing filesystems within a pool 2012-05-12 09:03:30 +00:00
mbr Use -Wl,-N instead of the undocumented -N option for GCC. 2010-06-03 17:42:32 +00:00
pmbr Use -Wl,-N instead of the undocumented -N option for GCC. 2010-06-03 17:42:32 +00:00
pxeldr cdboot, pxeldr: make use of bootargs.h instead of redefining flag constants 2012-05-10 09:47:04 +00:00
zfsboot zfsboot/zfsloader: support accessing filesystems within a pool 2012-05-12 09:03:30 +00:00
zfsloader For consistency, change all 'i386' and MACHINE_ARCH to x86. 2010-08-31 19:01:12 +00:00
Makefile Don't build zfsboot, gptzfsboot, and zfsloader if WITHOUT_ZFS is enabled. 2009-12-22 20:56:33 +00:00
Makefile.inc When building some of the boot loaders with clang, and DEBUG_FLAGS or 2011-07-17 13:50:21 +00:00