Replace LOADER_FIREWIRE_SUPPORT variable

Rename LOADER_FIREWIRE_SUPPORT to MK_LOADER_FIREWIRE. Only build
libfirewire when this is "yes". Add note to updating. Fix build script
to build this for x86 so the option doesn't decay. sparc64 supports
ZFS, so also build it MK_ZFS=no.

Sponsored by: Netflix
This commit is contained in:
Warner Losh 2017-11-10 23:54:41 +00:00
parent 96534eedcd
commit a179cd9114
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=325692
7 changed files with 60 additions and 31 deletions

View File

@ -51,6 +51,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
****************************** SPECIAL WARNING: ****************************** ****************************** SPECIAL WARNING: ******************************
201711xx:
The LOADER_FIREWIRE_SUPPORT build variable as been renamed to
WITH_LOADER_FIREWIRE (or WITHOUT_LOADER_FIREWIRE).
20171106: 20171106:
The naive and non-compliant support of posix_fallocate(2) in ZFS The naive and non-compliant support of posix_fallocate(2) in ZFS
has been removed as of r325320. The system call now returns EINVAL has been removed as of r325320. The system call now returns EINVAL

View File

@ -180,6 +180,7 @@ __DEFAULT_NO_OPTIONS = \
GNU_GREP_COMPAT \ GNU_GREP_COMPAT \
HESIOD \ HESIOD \
LIBSOFT \ LIBSOFT \
LOADER_FIREWIRE \
LOADER_FORCE_LE \ LOADER_FORCE_LE \
NAND \ NAND \
OFED \ OFED \

View File

@ -3,7 +3,13 @@
.include <bsd.init.mk> .include <bsd.init.mk>
SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \
libi386 libfirewire loader libi386
.if ${MK_LOADER_FIREWIRE} == "yes"
SUBDIR+= libfirewire
.endif
SUBDIR+= loader
# special boot programs, 'self-extracting boot2+loader' # special boot programs, 'self-extracting boot2+loader'
SUBDIR+= pxeldr SUBDIR+= pxeldr

View File

@ -28,4 +28,9 @@ LD_FLAGS_BIN=-static -N --gc-sections
DO32=1 DO32=1
.endif .endif
.if defined(LOADER_FIREWIRE_SUPPORT)
MK_LOADER_FIREWIRE=yes
.warning "LOADER_FIREWIRE_SUPPORT deprecated, please move to WITH_LOADER_FIREWIRE"
.endif
.include "../Makefile.inc" .include "../Makefile.inc"

View File

@ -26,12 +26,6 @@ VERSION_FILE= ${.CURDIR}/../loader/version
# architecture-specific loader code # architecture-specific loader code
SRCS= main.c conf.c vers.c chain.c SRCS= main.c conf.c vers.c chain.c
# Put LOADER_FIREWIRE_SUPPORT=yes in /etc/make.conf for FireWire/dcons support
.if defined(LOADER_FIREWIRE_SUPPORT)
CFLAGS+= -DLOADER_FIREWIRE_SUPPORT
LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a
.endif
# Include bcache code. # Include bcache code.
HAVE_BCACHE= yes HAVE_BCACHE= yes
@ -39,6 +33,11 @@ HAVE_BCACHE= yes
HAVE_PNP= yes HAVE_PNP= yes
HAVE_ISABUS= yes HAVE_ISABUS= yes
.if ${MK_LOADER_FIREWIRE} == "yes"
CFLAGS+= -DLOADER_FIREWIRE_SUPPORT
LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a
.endif
.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" .if ${LOADER_GELI_SUPPORT:Uyes} == "yes"
CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -DLOADER_GELI_SUPPORT
CFLAGS+= -I${BOOTSRC}/geli CFLAGS+= -I${BOOTSRC}/geli

View File

@ -19,9 +19,30 @@
# Output is put into _.boot.$TARGET_ARCH.log in sys.boot. # Output is put into _.boot.$TARGET_ARCH.log in sys.boot.
# #
dobuild()
{
local ta=$1
local lf=$2
local opt=$3
echo -n "Building $ta ${opt} ... "
if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend" \
> $lf 2>&1; then
echo "Fail (cleanup)"
continue
fi
if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make ${opt} -j 20 all" \
>> $lf 2>&1; then
echo "Fail (build)"
continue
fi
echo "Success"
}
top=$(make -V SRCTOP) top=$(make -V SRCTOP)
cd $top/sys/boot cd $top/sys/boot
# Default build for a goodly selection of architectures
for i in \ for i in \
amd64/amd64 \ amd64/amd64 \
arm/arm arm/armeb arm/armv7 \ arm/arm arm/armeb arm/armv7 \
@ -32,34 +53,24 @@ for i in \
sparc64/sparc64 \ sparc64/sparc64 \
; do ; do
ta=${i##*/} ta=${i##*/}
echo -n "Building $ta..." dobuild $ta _.boot.${ta}.log ""
if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend" \
> _.boot.${ta}.log 2>&1; then
echo "Fail (cleanup)"
continue
fi
if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make -j 20 all" \
>> _.boot.${ta}.log 2>&1; then
echo "Fail (build)"
continue
fi
echo "Success"
done done
# Build w/o ZFS
for i in \
amd64/amd64 \
i386/i386 \
sparc64/sparc64 \
; do
ta=${i##*/}
dobuild $ta _.boot.${ta}.noZFS.log "MK_ZFS=no"
done
# Build with firewire
for i in \ for i in \
amd64/amd64 \ amd64/amd64 \
i386/i386 \ i386/i386 \
; do ; do
ta=${i##*/} ta=${i##*/}
echo -n "Building $ta MK_ZFS=no..." dobuild $ta _.boot.${ta}.firewire.log "MK_LOADER_FIREWIRE=yes"
if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend" \
> _.boot.${ta}.noZFS.log 2>&1; then
echo "Fail (cleanup)"
continue
fi
if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make MK_ZFS=no -j 20 all" \
>> _.boot.${ta}.noZFS.log 2>&1; then
echo "Fail (build)"
continue
fi
echo "Success"
done done

View File

@ -0,0 +1,3 @@
.\" $FreeBSD$
Enable firewire support in /boot/loader and /boot/zfsloader on x86.
This option is a nop on all other platforms.