Index: head/sys/boot/Makefile.amd64 =================================================================== --- head/sys/boot/Makefile.amd64 (revision 325689) +++ head/sys/boot/Makefile.amd64 (revision 325690) @@ -1,16 +1,18 @@ # $FreeBSD$ SUBDIR+= libsa32 +.if ${MK_ZFS} != "no" SUBDIR+= zfs zfs32 +.endif .if ${MK_FORTH} != "no" SUBDIR+= ficl32 .endif SUBDIR+= efi SUBDIR+= userboot .if ${LOADER_GELI_SUPPORT:Uyes} == "yes" SUBDIR+= geli .endif SUBDIR+= i386 Index: head/sys/boot/Makefile.i386 =================================================================== --- head/sys/boot/Makefile.i386 (revision 325689) +++ head/sys/boot/Makefile.i386 (revision 325690) @@ -1,8 +1,10 @@ # $FreeBSD$ .if ${LOADER_GELI_SUPPORT:Uyes} == "yes" SUBDIR+= geli .endif +.if ${MK_ZFS} != "no" SUBDIR+= zfs +.endif SUBDIR+= efi Index: head/sys/boot/Makefile.sparc64 =================================================================== --- head/sys/boot/Makefile.sparc64 (revision 325689) +++ head/sys/boot/Makefile.sparc64 (revision 325690) @@ -1,4 +1,6 @@ # $FreeBSD$ SUBDIR+= ofw +.if ${MK_ZFS} != "no" SUBDIR+= zfs +.endif Index: head/sys/boot/i386/loader/Makefile =================================================================== --- head/sys/boot/i386/loader/Makefile (revision 325689) +++ head/sys/boot/i386/loader/Makefile (revision 325690) @@ -1,111 +1,103 @@ # $FreeBSD$ LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no LOADER_MSDOS_SUPPORT?= no LOADER_UFS_SUPPORT?= yes LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= yes .include MK_SSP= no LOADER?= loader PROG= ${LOADER}.sym MAN= INTERNALPROG= NEWVERSWHAT?= "bootstrap loader" x86 VERSION_FILE= ${.CURDIR}/../loader/version +.PATH: ${BOOTSRC}/i386/loader + # architecture-specific loader code SRCS= main.c conf.c vers.c chain.c # Put LOADER_FIREWIRE_SUPPORT=yes in /etc/make.conf for FireWire/dcons support .if defined(LOADER_FIREWIRE_SUPPORT) CFLAGS+= -DLOADER_FIREWIRE_SUPPORT LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a -.endif - -# Set by zfsloader Makefile -.if defined(LOADER_ZFS_SUPPORT) -CFLAGS+= -DLOADER_ZFS_SUPPORT -.if ${MACHINE} == "amd64" -LIBZFSBOOT= ${BOOTOBJ}/zfs32/libzfsboot.a -.else -LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a -.endif .endif # Include bcache code. HAVE_BCACHE= yes # Enable PnP and ISA-PnP code. HAVE_PNP= yes HAVE_ISABUS= yes .if ${LOADER_GELI_SUPPORT:Uyes} == "yes" CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -I${BOOTSRC}/geli LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a .PATH: ${SYSDIR}/opencrypto SRCS+= xform_aes_xts.c CFLAGS+= -I${SYSDIR} -D_STAND .endif # Always add MI sources .include "${BOOTSRC}/loader.mk" CFLAGS+= -I. CLEANFILES= ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall LDFLAGS+= -static -Ttext 0x0 # i386 standalone support library LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a CFLAGS+= -I${BOOTSRC}/i386 # BTX components CFLAGS+= -I${BTXLIB} # Debug me! #CFLAGS+= -g #LDFLAGS+= -g ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ -b ${BTXKERN} ${LOADER}.bin ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC} loader.help: help.common help.i386 cat ${.ALLSRC} | awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} FILES= ${LOADER} # XXX INSTALLFLAGS_loader= -b FILESMODE_${LOADER}= ${BINMODE} -b .if !defined(LOADER_ONLY) .PATH: ${BOOTSRC}/forth .include "${BOOTSRC}/forth/Makefile.inc" FILES+= pcibios.4th FILES+= loader.rc menu.rc .endif # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} DPADD= ${LIBFICL32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} LDADD= ${LIBFICL32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -DLOADER_PREFER_AMD64 .endif .include Index: head/sys/boot/i386/zfsloader/Makefile =================================================================== --- head/sys/boot/i386/zfsloader/Makefile (revision 325689) +++ head/sys/boot/i386/zfsloader/Makefile (revision 325690) @@ -1,15 +1,10 @@ # $FreeBSD$ -LOADER_ZFS_SUPPORT=yes - -.include - -.PATH: ${BOOTSRC}/i386/loader - LOADER= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 LOADER_ONLY= yes -MAN= +HAVE_ZFS= yes +.include .include "${BOOTSRC}/i386/loader/Makefile" Index: head/sys/boot/loader.mk =================================================================== --- head/sys/boot/loader.mk (revision 325689) +++ head/sys/boot/loader.mk (revision 325690) @@ -1,79 +1,92 @@ # $FreeBSD$ .include "defs.mk" .PATH: ${LDRSRC} ${BOOTSRC}/libsa CFLAGS+=-I${LDRSRC} SRCS+= boot.c commands.c console.c devopen.c interp.c SRCS+= interp_backslash.c interp_parse.c ls.c misc.c SRCS+= module.c .if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c .elif ${MACHINE_CPUARCH} == "aarch64" SRCS+= load_elf64.c reloc_elf64.c .elif ${MACHINE_CPUARCH} == "arm" SRCS+= load_elf32.c reloc_elf32.c .elif ${MACHINE_CPUARCH} == "powerpc" SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c .elif ${MACHINE_CPUARCH} == "sparc64" SRCS+= load_elf64.c reloc_elf64.c .elif ${MACHINE_ARCH:Mmips64*} != "" SRCS+= load_elf64.c reloc_elf64.c .elif ${MACHINE} == "mips" SRCS+= load_elf32.c reloc_elf32.c .endif .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" SRCS+= disk.c part.c .endif .if ${LOADER_NET_SUPPORT:Uno} == "yes" SRCS+= dev_net.c .endif .if defined(HAVE_BCACHE) SRCS+= bcache.c .endif .if defined(MD_IMAGE_SIZE) CFLAGS+= -DMD_IMAGE_SIZE=${MD_IMAGE_SIZE} SRCS+= md.c .else CLEANFILES+= md.o .endif # Machine-independant ISA PnP .if defined(HAVE_ISABUS) SRCS+= isapnp.c .endif .if defined(HAVE_PNP) SRCS+= pnp.c .endif # Forth interpreter .if ${MK_FORTH} != "no" SRCS+= interp_forth.c .include "${BOOTSRC}/ficl.mk" .endif .if defined(BOOT_PROMPT_123) CFLAGS+= -DBOOT_PROMPT_123 .endif .if defined(LOADER_INSTALL_SUPPORT) SRCS+= install.c .endif +.if defined(HAVE_ZFS) +CFLAGS+= -DLOADER_ZFS_SUPPORT +CFLAGS+= -I${ZFSSRC} +CFLAGS+= -I${SYSDIR}/cddl/boot/zfs +.if ${MACHINE} == "amd64" +# Have to override to use 32-bit version of zfs library... +# kinda lame to select that there XXX +LIBZFSBOOT= ${BOOTOBJ}/zfs32/libzfsboot.a +.else +LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a +.endif +.endif + CLEANFILES+= vers.c VERSION_FILE?= ${.CURDIR}/version .if ${MK_REPRODUCIBLE_BUILD} != no REPRO_FLAG= -r .endif vers.c: ${LDRSRC}/newvers.sh ${VERSION_FILE} sh ${LDRSRC}/newvers.sh ${REPRO_FLAG} ${VERSION_FILE} \ ${NEWVERSWHAT} Index: head/sys/boot/sparc64/Makefile =================================================================== --- head/sys/boot/sparc64/Makefile (revision 325689) +++ head/sys/boot/sparc64/Makefile (revision 325690) @@ -1,5 +1,10 @@ # $FreeBSD$ -SUBDIR= boot1 loader zfsboot zfsloader +.include + +SUBDIR= boot1 loader +.if ${MK_ZFS} != "no" +SUBDIR+=zfsboot zfsloader +.endif .include Index: head/sys/boot/sparc64/loader/Makefile =================================================================== --- head/sys/boot/sparc64/loader/Makefile (revision 325689) +++ head/sys/boot/sparc64/loader/Makefile (revision 325690) @@ -1,65 +1,58 @@ # $FreeBSD$ LOADER_DISK_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes LOADER_EXT2FS_SUPPORT?= no LOADER_MSDOS_SUPPORT?= no -LOADER_ZFS_SUPPORT?= no LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= no LOADER_DEBUG?= no .include MK_SSP= no MAN= PROG?= loader NEWVERSWHAT?= "bootstrap loader" sparc64 VERSION_FILE= ${.CURDIR}/../loader/version INSTALLFLAGS= -b # Architecture-specific loader code SRCS= locore.S main.c metadata.c vers.c .if ${LOADER_DEBUG} == "yes" CFLAGS+= -DLOADER_DEBUG -.endif -.if ${LOADER_ZFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_ZFS_SUPPORT -CFLAGS+= -I${ZFSSRC} -CFLAGS+= -I${SYSDIR}/cddl/boot/zfs -LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif # Always add MI sources .include "${BOOTSRC}/loader.mk" CFLAGS+= -I. CLEANFILES+= loader.help LDFLAGS+= -static # Open Firmware standalone support library LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a CFLAGS+= -I${BOOTSRC}/ofw/libofw/ # Need sys/ for crypto/intake.h CFLAGS+= -I${SRCTOP}/sys DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} loader.help: help.common help.sparc64 cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} .PATH: ${BOOTSRC}/forth .include "${BOOTSRC}/forth/Makefile.inc" FILES+= loader.rc menu.rc .include Index: head/sys/boot/sparc64/zfsloader/Makefile =================================================================== --- head/sys/boot/sparc64/zfsloader/Makefile (revision 325689) +++ head/sys/boot/sparc64/zfsloader/Makefile (revision 325690) @@ -1,9 +1,9 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../loader PROG= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" sparc64 -LOADER_ZFS_SUPPORT=yes +HAVE_ZFS= yes .include "${.CURDIR}/../loader/Makefile"