diff options
author | dfr <dfr@FreeBSD.org> | 2008-11-19 16:39:01 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2008-11-19 16:39:01 +0000 |
commit | d6f289d4433bdf255fa2c6abca2ab24c322bf884 (patch) | |
tree | 0a4e9c8e0a75ca6fc34e64f38b47d5e60c52f174 /sys/boot/i386/gptzfsboot | |
parent | a24417724cb96f3cb441f632dc3e87fb79a6e536 (diff) | |
download | FreeBSD-src-d6f289d4433bdf255fa2c6abca2ab24c322bf884.zip FreeBSD-src-d6f289d4433bdf255fa2c6abca2ab24c322bf884.tar.gz |
Add a GPT-aware variant of zfsboot which should be used in a similar manner
to gptboot, i.e. installed in a freebsd-boot partition using /sbin/gpart or
/sbin/gpt.
Tweak the /boot/loader ZFS support so that it can find ZFS pools that are
contained in GPT partitions.
Diffstat (limited to 'sys/boot/i386/gptzfsboot')
-rw-r--r-- | sys/boot/i386/gptzfsboot/Makefile | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile new file mode 100644 index 0000000..985c043 --- /dev/null +++ b/sys/boot/i386/gptzfsboot/Makefile @@ -0,0 +1,74 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot ${.CURDIR}/../zfsboot + +FILES= gptzfsboot + +NM?= nm + +BOOT_COMCONSOLE_PORT?= 0x3f8 +BOOT_COMCONSOLE_SPEED?= 9600 +B2SIOFMT?= 0x3 + +REL1= 0x700 +ORG1= 0x7c00 +ORG2= 0x0 + +CFLAGS= -Os \ + -fno-guess-branch-probability \ + -fomit-frame-pointer \ + -fno-unit-at-a-time \ + -mno-align-long-strings \ + -mrtd \ + -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ + -DGPT -DBOOT2 \ + -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ + -DSIOFMT=${B2SIOFMT} \ + -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ + -I${.CURDIR}/../../common \ + -I${.CURDIR}/../../zfs \ + -I${.CURDIR}/../../../cddl/boot/zfs \ + -I${.CURDIR}/../btx/lib -I. \ + -I${.CURDIR}/../boot2 \ + -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ + -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ + -Winline --param max-inline-insns-single=100 + +LDFLAGS=-static -N --gc-sections + +# Pick up ../Makefile.inc early. +.include <bsd.init.mk> + +CLEANFILES= gptzfsboot + +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 + objcopy -S -O binary gptldr.out ${.TARGET} + +gptldr.out: gptldr.o + ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o + +CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o + +gptzfsboot.bin: gptzfsboot.out + objcopy -S -O binary gptzfsboot.out ${.TARGET} + +gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o + ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} + +zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c + +.if ${MACHINE_ARCH} == "amd64" +beforedepend gptzfsboot.o: machine +CLEANFILES+= machine +machine: + ln -sf ${.CURDIR}/../../../i386/include machine +.endif + +.include <bsd.prog.mk> |