Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Nov 2017 23:54:41 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325692 - in head: . share/mk sys/boot/i386 sys/boot/i386/loader tools/boot tools/build/options
Message-ID:  <201711102354.vAANsf83075135@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Fri Nov 10 23:54:41 2017
New Revision: 325692
URL: https://svnweb.freebsd.org/changeset/base/325692

Log:
  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

Added:
  head/tools/build/options/WITH_LOADER_FIREWIRE   (contents, props changed)
Modified:
  head/UPDATING
  head/share/mk/src.opts.mk
  head/sys/boot/i386/Makefile
  head/sys/boot/i386/Makefile.inc
  head/sys/boot/i386/loader/Makefile
  head/tools/boot/universe.sh

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

Modified: head/share/mk/src.opts.mk
==============================================================================
--- head/share/mk/src.opts.mk	Fri Nov 10 23:54:36 2017	(r325691)
+++ head/share/mk/src.opts.mk	Fri Nov 10 23:54:41 2017	(r325692)
@@ -180,6 +180,7 @@ __DEFAULT_NO_OPTIONS = \
     GNU_GREP_COMPAT \
     HESIOD \
     LIBSOFT \
+    LOADER_FIREWIRE \
     LOADER_FORCE_LE \
     NAND \
     OFED \

Modified: head/sys/boot/i386/Makefile
==============================================================================
--- head/sys/boot/i386/Makefile	Fri Nov 10 23:54:36 2017	(r325691)
+++ head/sys/boot/i386/Makefile	Fri Nov 10 23:54:41 2017	(r325692)
@@ -3,7 +3,13 @@
 .include <bsd.init.mk>
 
 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'
 SUBDIR+=	pxeldr

Modified: head/sys/boot/i386/Makefile.inc
==============================================================================
--- head/sys/boot/i386/Makefile.inc	Fri Nov 10 23:54:36 2017	(r325691)
+++ head/sys/boot/i386/Makefile.inc	Fri Nov 10 23:54:41 2017	(r325692)
@@ -28,4 +28,9 @@ LD_FLAGS_BIN=-static -N --gc-sections
 DO32=1
 .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"

Modified: head/sys/boot/i386/loader/Makefile
==============================================================================
--- head/sys/boot/i386/loader/Makefile	Fri Nov 10 23:54:36 2017	(r325691)
+++ head/sys/boot/i386/loader/Makefile	Fri Nov 10 23:54:41 2017	(r325692)
@@ -26,18 +26,17 @@ VERSION_FILE=	${.CURDIR}/../loader/version
 # architecture-specific loader code
 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.
 HAVE_BCACHE=	yes
 
 # Enable PnP and ISA-PnP code.
 HAVE_PNP=	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"
 CFLAGS+=	-DLOADER_GELI_SUPPORT

Modified: head/tools/boot/universe.sh
==============================================================================
--- head/tools/boot/universe.sh	Fri Nov 10 23:54:36 2017	(r325691)
+++ head/tools/boot/universe.sh	Fri Nov 10 23:54:41 2017	(r325692)
@@ -19,9 +19,30 @@
 # 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)
 cd $top/sys/boot
 
+# Default build for a goodly selection of architectures
 for i in \
 	amd64/amd64 \
 	arm/arm arm/armeb arm/armv7 \
@@ -32,34 +53,24 @@ for i in \
 	sparc64/sparc64 \
 	; do
     ta=${i##*/}
-    echo -n "Building $ta..."
-    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"
+    dobuild $ta _.boot.${ta}.log ""
 done
+
+# Build w/o ZFS
 for i in \
 	amd64/amd64 \
 	i386/i386 \
+	sparc64/sparc64 \
 	; do
     ta=${i##*/}
-    echo -n "Building $ta MK_ZFS=no..."
-    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"
+    dobuild $ta _.boot.${ta}.noZFS.log "MK_ZFS=no"
+done
+
+# Build with firewire
+for i in \
+	amd64/amd64 \
+	i386/i386 \
+	; do
+    ta=${i##*/}
+    dobuild $ta _.boot.${ta}.firewire.log "MK_LOADER_FIREWIRE=yes"
 done

Added: head/tools/build/options/WITH_LOADER_FIREWIRE
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/build/options/WITH_LOADER_FIREWIRE	Fri Nov 10 23:54:41 2017	(r325692)
@@ -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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711102354.vAANsf83075135>