summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386/loader
diff options
context:
space:
mode:
authorrnoland <rnoland@FreeBSD.org>2009-11-23 16:00:16 +0000
committerrnoland <rnoland@FreeBSD.org>2009-11-23 16:00:16 +0000
commit396246bb32eb9a9a68bbe890fc9487b2da481295 (patch)
tree1b33b3845169c1e266700990c19faedb2cb8a328 /sys/boot/i386/loader
parent907e9240f27eb700a2ec22013031266eddcb0cd5 (diff)
downloadFreeBSD-src-396246bb32eb9a9a68bbe890fc9487b2da481295.zip
FreeBSD-src-396246bb32eb9a9a68bbe890fc9487b2da481295.tar.gz
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
Diffstat (limited to 'sys/boot/i386/loader')
-rw-r--r--sys/boot/i386/loader/Makefile30
1 files changed, 18 insertions, 12 deletions
diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile
index 8f3480a..719e28d 100644
--- a/sys/boot/i386/loader/Makefile
+++ b/sys/boot/i386/loader/Makefile
@@ -3,9 +3,10 @@
.include <bsd.own.mk>
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 <bsd.init.mk>
-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}
OpenPOWER on IntegriCloud