Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jan 2014 22:25:57 +0000 (UTC)
From:      Glen Barber <gjb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r260896 - in user/gjb/hacking/release-embedded/release: . arm
Message-ID:  <201401192225.s0JMPv70031280@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gjb
Date: Sun Jan 19 22:25:57 2014
New Revision: 260896
URL: http://svnweb.freebsd.org/changeset/base/260896

Log:
  When bootstrapping the build chroot, the default environment is
  set up for the amd64/amd64 TARGET/TARGET_ARCH combination.
  
  Some of the build tools used here (u-boot in particular) require
  use of gcc(1).  The lang/gcc* from ports/ will install as 'gccNN'
  instead of 'gcc', so they cannot be used without extra hacks.
  
  Add an EMBEDDED_WORLD_FLAGS variable to be used to properly set
  up the build chroot.  For the RPI-B case, EMBEDDED_WORLD_FLAGS
  is set to 'WITH_GCC=1', which is used to set up the build chroot.
  
  While here, in followup to r260895, do not rely on the necessary
  configuration files and/or scripts to exist in the build target
  src/ tree.
  
  To work around cases where files do not exist, copy (from the
  local release/ checkout) the tools/${XDEV}/crochet-${KERNEL}.conf
  to ${CHROOTDIR}/tmp/external/crochet-${KERNEL}.conf to make them
  accessible to the external utilities that need them (i.e., crochet).
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  user/gjb/hacking/release-embedded/release/arm/RPI-B.conf
  user/gjb/hacking/release-embedded/release/arm/release.sh
  user/gjb/hacking/release-embedded/release/release.conf.sample
  user/gjb/hacking/release-embedded/release/release.sh

Modified: user/gjb/hacking/release-embedded/release/arm/RPI-B.conf
==============================================================================
--- user/gjb/hacking/release-embedded/release/arm/RPI-B.conf	Sun Jan 19 22:01:08 2014	(r260895)
+++ user/gjb/hacking/release-embedded/release/arm/RPI-B.conf	Sun Jan 19 22:25:57 2014	(r260896)
@@ -17,6 +17,7 @@ SVNROOT="svn://svn.FreeBSD.org"
 SRCBRANCH="base/head@rHEAD"
 DOCBRANCH="doc/head@rHEAD"
 PORTBRANCH="ports/head@rHEAD"
+EMBEDDED_WORLD_FLAGS="WITH_GCC=1"
 NODOC=yes
 
 # Build target configuration

Modified: user/gjb/hacking/release-embedded/release/arm/release.sh
==============================================================================
--- user/gjb/hacking/release-embedded/release/arm/release.sh	Sun Jan 19 22:01:08 2014	(r260895)
+++ user/gjb/hacking/release-embedded/release/arm/release.sh	Sun Jan 19 22:25:57 2014	(r260896)
@@ -50,7 +50,7 @@ main() {
 	install_uboot
 	mkdir -p ${CHROOTDIR}/tmp/crochet/work
 	eval chroot ${CHROOTDIR} /bin/sh /tmp/crochet/crochet.sh \
-		-c /usr/src/tools/release/${XDEV}/crochet-${KERNEL}.conf
+		-c /tmp/external/${XDEV}/crochet-${KERNEL}.conf
 }
 
 main "$@"

Modified: user/gjb/hacking/release-embedded/release/release.conf.sample
==============================================================================
--- user/gjb/hacking/release-embedded/release/release.conf.sample	Sun Jan 19 22:01:08 2014	(r260895)
+++ user/gjb/hacking/release-embedded/release/release.conf.sample	Sun Jan 19 22:25:57 2014	(r260896)
@@ -40,3 +40,11 @@ PORTBRANCH="ports/head@rHEAD"
 #NOPORTS=
 #RELSTRING=
 #WITH_DVD=
+
+## Set when building embedded images.
+#EMBEDDEDBUILD=
+
+## Set to specify userland-specific make(1) flags that affect the
+## build chroot environment.
+#EMBEDDED_WORLD_FLAGS=""
+

Modified: user/gjb/hacking/release-embedded/release/release.sh
==============================================================================
--- user/gjb/hacking/release-embedded/release/release.sh	Sun Jan 19 22:01:08 2014	(r260895)
+++ user/gjb/hacking/release-embedded/release/release.sh	Sun Jan 19 22:25:57 2014	(r260896)
@@ -37,6 +37,7 @@ export PATH
 
 # The directory within which the release will be built.
 CHROOTDIR="/scratch"
+RELENGDIR="$(realpath $(dirname $(basename ${0})))"
 
 # The default svn checkout server, and svn branches for src/, doc/,
 # and ports/.
@@ -47,6 +48,7 @@ PORTBRANCH="ports/head@rHEAD"
 
 # Set for embedded device builds.
 EMBEDDEDBUILD=
+EMBEDDED_WORLD_FLAGS=
 
 # Sometimes one needs to checkout src with --force svn option.
 # If custom kernel configs copied to src tree before checkout, e.g.
@@ -135,9 +137,9 @@ else
 	ARCH_FLAGS=
 fi
 CHROOT_MAKEENV="MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj"
-CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}"
-CHROOT_IMAKEFLAGS="${CONF_FILES}"
-CHROOT_DMAKEFLAGS="${CONF_FILES}"
+CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES} ${EMBEDDED_WORLD_FLAGS}"
+CHROOT_IMAKEFLAGS="${CONF_FILES} ${EMBEDDED_WORLD_FLAGS}"
+CHROOT_DMAKEFLAGS="${CONF_FILES} ${EMBEDDED_WORLD_FLAGS}"
 RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}"
 RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}"
 RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \
@@ -194,8 +196,16 @@ fi
 
 # Embedded builds do not use the 'make release' target.
 if [ "X${EMBEDDEDBUILD}" != "X" ]; then
-	if [ -e ${CHROOTDIR}/usr/src/release/${XDEV}/release.sh ]; then
-		/bin/sh ${CHROOTDIR}/usr/src/release/${XDEV}/release.sh
+	# If a crochet configuration file exists in *this* checkout of
+	# release/, copy it to the /tmp/external directory within the chroot.
+	# This allows building embedded releases without relying on updated
+	# scripts and/or configurations to exist in the branch being built.
+	if [ -e ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf ] && \
+		[ -e ${RELENGDIR}/${XDEV}/release.sh ]; then
+			mkdir -p ${CHROOTDIR}/tmp/external/${XDEV}/
+			cp ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf \
+				${CHROOTDIR}/tmp/external/${XDEV}/crochet-${KERNEL}.conf
+			/bin/sh ${RELENGDIR}/${XDEV}/release.sh
 	fi
 	# If the script does not exist for this architecture, exit.
 	# This probably should be checked earlier, but allowing the rest



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