Index: stand/common/paths.h =================================================================== --- stand/common/paths.h +++ stand/common/paths.h @@ -33,7 +33,6 @@ #define PATH_CONFIG "/boot/config" #define PATH_LOADER "/boot/loader" #define PATH_LOADER_EFI "/boot/loader.efi" -#define PATH_LOADER_ZFS "/boot/zfsloader" #define PATH_KERNEL "/boot/kernel/kernel" #endif /* _PATHS_H_ */ Index: stand/efi/loader/Makefile =================================================================== --- stand/efi/loader/Makefile +++ stand/efi/loader/Makefile @@ -81,6 +81,7 @@ # Always add MI sources .include "${BOOTSRC}/loader.mk" +SYMLINKS= ${BINDIR}/loader.efi ${BINDIR}/zfsloader.efi FILES+= loader.efi FILESMODE_loader.efi= ${BINMODE} Index: stand/i386/Makefile =================================================================== --- stand/i386/Makefile +++ stand/i386/Makefile @@ -18,6 +18,6 @@ SUBDIR.yes+= kgzldr .endif -SUBDIR.${MK_ZFS}+= zfsboot gptzfsboot zfsloader +SUBDIR.${MK_ZFS}+= zfsboot gptzfsboot .include Index: stand/i386/gptzfsboot/gptzfsboot.8 =================================================================== --- stand/i386/gptzfsboot/gptzfsboot.8 +++ stand/i386/gptzfsboot/gptzfsboot.8 @@ -71,7 +71,7 @@ .Cm bootfs property is not set, then the root filesystem of the pool is used as the default. -.Xr zfsloader 8 +.Xr loader 8 is loaded from the boot filesystem. If .Pa /boot.config @@ -83,7 +83,7 @@ .Pp The ZFS GUIDs of the first successfully probed device and the first detected pool are made available to -.Xr zfsloader 8 +.Xr loader 8 in the .Cm vfs.zfs.boot.primary_vdev and @@ -104,7 +104,7 @@ supports. .Pp The filesystem specification and the path to -.Xr zfsloader 8 +.Xr loader 8 are different from .Xr boot 8 . The format is @@ -116,7 +116,7 @@ Both the filesystem and the path can be specified. If only a path is specified, then the default filesystem is used. If only a pool and filesystem are specified, then -.Pa /boot/zfsloader +.Pa /boot/loader is used as a path. .Pp Additionally, the @@ -128,7 +128,7 @@ .Pp The configured or automatically determined ZFS boot filesystem is stored in the -.Xr zfsloader 8 +.Xr loader 8 .Cm loaddev variable, and also set as the initial value of the .Cm currdev @@ -171,7 +171,6 @@ .Xr boot 8 , .Xr gpart 8 , .Xr loader 8 , -.Xr zfsloader 8 , .Xr zpool 8 .Sh HISTORY .Nm Index: stand/i386/loader/Makefile =================================================================== --- stand/i386/loader/Makefile +++ stand/i386/loader/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +HAVE_ZFS= yes + LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes @@ -62,6 +64,7 @@ ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC} +SYMLINKS= ${BINDIR}/${LOADER} ${BINDIR}/zfs${LOADER} FILES+= ${LOADER} # XXX INSTALLFLAGS_loader= -b FILESMODE_${LOADER}= ${BINMODE} -b Index: stand/i386/zfsboot/zfsboot.8 =================================================================== --- stand/i386/zfsboot/zfsboot.8 +++ stand/i386/zfsboot/zfsboot.8 @@ -114,7 +114,6 @@ .Xr boot 8 , .Xr gptzfsboot 8 , .Xr loader 8 , -.Xr zfsloader 8 , .Xr zpool 8 .Sh HISTORY .Nm Index: stand/i386/zfsboot/zfsboot.c =================================================================== --- stand/i386/zfsboot/zfsboot.c +++ stand/i386/zfsboot/zfsboot.c @@ -848,7 +848,7 @@ */ if (autoboot && !*kname) { - memcpy(kname, PATH_LOADER_ZFS, sizeof(PATH_LOADER_ZFS)); + memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER)); if (!keyhit(3)) { load(); memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); Index: stand/i386/zfsloader/Makefile =================================================================== --- stand/i386/zfsloader/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -LOADER= zfsloader -NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 -HAVE_ZFS= yes -CFLAGS+= -DBOOTPROG=\"zfsloader\" - -.include "${.CURDIR}/../loader/Makefile" Index: stand/i386/zfsloader/Makefile.depend =================================================================== --- stand/i386/zfsloader/Makefile.depend +++ /dev/null @@ -1,21 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/xlocale \ - stand/ficl32 \ - stand/geli \ - stand/i386/btx/btx \ - stand/i386/btx/btxldr \ - stand/i386/btx/lib \ - stand/i386/libi386 \ - stand/libsa32 \ - stand/zfs32 \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif Index: stand/lua/core.lua.8 =================================================================== --- stand/lua/core.lua.8 +++ stand/lua/core.lua.8 @@ -169,7 +169,7 @@ and .Ev bootenvs_count variables set by -.Xr zfsloader 8 . +.Xr loader 8 . .It Fn core.setDefaults Resets ACPI, safe mode, single user, and verbose settings to their system defauilts. Index: stand/man/Makefile =================================================================== --- stand/man/Makefile +++ stand/man/Makefile @@ -3,8 +3,5 @@ .include MAN+= loader.8 -.if ${MK_ZFS} != "no" -MAN+= zfsloader.8 -.endif .include Index: stand/man/loader.8 =================================================================== --- stand/man/loader.8 +++ stand/man/loader.8 @@ -1038,6 +1038,52 @@ .It -259 Unspecified error. .El +.Sh ZFS FEATURES +.Nm +supports the following format for specifying ZFS filesystems which +can be used wherever +.Xr loader 8 +refers to a device specification: +.Pp +.Ar zfs:pool/filesystem: +.Pp +where +.Pa pool/filesystem +is a ZFS filesystem name as described in +.Xr zfs 8 . +.Pp +If +.Pa /etc/fstab +does not have an entry for the root filesystem and +.Va vfs.root.mountfrom +is not set, but +.Va currdev +refers to a ZFS filesystem, then +.Nm +will instruct kernel to use that filesystem as the root filesystem. +.Sh ZFS COMMAND EXTENSIONS +.Bl -tag -width Ds -compact +.It Ic lsdev Op Fl v +Lists ZFS pools in addition to disks and partitions. +Adding +.Fl v +shows more ZFS pool details in a format that resembles +.Nm zpool Cm status +output. +.Pp +.It Ic lszfs Ar filesystem +A ZFS extended command that can be used to explore the ZFS filesystem +hierarchy in a pool. +Lists the immediate children of the +.Ar filesystem . +The filesystem hierarchy is rooted at a filesystem with the same name +as the pool. +.El +.Sh EXAMPLES +Set the default device used for loading a kernel from a ZFS filesystem: +.Bd -literal -offset indent +set currdev=zfs:tank/ROOT/knowngood: +.Ed .Sh SEE ALSO .Xr libstand 3 , .Xr loader.conf 5 , Index: stand/man/zfsloader.8 =================================================================== --- stand/man/zfsloader.8 +++ /dev/null @@ -1,106 +0,0 @@ -.\" Copyright (c) 2014 Andriy Gapon -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" $FreeBSD$ -.\" -.Dd September 15, 2014 -.Dt ZFSLOADER 8 -.Os -.Sh NAME -.Nm zfsloader -.Nd kernel bootstrapping final stage -.Sh DESCRIPTION -.Nm -is an extended variant of -.Xr loader 8 -with added support for booting from ZFS. -This document describes only differences from -.Xr loader 8 . -.Sh ZFS FEATURES -.Nm -supports the following format for specifying ZFS filesystems which -can be used wherever -.Xr loader 8 -refers to a device specification: -.Pp -.Ar zfs:pool/filesystem: -.Pp -where -.Pa pool/filesystem -is a ZFS filesystem name as described in -.Xr zfs 8 . -.Pp -If -.Pa /etc/fstab -does not have an entry for the root filesystem and -.Va vfs.root.mountfrom -is not set, but -.Va currdev -refers to a ZFS filesystem, then -.Nm -will instruct kernel to use that filesystem as the root filesystem. -.Sh ZFS COMMAND EXTENSIONS -.Bl -tag -width Ds -compact -.It Ic lsdev Op Fl v -Lists ZFS pools in addition to disks and partitions. -Adding -.Fl v -shows more ZFS pool details in a format that resembles -.Nm zpool Cm status -output. -.Pp -.It Ic lszfs Ar filesystem -A ZFS extended command that can be used to explore the ZFS filesystem -hierarchy in a pool. -Lists the immediate children of the -.Ar filesystem . -The filesystem hierarchy is rooted at a filesystem with the same name -as the pool. -.El -.Sh FILES -.Bl -tag -width /boot/zfsloader -compact -.It Pa /boot/zfsloader -.Nm -itself. -.El -.Sh EXAMPLES -Set the default device used for loading a kernel from a ZFS filesystem: -.Bd -literal -offset indent -set currdev=zfs:tank/ROOT/knowngood: -.Ed -.Sh SEE ALSO -.Xr gptzfsboot 8 , -.Xr loader 8 , -.Xr zfs 8 , -.Xr zfsboot 8 , -.Xr zfsloader 8 , -.Xr zpool 8 -.Sh HISTORY -The -.Nm -first appeared in -.Fx 7.3 . -.Sh AUTHORS -This manual page was written by -.An Andriy Gapon Aq avg@FreeBSD.org . Index: stand/sparc64/Makefile =================================================================== --- stand/sparc64/Makefile +++ stand/sparc64/Makefile @@ -5,6 +5,6 @@ .include SUBDIR.yes= boot1 loader -SUBDIR.${MK_ZFS}+=zfsboot zfsloader +SUBDIR.${MK_ZFS}+=zfsboot .include Index: stand/sparc64/loader/Makefile =================================================================== --- stand/sparc64/loader/Makefile +++ stand/sparc64/loader/Makefile @@ -40,6 +40,8 @@ LDFLAGS+= -static +SYMLINKS= ${BINDIR}/loader ${BINDIR}/zfsloader + # Open Firmware standalone support library LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a CFLAGS+= -I${BOOTSRC}/ofw/libofw/ Index: stand/sparc64/zfsloader/Makefile =================================================================== --- stand/sparc64/zfsloader/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -PROG= zfsloader -NEWVERSWHAT= "ZFS enabled bootstrap loader" sparc64 -HAVE_ZFS= yes -CFLAGS+= -DBOOTPROG=\"zfsloader\" - -.include "${.CURDIR}/../loader/Makefile"