Date: Tue, 15 Apr 2014 20:23:16 +0100 From: Mark R V Murray <mark@grondar.org> To: Tim Kientzle <tim@kientzle.com> Cc: freebsd-arm <freebsd-arm@freebsd.org> Subject: Building an ARM/RPI-B release (hacked) on CURRENT/AMD64. Message-ID: <9FDD6F0E-B2A9-48D9-A3E4-181868995FDA@grondar.org>
next in thread | raw e-mail | index | archive | help
--Apple-Mail=_56E46362-BF0A-4321-AC4F-8F0A1E842A6C Content-Type: multipart/mixed; boundary="Apple-Mail=_D4C8EA88-9ADC-4040-AE4C-A4AE569890C4" --Apple-Mail=_D4C8EA88-9ADC-4040-AE4C-A4AE569890C4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi Tim I=92ve been doing some local hacks to cross-build ARM/RPI releases on = CURRENT/AMD64. What I=92m doing aren=92t clean releases in that I want to use the state = of /usr/src and /usr/ports =93as-is=94 and not a clean check out. This = allows me to experimentally break stuff without having to check it in = first. It also give me a way to build bootable images for when (not = =93if=94!) I mess things up properly on the RPI. It has the advantage = also of being quicker than the usual release build. (The hacks, as they stand now, are attached. I null-mount /usr/src and = /usr/ports instead of checking them out, and I have local checkouts of = crochet and u-boot to copy as checking them out during a release build = fails too often.) The problem is that sometime in the last month or so, things stopped = working, and its taken me until now to have the time to have a look at = it. The problem is that during the u-boot build, a CLANG-based xdev build is = used, and this has no *-gcc, only a *-cc. If I fix that with a symlink, = clang then objects to the -ffixed-r8 option. Clang has an equivalent = -ffixed-r9, but the u-boot that is mandated for FreeBSD/Arm/RPI use = doesn=92t have the R9 fix. Questions: 1) Are you aware of any of this? 2) Do you have a quick fix idea (preferably not involving GCC)? I=92m rather short of time right now, but may be able to get to this = over Easter. M --=20 Mark R V Murray --Apple-Mail=_D4C8EA88-9ADC-4040-AE4C-A4AE569890C4 Content-Disposition: attachment; filename=release_rpi_hacks.diff Content-Type: application/octet-stream; name="release_rpi_hacks.diff" Content-Transfer-Encoding: 7bit Index: arm/RPI-B.conf =================================================================== --- arm/RPI-B.conf (revision 264500) +++ arm/RPI-B.conf (working copy) @@ -17,7 +17,7 @@ set -a WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -CHROOTDIR="/scratch" +CHROOTDIR="/usr/release/RPI" EMBEDDEDBUILD=1 EMBEDDEDPORTS="lang/python textproc/gsed" XDEV="arm" Index: arm/release.sh =================================================================== --- arm/release.sh (revision 264500) +++ arm/release.sh (working copy) @@ -75,8 +75,8 @@ } install_crochet() { - chroot ${CHROOTDIR} svn co -q ${CROCHETSRC}/${CROCHETBRANCH} \ - /tmp/crochet + rm -rf ${CHROOTDIR}/tmp/crochet + cp -rp /usr/src/release/crochet ${CHROOTDIR}/tmp/. } install_uboot() { @@ -87,8 +87,7 @@ else return 0 fi - chroot ${CHROOTDIR} svn co -q ${UBOOTSRC}/${UBOOTBRANCH} \ - /${UBOOTDIR} + cp -rp /usr/src/release/u-boot ${CHROOTDIR}${UBOOTDIR} } main() { @@ -99,21 +98,21 @@ WITH_GCC=1 ${WORLD_FLAGS} -j1 obj depend all install # Build the 'xdev' target for crochet. eval chroot ${CHROOTDIR} make -C /usr/src \ - XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} WITH_GCC=1 \ - ${WORLD_FLAGS} xdev + XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} ${WORLD_FLAGS} xdev + ( cd ${CHROOTDIR} && ln -sf ../..//usr/armv6-freebsd/usr/bin/cc armv6-freebsd-gcc ) # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints # is created. - eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart + eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig restart # Install security/ca_root_nss since we need to check the https # certificate of github. eval chroot ${CHROOTDIR} make -C /usr/ports/security/ca_root_nss \ OPTIONS_SET="ETCSYMLINK" BATCH=1 FORCE_PKG_REGISTER=1 \ - install clean distclean - EMBEDDEDPORTS="${EMBEDDEDPORTS} devel/subversion" + install clean for _PORT in ${EMBEDDEDPORTS}; do + eval chroot ${CHROOTDIR} make -C /usr/ports/${_PORT} clean eval chroot ${CHROOTDIR} make -C /usr/ports/${_PORT} \ - BATCH=1 FORCE_PKG_REGISTER=1 install clean distclean + BATCH=1 FORCE_PKG_REGISTER=1 install clean done mkdir -p ${CHROOTDIR}/tmp/crochet/work Index: release.sh =================================================================== --- release.sh (revision 264500) +++ release.sh (working copy) @@ -189,28 +189,30 @@ set -e # Everything must succeed mkdir -p ${CHROOTDIR}/usr +mkdir -p ${CHROOTDIR}/usr/src +mkdir -p ${CHROOTDIR}/usr/doc +mkdir -p ${CHROOTDIR}/usr/ports -if [ -z "${SRC_UPDATE_SKIP}" ]; then - ${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src -fi +mount -t nullfs /usr/src ${CHROOTDIR}/usr/src +unmount=${CHROOTDIR}/usr/src if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then - ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc + mount -t nullfs /usr/doc ${CHROOTDIR}/usr/doc + unmount="${unmount} ${CHROOTDIR}/usr/doc" fi if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then - ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports + mount -t nullfs /usr/ports ${CHROOTDIR}/usr/ports + unmount="${unmount} ${CHROOTDIR}/usr/ports" fi if [ -z "${CHROOTBUILD_SKIP}" ]; then cd ${CHROOTDIR}/usr/src env ${CHROOT_MAKEENV} make ${CHROOT_WMAKEFLAGS} buildworld - env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld \ - DESTDIR=${CHROOTDIR} - env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution \ - DESTDIR=${CHROOTDIR} + env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld DESTDIR=${CHROOTDIR} + env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution DESTDIR=${CHROOTDIR} fi mount -t devfs devfs ${CHROOTDIR}/dev cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf -trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit +trap "cd ${CHROOTDIR} && for mount in ${unmount} ${CHROOTDIR}/dev ; do umount \${mount} ; done" EXIT # Clean up mounts on exit # If MAKE_CONF and/or SRC_CONF are set and not character devices (/dev/null), # copy them to the chroot. @@ -257,7 +259,7 @@ PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" PBUILD_FLAGS="${PBUILD_FLAGS}" chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ - ${PBUILD_FLAGS} OPTIONS_UNSET="FOP IGOR" install clean distclean + ${PBUILD_FLAGS} OPTIONS_UNSET="FOP IGOR" install clean fi fi --Apple-Mail=_D4C8EA88-9ADC-4040-AE4C-A4AE569890C4 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_D4C8EA88-9ADC-4040-AE4C-A4AE569890C4-- --Apple-Mail=_56E46362-BF0A-4321-AC4F-8F0A1E842A6C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - http://gpgtools.org iQCVAwUBU02HKt58vKOKE6LNAQqm8QP6A0DpnDOSG/BrJObeLXUs6A+76a+EtV/g RkAUBJDhF0PtbfXfO9I2xmNNhwyShuizOV2e78AIl/6+7sQJ4AiIMBKsLkdNbSBM YgeMZwOf2X/WvQFbiqQoRXZ6rmLqU42N1BKT8SXaO+SA516TWa4KZqJQYompqFRS Le8ezWghEDM= =q1ZC -----END PGP SIGNATURE----- --Apple-Mail=_56E46362-BF0A-4321-AC4F-8F0A1E842A6C--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9FDD6F0E-B2A9-48D9-A3E4-181868995FDA>