From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 16:00:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E9CC1065672; Mon, 23 Nov 2009 16:00:17 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CD488FC1D; Mon, 23 Nov 2009 16:00:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nANG0HVH061647; Mon, 23 Nov 2009 16:00:17 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nANG0GkS061641; Mon, 23 Nov 2009 16:00:16 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200911231600.nANG0GkS061641@svn.freebsd.org> From: Robert Noland Date: Mon, 23 Nov 2009 16:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199714 - in head/sys/boot: . i386 i386/loader i386/zfsboot i386/zfsloader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 16:00:17 -0000 Author: rnoland Date: Mon Nov 23 16:00:16 2009 New Revision: 199714 URL: http://svn.freebsd.org/changeset/base/199714 Log: 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. Based on a previous patch from jhb@ Reviewed by: jhb@ MFC after: 2 weeks Added: head/sys/boot/i386/zfsloader/ head/sys/boot/i386/zfsloader/Makefile (contents, props changed) Modified: head/sys/boot/Makefile head/sys/boot/i386/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/i386/zfsboot/zfsboot.c Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Mon Nov 23 15:26:16 2009 (r199713) +++ head/sys/boot/Makefile Mon Nov 23 16:00:16 2009 (r199714) @@ -22,7 +22,7 @@ SUBDIR+= ofw SUBDIR+= uboot .endif -.if defined(LOADER_ZFS_SUPPORT) +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" SUBDIR+= zfs .endif Modified: head/sys/boot/i386/Makefile ============================================================================== --- head/sys/boot/i386/Makefile Mon Nov 23 15:26:16 2009 (r199713) +++ head/sys/boot/i386/Makefile Mon Nov 23 16:00:16 2009 (r199714) @@ -1,7 +1,7 @@ # $FreeBSD$ SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot zfsboot \ - gptzfsboot kgzldr libi386 libfirewire loader + gptzfsboot kgzldr libi386 libfirewire loader zfsloader # special boot programs, 'self-extracting boot2+loader' SUBDIR+= pxeldr Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Nov 23 15:26:16 2009 (r199713) +++ head/sys/boot/i386/loader/Makefile Mon Nov 23 16:00:16 2009 (r199714) @@ -3,9 +3,10 @@ .include MK_SSP= no -PROG= loader.sym +LOADER?= loader +PROG= ${LOADER}.sym INTERNALPROG= -NEWVERSWHAT= "bootstrap loader" i386 +NEWVERSWHAT?= "bootstrap loader" i386 # architecture-specific loader code SRCS= main.c conf.c vers.c @@ -16,7 +17,7 @@ CFLAGS+= -DLOADER_FIREWIRE_SUPPORT LIBFIREWIRE= ${.OBJDIR}/../libfirewire/libfirewire.a .endif -# Put LOADER_ZFS_SUPPORT=yes in /etc/make.conf for ZFS support +# Set by zfsloader Makefile .if defined(LOADER_ZFS_SUPPORT) CFLAGS+= -DLOADER_ZFS_SUPPORT LIBZFS= ${.OBJDIR}/../../zfs/libzfsboot.a @@ -61,7 +62,7 @@ CFLAGS+= -DLOADER_GPT_SUPPORT CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -CLEANFILES= vers.c loader loader.bin loader.help +CLEANFILES= vers.c ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall LDFLAGS= -static -Ttext 0x0 @@ -80,30 +81,35 @@ CFLAGS+= -I${.CURDIR}/../btx/lib # Pick up ../Makefile.inc early. .include -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} +vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version + sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ + ${NEWVERSWHAT} -loader: loader.bin ${BTXLDR} ${BTXKERN} +${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} loader.help: help.common help.i386 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} +FILES= ${LOADER} +# XXX INSTALLFLAGS_loader= -b +FILESMODE_${LOADER}= ${BINMODE} -b + +.if !defined(LOADER_ONLY) .PATH: ${.CURDIR}/../../forth -FILES= loader loader.help loader.4th support.4th loader.conf +FILES+= loader.help 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 .endif +.endif # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Mon Nov 23 15:26:16 2009 (r199713) +++ head/sys/boot/i386/zfsboot/zfsboot.c Mon Nov 23 16:00:16 2009 (r199714) @@ -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 Added: head/sys/boot/i386/zfsloader/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/i386/zfsloader/Makefile Mon Nov 23 16:00:16 2009 (r199714) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../loader + +LOADER= zfsloader +NEWVERSWHAT= "ZFS enabled bootstrap loader" i386 +LOADER_ZFS_SUPPORT=yes +LOADER_ONLY= yes +NO_MAN= yes + +.include "${.CURDIR}/../loader/Makefile" +