diff --git a/usr/src/boot/sys/boot/i386/libi386/Makefile b/usr/src/boot/sys/boot/i386/libi386/Makefile index fdb83a1bc95b..797e3257d0d5 100644 --- a/usr/src/boot/sys/boot/i386/libi386/Makefile +++ b/usr/src/boot/sys/boot/i386/libi386/Makefile @@ -16,8 +16,11 @@ include $(SRC)/Makefile.master -CFLAGS= -Os -I../../../../include -I../../.. -CPPFLAGS= -D_STANDALONE -DLOADER_ZFS_SUPPORT +CFLAGS= -Os +CPPFLAGS= -nostdinc -I../../../../include -I../../.. +CPPFLAGS += -I../../../../lib/libz +CPPFLAGS += -I../../zfs +CPPFLAGS += -D_STANDALONE all install: libi386.a diff --git a/usr/src/boot/sys/boot/i386/libi386/devicename.c b/usr/src/boot/sys/boot/i386/libi386/devicename.c index 8a6daf6ad764..e6809109dbb0 100644 --- a/usr/src/boot/sys/boot/i386/libi386/devicename.c +++ b/usr/src/boot/sys/boot/i386/libi386/devicename.c @@ -32,7 +32,7 @@ #include "bootstrap.h" #include "disk.h" #include "libi386.h" -#include "../zfs/libzfs.h" +#include "libzfs.h" static int i386_parsedev(struct i386_devdesc **, const char *, const char **); diff --git a/usr/src/boot/sys/boot/i386/libi386/multiboot.c b/usr/src/boot/sys/boot/i386/libi386/multiboot.c index d44fa0a3985a..6ee6efc430a3 100644 --- a/usr/src/boot/sys/boot/i386/libi386/multiboot.c +++ b/usr/src/boot/sys/boot/i386/libi386/multiboot.c @@ -1,4 +1,4 @@ -/*- +/* * Copyright (c) 2014 Roger Pau Monné * All rights reserved. * @@ -50,9 +50,9 @@ #include "bootstrap.h" #include -#include "../zfs/libzfs.h" -#include "../i386/libi386/libi386.h" -#include "../i386/btx/lib/btxv86.h" +#include "libzfs.h" +#include "libi386.h" +#include "../btx/lib/btxv86.h" #define SUPPORT_DHCP #include diff --git a/usr/src/boot/sys/boot/i386/loader/Makefile b/usr/src/boot/sys/boot/i386/loader/Makefile index 25da185d4f6e..a6ef3302895a 100644 --- a/usr/src/boot/sys/boot/i386/loader/Makefile +++ b/usr/src/boot/sys/boot/i386/loader/Makefile @@ -25,7 +25,7 @@ LOADER= loader NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 # Set by loader Makefile -CPPFLAGS += -DLOADER_ZFS_SUPPORT -I../../zfs +CPPFLAGS += -I../../zfs CPPFLAGS += -I../libi386 LIBZFSBOOT= ../../zfs/$(MACH)/libzfsboot.a LIBI386= ../libi386/libi386.a diff --git a/usr/src/boot/sys/boot/i386/loader/conf.c b/usr/src/boot/sys/boot/i386/loader/conf.c index d99c3a4b49a6..2d5ff8e8b12b 100644 --- a/usr/src/boot/sys/boot/i386/loader/conf.c +++ b/usr/src/boot/sys/boot/i386/loader/conf.c @@ -1,4 +1,4 @@ -/*- +/* * Copyright (c) 1998 Michael Smith * All rights reserved. * @@ -25,14 +25,11 @@ */ #include -__FBSDID("$FreeBSD$"); #include #include -#include "libi386/libi386.h" -#if defined(LOADER_ZFS_SUPPORT) -#include "../zfs/libzfs.h" -#endif +#include "libi386.h" +#include "libzfs.h" /* * We could use linker sets for some or all of these, but @@ -57,9 +54,7 @@ struct devsw *devsw[] = { #if defined(LOADER_FIREWIRE_SUPPORT) &fwohci, #endif -#if defined(LOADER_ZFS_SUPPORT) &zfs_dev, -#endif NULL }; @@ -67,9 +62,7 @@ struct fs_ops *file_system[] = { #ifdef LOADER_GZIP_SUPPORT &gzipfs_fsops, #endif -#if defined(LOADER_ZFS_SUPPORT) &zfs_fsops, -#endif &ufs_fsops, &dosfs_fsops, #if 0 @@ -91,7 +84,7 @@ struct fs_ops *file_system[] = { }; /* Exported for i386 only */ -/* +/* * Sort formats so that those that can detect based on arguments * rather than reading the file go first. */ @@ -118,8 +111,8 @@ struct file_format *file_formats[] = { NULL }; -/* - * Consoles +/* + * Consoles * * We don't prototype these in libi386.h because they require * data structures from bootstrap.h as well. diff --git a/usr/src/boot/sys/boot/i386/loader/main.c b/usr/src/boot/sys/boot/i386/loader/main.c index 98b48582e854..abf2fc883276 100644 --- a/usr/src/boot/sys/boot/i386/loader/main.c +++ b/usr/src/boot/sys/boot/i386/loader/main.c @@ -1,4 +1,4 @@ -/*- +/* * Copyright (c) 1998 Michael Smith * All rights reserved. * @@ -46,10 +46,7 @@ #include "libi386/libi386.h" #include "libi386/smbios.h" #include "btxv86.h" - -#ifdef LOADER_ZFS_SUPPORT -#include "../zfs/libzfs.h" -#endif +#include "libzfs.h" CTASSERT(sizeof(struct bootargs) == BOOTARGS_SIZE); CTASSERT(offsetof(struct bootargs, bootinfo) == BA_BOOTINFO); @@ -69,9 +66,7 @@ static void extract_currdev(void); static int isa_inb(int port); static void isa_outb(int port, int value); void exit(int code); -#ifdef LOADER_ZFS_SUPPORT static void i386_zfs_probe(void); -#endif /* XXX debugging */ extern char end[]; @@ -99,16 +94,12 @@ main(void) */ bios_getmem(); -#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || \ - defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT) if (high_heap_size > 0) { heap_top = PTOV(high_heap_base + high_heap_size); heap_bottom = PTOV(high_heap_base); if (high_heap_base < memtop_copyin) memtop_copyin = high_heap_base; - } else -#endif - { + } else { heap_top = (void *)PTOV(bios_basemem); heap_bottom = (void *)end; } @@ -161,9 +152,7 @@ main(void) archsw.arch_isainb = isa_inb; archsw.arch_isaoutb = isa_outb; archsw.arch_loadaddr = i386_loadaddr; -#ifdef LOADER_ZFS_SUPPORT archsw.arch_zfs_probe = i386_zfs_probe; -#endif /* * March through the device switch probing for things. @@ -211,9 +200,7 @@ static void extract_currdev(void) { struct i386_devdesc new_currdev; -#ifdef LOADER_ZFS_SUPPORT struct zfs_boot_args *zargs; -#endif int biosdev = -1; /* Assume we are booting from a BIOS disk by default */ @@ -235,7 +222,6 @@ extract_currdev(void) new_currdev.d_kind.biosdisk.partition = 0; biosdev = -1; } -#ifdef LOADER_ZFS_SUPPORT } else if ((kargs->bootflags & KARGS_FLAGS_ZFS) != 0) { zargs = NULL; /* check for new style extended argument */ @@ -253,7 +239,6 @@ extract_currdev(void) new_currdev.d_kind.zfs.root_guid = 0; } new_currdev.dd.d_dev = &zfs_dev; -#endif } else if ((initial_bootdev & B_MAGICMASK) != B_DEVMAGIC) { /* The passed-in boot device is bad */ new_currdev.d_kind.biosdisk.slice = -1; diff --git a/usr/src/boot/sys/boot/ofw/libofw/devicename.c b/usr/src/boot/sys/boot/ofw/libofw/devicename.c index af06dafd9db9..94d0d0bbeb72 100644 --- a/usr/src/boot/sys/boot/ofw/libofw/devicename.c +++ b/usr/src/boot/sys/boot/ofw/libofw/devicename.c @@ -30,7 +30,7 @@ #include "bootstrap.h" #include "libofw.h" -#include "../zfs/libzfs.h" +#include "libzfs.h" static int ofw_parsedev(struct ofw_devdesc **, const char *, const char **); diff --git a/usr/src/boot/sys/boot/sparc64/loader/Makefile b/usr/src/boot/sys/boot/sparc64/loader/Makefile index 484067b9c0d7..b3988284ea04 100644 --- a/usr/src/boot/sys/boot/sparc64/loader/Makefile +++ b/usr/src/boot/sys/boot/sparc64/loader/Makefile @@ -14,7 +14,6 @@ SRCS= locore.S main.c metadata.c vers.c LOADER_DISK_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes -LOADER_ZFS_SUPPORT?= no LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes @@ -34,12 +33,9 @@ CFLAGS+= -DLOADER_UFS_SUPPORT .if ${LOADER_CD9660_SUPPORT} == "yes" CFLAGS+= -DLOADER_CD9660_SUPPORT .endif -.if ${LOADER_ZFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_ZFS_SUPPORT CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a -.endif .if ${LOADER_GZIP_SUPPORT} == "yes" CFLAGS+= -DLOADER_GZIP_SUPPORT .endif diff --git a/usr/src/boot/sys/boot/sparc64/loader/main.c b/usr/src/boot/sys/boot/sparc64/loader/main.c index bd3c032e564b..e81976c61cb3 100644 --- a/usr/src/boot/sys/boot/sparc64/loader/main.c +++ b/usr/src/boot/sys/boot/sparc64/loader/main.c @@ -50,10 +50,8 @@ #include #include #include -#ifdef LOADER_ZFS_SUPPORT #include -#include "../zfs/libzfs.h" -#endif +#include "libzfs.h" #include #include @@ -139,9 +137,7 @@ static vm_offset_t heapva; static char bootpath[64]; static phandle_t root; -#ifdef LOADER_ZFS_SUPPORT static struct zfs_devdesc zfs_currdev; -#endif /* * Machine dependent structures that the machine independent @@ -154,9 +150,7 @@ struct devsw *devsw[] = { #ifdef LOADER_NET_SUPPORT &netdev, #endif -#ifdef LOADER_ZFS_SUPPORT &zfs_dev, -#endif NULL }; @@ -173,9 +167,7 @@ struct file_format *file_formats[] = { }; struct fs_ops *file_system[] = { -#ifdef LOADER_ZFS_SUPPORT &zfs_fsops, -#endif #ifdef LOADER_UFS_SUPPORT &ufs_fsops, #endif @@ -731,7 +723,6 @@ tlb_init_sun4u(void) panic("%s: can't allocate TLB store", __func__); } -#ifdef LOADER_ZFS_SUPPORT static void sparc64_zfs_probe(void) { @@ -809,7 +800,6 @@ sparc64_zfs_probe(void) zfs_currdev.dd.d_dev = &zfs_dev; } } -#endif /* LOADER_ZFS_SUPPORT */ int main(int (*openfirm)(void *)) @@ -827,9 +817,7 @@ main(int (*openfirm)(void *)) archsw.arch_copyout = ofw_copyout; archsw.arch_readin = sparc64_readin; archsw.arch_autoload = sparc64_autoload; -#ifdef LOADER_ZFS_SUPPORT archsw.arch_zfs_probe = sparc64_zfs_probe; -#endif if (init_heap() == (vm_offset_t)-1) OF_exit(); @@ -859,13 +847,11 @@ main(int (*openfirm)(void *)) if ((*dp)->dv_init != 0) (*dp)->dv_init(); -#ifdef LOADER_ZFS_SUPPORT if (zfs_currdev.pool_guid != 0) { (void)strncpy(bootpath, zfs_fmtdev(&zfs_currdev), sizeof(bootpath) - 1); bootpath[sizeof(bootpath) - 1] = '\0'; } else -#endif /* * Sun compatible bootable CD-ROMs have a disk label placed before diff --git a/usr/src/boot/sys/boot/userboot/userboot/Makefile b/usr/src/boot/sys/boot/userboot/userboot/Makefile index 5623e72c2eda..41fb8e863670 100644 --- a/usr/src/boot/sys/boot/userboot/userboot/Makefile +++ b/usr/src/boot/sys/boot/userboot/userboot/Makefile @@ -52,16 +52,15 @@ LIBSTAND= ${.OBJDIR}/../libstand/libstand.a .endif .if ${MK_ZFS} != "no" -CFLAGS+= -DUSERBOOT_ZFS_SUPPORT LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a .endif -# Always add MI sources +# Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} +DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} .include diff --git a/usr/src/boot/sys/boot/userboot/userboot/conf.c b/usr/src/boot/sys/boot/userboot/userboot/conf.c index b8daa7396ca3..5ccde455d768 100644 --- a/usr/src/boot/sys/boot/userboot/userboot/conf.c +++ b/usr/src/boot/sys/boot/userboot/userboot/conf.c @@ -1,4 +1,4 @@ -/*- +/* * Copyright (c) 1997 * Matthias Drochner. All rights reserved. * @@ -28,19 +28,15 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $NetBSD: conf.c,v 1.2 1997/03/22 09:03:29 thorpej Exp $ + * $NetBSD: conf.c,v 1.2 1997/03/22 09:03:29 thorpej Exp $ */ #include -__FBSDID("$FreeBSD$"); #include #include "libuserboot.h" - -#if defined(USERBOOT_ZFS_SUPPORT) -#include "../zfs/libzfs.h" -#endif +#include "libzfs.h" /* * We could use linker sets for some or all of these, but @@ -55,9 +51,7 @@ __FBSDID("$FreeBSD$"); struct devsw *devsw[] = { &host_dev, &userboot_disk, -#if defined(USERBOOT_ZFS_SUPPORT) &zfs_dev, -#endif NULL }; @@ -65,16 +59,14 @@ struct fs_ops *file_system[] = { &host_fsops, &ufs_fsops, &cd9660_fsops, -#if defined(USERBOOT_ZFS_SUPPORT) &zfs_fsops, -#endif &gzipfs_fsops, &bzipfs_fsops, NULL }; /* Exported for i386 only */ -/* +/* * Sort formats so that those that can detect based on arguments * rather than reading the file go first. */ @@ -91,8 +83,8 @@ struct file_format *file_formats[] = { NULL }; -/* - * Consoles +/* + * Consoles * * We don't prototype these in libuserboot.h because they require * data structures from bootstrap.h as well. diff --git a/usr/src/boot/sys/boot/userboot/userboot/devicename.c b/usr/src/boot/sys/boot/userboot/userboot/devicename.c index 79aeff4bb9db..0d0e7ced5f7a 100644 --- a/usr/src/boot/sys/boot/userboot/userboot/devicename.c +++ b/usr/src/boot/sys/boot/userboot/userboot/devicename.c @@ -32,10 +32,7 @@ #include "bootstrap.h" #include "disk.h" #include "libuserboot.h" - -#if defined(USERBOOT_ZFS_SUPPORT) -#include "../zfs/libzfs.h" -#endif +#include "libzfs.h" static int userboot_parsedev(struct disk_devdesc **dev, const char *devspec, const char **path); @@ -144,14 +141,10 @@ userboot_parsedev(struct disk_devdesc **dev, const char *devspec, const char **p break; case DEVT_ZFS: -#if defined(USERBOOT_ZFS_SUPPORT) err = zfs_parsedev((struct zfs_devdesc *)idev, np, path); if (err != 0) goto fail; break; -#else - /* FALLTHROUGH */ -#endif default: err = EINVAL; @@ -194,12 +187,7 @@ userboot_fmtdev(void *vdev) break; case DEVT_ZFS: -#if defined(USERBOOT_ZFS_SUPPORT) return (zfs_fmtdev(vdev)); -#else - sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); -#endif - break; } return(buf); } diff --git a/usr/src/boot/sys/boot/userboot/userboot/main.c b/usr/src/boot/sys/boot/userboot/userboot/main.c index 8e553527c699..3a53ae2b9442 100644 --- a/usr/src/boot/sys/boot/userboot/userboot/main.c +++ b/usr/src/boot/sys/boot/userboot/userboot/main.c @@ -34,13 +34,10 @@ #include "bootstrap.h" #include "disk.h" #include "libuserboot.h" - -#if defined(USERBOOT_ZFS_SUPPORT) -#include "../zfs/libzfs.h" +#include "libzfs.h" static void userboot_zfs_probe(void); static int userboot_zfs_found; -#endif /* Minimum version required */ #define USERBOOT_VERSION USERBOOT_VERSION_3 @@ -119,9 +116,7 @@ loader_main(struct loader_callbacks *cb, void *arg, int version, int ndisks) archsw.arch_copyin = userboot_copyin; archsw.arch_copyout = userboot_copyout; archsw.arch_readin = userboot_readin; -#if defined(USERBOOT_ZFS_SUPPORT) archsw.arch_zfs_probe = userboot_zfs_probe; -#endif /* * March through the device switch probing for things. @@ -151,7 +146,6 @@ extract_currdev(void) //bzero(&dev, sizeof(dev)); -#if defined(USERBOOT_ZFS_SUPPORT) if (userboot_zfs_found) { struct zfs_devdesc zdev; @@ -162,10 +156,7 @@ extract_currdev(void) dev = *(struct disk_devdesc *)&zdev; init_zfs_bootenv(zfs_fmtdev(&dev)); - } else -#endif - - if (userboot_disk_maxunit > 0) { + } else if (userboot_disk_maxunit > 0) { dev.dd.d_dev = &userboot_disk; dev.dd.d_unit = 0; dev.d_slice = 0; @@ -189,7 +180,6 @@ extract_currdev(void) env_noset, env_nounset); } -#if defined(USERBOOT_ZFS_SUPPORT) static void userboot_zfs_probe(void) {