2008-11-19 16:39:01 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2017-11-21 18:03:47 +00:00
|
|
|
HAVE_GELI= yes
|
2017-11-10 23:54:48 +00:00
|
|
|
|
2017-10-30 23:14:37 +00:00
|
|
|
.include <bsd.init.mk>
|
2017-03-28 07:01:40 +00:00
|
|
|
|
2017-10-30 23:14:37 +00:00
|
|
|
.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \
|
|
|
|
${BOOTSRC}/i386/zfsboot ${BOOTSRC}/i386/common \
|
2017-10-30 23:14:59 +00:00
|
|
|
${SASRC}
|
2008-11-19 16:39:01 +00:00
|
|
|
|
|
|
|
FILES= gptzfsboot
|
2014-09-15 06:21:28 +00:00
|
|
|
MAN= gptzfsboot.8
|
2008-11-19 16:39:01 +00:00
|
|
|
|
|
|
|
NM?= nm
|
|
|
|
|
|
|
|
BOOT_COMCONSOLE_PORT?= 0x3f8
|
|
|
|
BOOT_COMCONSOLE_SPEED?= 9600
|
|
|
|
B2SIOFMT?= 0x3
|
|
|
|
|
|
|
|
REL1= 0x700
|
|
|
|
ORG1= 0x7c00
|
|
|
|
ORG2= 0x0
|
|
|
|
|
2017-10-12 14:56:54 +00:00
|
|
|
CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \
|
2011-09-13 14:03:55 +00:00
|
|
|
-O1 \
|
2016-10-29 14:09:32 +00:00
|
|
|
-DGPT -DZFS -DBOOT2 \
|
2008-11-19 16:39:01 +00:00
|
|
|
-DSIOPRT=${BOOT_COMCONSOLE_PORT} \
|
|
|
|
-DSIOFMT=${B2SIOFMT} \
|
|
|
|
-DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
|
2017-10-30 23:14:37 +00:00
|
|
|
-I${LDRSRC} \
|
|
|
|
-I${BOOTSRC}/i386/common \
|
2017-10-30 23:14:59 +00:00
|
|
|
-I${ZFSSRC} \
|
2017-12-05 21:37:55 +00:00
|
|
|
-I${SYSDIR}/crypto/skein \
|
2017-10-30 23:14:37 +00:00
|
|
|
-I${SYSDIR}/cddl/boot/zfs \
|
2017-11-10 23:54:58 +00:00
|
|
|
-I${BOOTSRC}/i386/btx/lib \
|
2017-10-30 23:14:37 +00:00
|
|
|
-I${BOOTSRC}/i386/boot2 \
|
2017-03-28 20:30:33 +00:00
|
|
|
-Wall -Waggregate-return -Wbad-function-cast \
|
2008-11-19 16:39:01 +00:00
|
|
|
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
|
|
|
|
-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
|
2017-03-28 07:01:40 +00:00
|
|
|
-Winline -Wno-pointer-sign
|
|
|
|
|
2017-03-28 20:30:33 +00:00
|
|
|
NO_WCAST_ALIGN=
|
|
|
|
|
2017-03-28 07:01:40 +00:00
|
|
|
.if ${COMPILER_TYPE} == "clang" || \
|
|
|
|
(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201)
|
|
|
|
CFLAGS+= -Wno-tentative-definition-incomplete-type
|
|
|
|
.endif
|
2014-01-05 21:03:49 +00:00
|
|
|
|
2017-10-30 23:14:59 +00:00
|
|
|
.if ${MACHINE} == "amd64"
|
|
|
|
LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a
|
|
|
|
.else
|
|
|
|
LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a
|
|
|
|
.endif
|
2016-10-06 03:32:30 +00:00
|
|
|
|
2014-01-05 21:03:49 +00:00
|
|
|
CFLAGS.gcc+= --param max-inline-insns-single=100
|
2008-11-19 16:39:01 +00:00
|
|
|
|
2017-10-30 23:14:37 +00:00
|
|
|
LD_FLAGS+=${LD_FLAGS_BIN}
|
2008-11-19 16:39:01 +00:00
|
|
|
|
2017-11-10 23:54:58 +00:00
|
|
|
CLEANFILES+= gptzfsboot
|
2008-11-19 16:39:01 +00:00
|
|
|
|
|
|
|
gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN}
|
|
|
|
btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
|
|
|
|
-o ${.TARGET} gptzfsboot.bin
|
|
|
|
|
|
|
|
CLEANFILES+= gptldr.bin gptldr.out gptldr.o
|
|
|
|
|
|
|
|
gptldr.bin: gptldr.out
|
2015-04-02 06:58:17 +00:00
|
|
|
${OBJCOPY} -S -O binary gptldr.out ${.TARGET}
|
2008-11-19 16:39:01 +00:00
|
|
|
|
|
|
|
gptldr.out: gptldr.o
|
2013-12-30 19:05:50 +00:00
|
|
|
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
|
2008-11-19 16:39:01 +00:00
|
|
|
|
2011-04-21 14:17:36 +00:00
|
|
|
CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \
|
2017-11-21 18:03:47 +00:00
|
|
|
drv.o gpt.o ${OPENCRYPTO_XTS}
|
2008-11-19 16:39:01 +00:00
|
|
|
|
|
|
|
gptzfsboot.bin: gptzfsboot.out
|
2015-04-02 06:58:17 +00:00
|
|
|
${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET}
|
2008-11-19 16:39:01 +00:00
|
|
|
|
2017-11-21 18:03:47 +00:00
|
|
|
gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \
|
2017-10-30 23:14:59 +00:00
|
|
|
${OPENCRYPTO_XTS}
|
|
|
|
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBZFSBOOT} ${LIBSA32}
|
2008-11-19 16:39:01 +00:00
|
|
|
|
2017-10-30 23:14:59 +00:00
|
|
|
zfsboot.o: ${ZFSSRC}/zfsimpl.c
|
2008-11-19 16:39:01 +00:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|
2012-02-28 18:30:18 +00:00
|
|
|
|
|
|
|
# XXX: clang integrated-as doesn't grok .codeNN directives yet
|
|
|
|
CFLAGS.gptldr.S= ${CLANG_NO_IAS}
|