Author: imp Date: Fri Jul 20 05:17:37 2018 New Revision: 336532 URL: https://svnweb.freebsd.org/changeset/base/336532
Log: Collapse zfsloader functionality back down into loader. We no longer really need a separate zfsloader. It was useful when we were first supporting ZFS and had limited ability to properly boot off of ZFS without the special boot loader. Now that the boot loader has matured, go the way loader.efi pioneered and just build one binary. Change the name of the loader to load in the secondary boot blocks to be just /boot/loader. Provide a symbolic link from zfsloader to loader so people who have not upgraded their boot blocks are not affected. This has the happy benefit of making coexistence easier as well (fewer binaries in the matrix). Discussed with: allanjude@, kevans@ RelNotes: Yes Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D16361 Deleted: head/stand/i386/zfsloader/Makefile head/stand/i386/zfsloader/Makefile.depend head/stand/sparc64/zfsloader/Makefile Modified: head/stand/common/paths.h head/stand/i386/Makefile head/stand/i386/loader/Makefile head/stand/i386/zfsboot/zfsboot.c head/stand/loader.mk head/stand/sparc64/Makefile head/stand/sparc64/loader/Makefile Modified: head/stand/common/paths.h ============================================================================== --- head/stand/common/paths.h Fri Jul 20 02:25:39 2018 (r336531) +++ head/stand/common/paths.h Fri Jul 20 05:17:37 2018 (r336532) @@ -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_ */ Modified: head/stand/i386/Makefile ============================================================================== --- head/stand/i386/Makefile Fri Jul 20 02:25:39 2018 (r336531) +++ head/stand/i386/Makefile Fri Jul 20 05:17:37 2018 (r336532) @@ -18,6 +18,6 @@ SUBDIR.yes+= pxeldr SUBDIR.yes+= kgzldr .endif -SUBDIR.${MK_ZFS}+= zfsboot gptzfsboot zfsloader +SUBDIR.${MK_ZFS}+= zfsboot gptzfsboot .include <bsd.subdir.mk> Modified: head/stand/i386/loader/Makefile ============================================================================== --- head/stand/i386/loader/Makefile Fri Jul 20 02:25:39 2018 (r336531) +++ head/stand/i386/loader/Makefile Fri Jul 20 05:17:37 2018 (r336532) @@ -1,5 +1,7 @@ # $FreeBSD$ +HAVE_ZFS= ${MK_ZFS} + LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes @@ -62,6 +64,9 @@ ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC} +.if ${MK_ZFS} == "yes" +SYMLINKS= ${BINDIR}/${LOADER} ${BINDIR}/zfs${LOADER} +.endif FILES+= ${LOADER} # XXX INSTALLFLAGS_loader= -b FILESMODE_${LOADER}= ${BINMODE} -b Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Fri Jul 20 02:25:39 2018 (r336531) +++ head/stand/i386/zfsboot/zfsboot.c Fri Jul 20 05:17:37 2018 (r336532) @@ -848,7 +848,7 @@ main(void) */ 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)); Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Fri Jul 20 02:25:39 2018 (r336531) +++ head/stand/loader.mk Fri Jul 20 05:17:37 2018 (r336532) @@ -124,7 +124,7 @@ CFLAGS+= -DLOADER_GPT_SUPPORT CFLAGS+= -DLOADER_MBR_SUPPORT .endif -.if defined(HAVE_ZFS) +.if ${HAVE_ZFS:Uno} == "yes" CFLAGS+= -DLOADER_ZFS_SUPPORT CFLAGS+= -I${ZFSSRC} CFLAGS+= -I${SYSDIR}/cddl/boot/zfs Modified: head/stand/sparc64/Makefile ============================================================================== --- head/stand/sparc64/Makefile Fri Jul 20 02:25:39 2018 (r336531) +++ head/stand/sparc64/Makefile Fri Jul 20 05:17:37 2018 (r336532) @@ -5,6 +5,6 @@ NO_OBJ=t .include <bsd.init.mk> SUBDIR.yes= boot1 loader -SUBDIR.${MK_ZFS}+=zfsboot zfsloader +SUBDIR.${MK_ZFS}+=zfsboot .include <bsd.subdir.mk> Modified: head/stand/sparc64/loader/Makefile ============================================================================== --- head/stand/sparc64/loader/Makefile Fri Jul 20 02:25:39 2018 (r336531) +++ head/stand/sparc64/loader/Makefile Fri Jul 20 05:17:37 2018 (r336532) @@ -1,5 +1,7 @@ # $FreeBSD$ +HAVE_ZFS= ${MK_ZFS} + LOADER_DISK_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes @@ -39,6 +41,10 @@ HELP_FILES= ${.CURDIR}/help.sparc64 .include "${BOOTSRC}/loader.mk" LDFLAGS+= -static + +.if ${MK_ZFS} == "yes" +SYMLINKS= ${BINDIR}/loader ${BINDIR}/zfsloader +.endif # Open Firmware standalone support library LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"