aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/i386/loader/conf.c
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2012-05-12 09:03:30 +0000
committerAndriy Gapon <avg@FreeBSD.org>2012-05-12 09:03:30 +0000
commit1702e62f67dacc0c3cbd77c73f9f611340850872 (patch)
treedf061398b6750e42dc38884e817fdece2299ea9e /sys/boot/i386/loader/conf.c
parent8521fde5fcdeb608534fd924f75119ab242f1a7d (diff)
downloadsrc-1702e62f67dacc0c3cbd77c73f9f611340850872.tar.gz
src-1702e62f67dacc0c3cbd77c73f9f611340850872.zip
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
Notes
Notes: svn path=/head/; revision=235329
Diffstat (limited to 'sys/boot/i386/loader/conf.c')
-rw-r--r--sys/boot/i386/loader/conf.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/boot/i386/loader/conf.c b/sys/boot/i386/loader/conf.c
index bd14f47079de..09d6a4e2fa59 100644
--- a/sys/boot/i386/loader/conf.c
+++ b/sys/boot/i386/loader/conf.c
@@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$");
#include <stand.h>
#include <bootstrap.h>
#include "libi386/libi386.h"
+#if defined(LOADER_ZFS_SUPPORT)
+#include "../zfs/libzfs.h"
+#endif
/*
* We could use linker sets for some or all of these, but
@@ -50,10 +53,6 @@ __FBSDID("$FreeBSD$");
extern struct devsw fwohci;
#endif
-#if defined(LOADER_ZFS_SUPPORT)
-extern struct devsw zfs_dev;
-#endif
-
/* Exported for libstand */
struct devsw *devsw[] = {
&bioscd,
@@ -70,10 +69,6 @@ struct devsw *devsw[] = {
NULL
};
-#if defined(LOADER_ZFS_SUPPORT)
-extern struct fs_ops zfs_fsops;
-#endif
-
struct fs_ops *file_system[] = {
&ufs_fsops,
&ext2fs_fsops,