svn commit: r200221 - in stable/7/sys/boot: . i386 i386/loader i386/zfsboot i386/zfsloader

Robert Noland rnoland at
Mon Dec 7 17:15:37 UTC 2009

Author: rnoland
Date: Mon Dec  7 17:15:36 2009
New Revision: 200221

  MFC 199714
  Create a seperate ZFS enabled loader.
  This adds zfsloader which will be called by zfsboot/gptzfsboot code rather
  than the tradional loader.  This eliminates the need to set the
  LOADER_ZFS_SUPPORT variable in order to get a ZFS enabled loader.
  Note however, that you must reinstall your bootcode (zfsboot/gptzfsboot)
  in order for the boot process to use the new loader.
  New installations will no longer be required to build a ZFS enabled
  loader for a working ZFS boot system.  Installing zfsboot/gptzfsboot is
  sufficient for acknowledging the use of CDDL code and therefore the ZFS
  enabled loader.

     - copied from r199714, head/sys/boot/i386/zfsloader/
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/boot/Makefile
--- stable/7/sys/boot/Makefile	Mon Dec  7 16:37:02 2009	(r200220)
+++ stable/7/sys/boot/Makefile	Mon Dec  7 17:15:36 2009	(r200221)
@@ -17,7 +17,7 @@ SUBDIR+=		efi
 SUBDIR+=		ofw
-.if ${MK_ZFS} != "no"
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386"
 SUBDIR+=		zfs

Modified: stable/7/sys/boot/i386/Makefile
--- stable/7/sys/boot/i386/Makefile	Mon Dec  7 16:37:02 2009	(r200220)
+++ stable/7/sys/boot/i386/Makefile	Mon Dec  7 17:15:36 2009	(r200221)
@@ -1,8 +1,8 @@
 # $FreeBSD$
 .include <>
-SUBDIR=		mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \
-		zfsboot gptzfsboot kgzldr libi386 libfirewire loader
+SUBDIR=		mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot zfsboot \
+		gptzfsboot kgzldr libi386 libfirewire loader zfsloader
 # special boot programs, 'self-extracting boot2+loader'
 SUBDIR+=	pxeldr

Modified: stable/7/sys/boot/i386/loader/Makefile
--- stable/7/sys/boot/i386/loader/Makefile	Mon Dec  7 16:37:02 2009	(r200220)
+++ stable/7/sys/boot/i386/loader/Makefile	Mon Dec  7 17:15:36 2009	(r200221)
@@ -2,9 +2,10 @@
 .include <>
-PROG=		loader.sym
+LOADER?=	loader
+PROG=		${LOADER}.sym
-NEWVERSWHAT=	"bootstrap loader" i386
+NEWVERSWHAT?=	"bootstrap loader" i386
 # architecture-specific loader code
 SRCS=		main.c conf.c vers.c
 LIBFIREWIRE=	${.OBJDIR}/../libfirewire/libfirewire.a
-# Put LOADER_ZFS_SUPPORT=yes in /etc/make.conf for ZFS support
+# Set by zfsloader Makefile
 #.if ${MK_ZFS} != "no"
 #LIBZFS=		${.OBJDIR}/../../zfs/libzfsboot.a
@@ -60,7 +61,7 @@ CFLAGS+=	-DLOADER_GPT_SUPPORT
 CFLAGS+=	-I${.CURDIR}/../../common
-CLEANFILES=	vers.c loader loader.bin
 CFLAGS+=	-Wall
 LDFLAGS=	-static -Ttext 0x0
@@ -79,30 +80,35 @@ CFLAGS+=	-I${.CURDIR}/../btx/lib
 # Pick up ../ early.
 .include <>
-vers.c:	${.CURDIR}/../../common/ ${.CURDIR}/version
-	sh ${.CURDIR}/../../common/ ${.CURDIR}/version ${NEWVERSWHAT}
+vers.c:	${.CURDIR}/../../common/ ${.CURDIR}/../loader/version
+	sh ${.CURDIR}/../../common/ ${.CURDIR}/../loader/version \
-loader: loader.bin ${BTXLDR} ${BTXKERN}
 	btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
-		-b ${BTXKERN} loader.bin
+		-b ${BTXKERN} ${LOADER}.bin
-loader.bin: loader.sym
+${LOADER}.bin: ${LOADER}.sym
 	cp ${.ALLSRC} ${.TARGET}
 	strip -R .comment -R .note ${.TARGET} help.common help.i386
 	cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
+# XXX INSTALLFLAGS_loader= -b
+.if !defined(LOADER_ONLY)
 .PATH: ${.CURDIR}/../../forth 
-FILES=	loader loader.4th support.4th loader.conf
+FILES+= loader.4th support.4th loader.conf
 FILES+= screen.4th frames.4th beastie.4th
-# XXX INSTALLFLAGS_loader= -b
-FILESMODE_loader= ${BINMODE} -b
 FILESDIR_loader.conf=	/boot/defaults
 .if !exists(${DESTDIR}/boot/loader.rc)
 FILES+=	loader.rc
 # XXX crt0.o needs to be first for pxeboot(8) to work

Modified: stable/7/sys/boot/i386/zfsboot/zfsboot.c
--- stable/7/sys/boot/i386/zfsboot/zfsboot.c	Mon Dec  7 16:37:02 2009	(r200220)
+++ stable/7/sys/boot/i386/zfsboot/zfsboot.c	Mon Dec  7 17:15:36 2009	(r200221)
@@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$");
 #define	KARGS_FLAGS_ZFS		0x4
 #define PATH_CONFIG	"/boot.config"
-#define PATH_BOOT3	"/boot/loader"
+#define PATH_BOOT3	"/boot/zfsloader"
 #define PATH_KERNEL	"/boot/kernel/kernel"
 #define ARGS		0x900

More information about the svn-src-stable-7 mailing list