summaryrefslogtreecommitdiffstats
path: root/sys/boot/common
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2012-05-12 09:03:30 +0000
committeravg <avg@FreeBSD.org>2012-05-12 09:03:30 +0000
commita1cf7817fdc316198beb7e881a16684b20ea9ab8 (patch)
treedf061398b6750e42dc38884e817fdece2299ea9e /sys/boot/common
parent8f2a8ac2b1384a6b3dd4d5d11d4522ea728f9882 (diff)
downloadFreeBSD-src-a1cf7817fdc316198beb7e881a16684b20ea9ab8.zip
FreeBSD-src-a1cf7817fdc316198beb7e881a16684b20ea9ab8.tar.gz
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
Diffstat (limited to 'sys/boot/common')
-rw-r--r--sys/boot/common/bootstrap.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/boot/common/bootstrap.h b/sys/boot/common/bootstrap.h
index 4c92ba8..f6eab3d 100644
--- a/sys/boot/common/bootstrap.h
+++ b/sys/boot/common/bootstrap.h
@@ -317,6 +317,9 @@ struct arch_switch
#else
void (*arch_loadseg)(void *eh, void *ph, uint64_t delta);
#endif
+
+ /* Probe ZFS pool(s), if needed. */
+ void (*arch_zfs_probe)(void);
};
extern struct arch_switch archsw;
OpenPOWER on IntegriCloud