From owner-svn-src-user@freebsd.org Sat Oct 24 18:53:24 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7CB0A1D30C for ; Sat, 24 Oct 2015 18:53:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9BF711D4; Sat, 24 Oct 2015 18:53:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9OIrM1Q027774; Sat, 24 Oct 2015 18:53:22 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9OIrMqw027771; Sat, 24 Oct 2015 18:53:22 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201510241853.t9OIrMqw027771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 24 Oct 2015 18:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r289883 - in user/cperciva/freebsd-update-build/scripts/9.3-RELEASE: . amd64 i386 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2015 18:53:24 -0000 Author: glebius Date: Sat Oct 24 18:53:22 2015 New Revision: 289883 URL: https://svnweb.freebsd.org/changeset/base/289883 Log: Check in initial configuration of 9.3-RELEASE freebsd-update-server config, that was used for the previous builds. Added: user/cperciva/freebsd-update-build/scripts/9.3-RELEASE/ user/cperciva/freebsd-update-build/scripts/9.3-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/9.3-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/9.3-RELEASE/build.subr user/cperciva/freebsd-update-build/scripts/9.3-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/9.3-RELEASE/i386/build.conf (contents, props changed) Added: user/cperciva/freebsd-update-build/scripts/9.3-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/9.3-RELEASE/amd64/build.conf Sat Oct 24 18:53:22 2015 (r289883) @@ -0,0 +1,13 @@ +# SHA256 hash of disc1.iso image. +export RELH=5a3c82653d77bba7d7ded8bd7efbedc09d52cf4045d98ce52a82c9e0f8fa9b0e + +# gjb's home directory +export FTP=http://people.freebsd.org/~gjb/9.3-RELEASE/ + +# Components of the world, source, and kernels +export WORLDPARTS="base doc games lib32" +export SOURCEPARTS="src" +export KERNELPARTS="kernel" + +# EOL date +export EOL=1483228800 Added: user/cperciva/freebsd-update-build/scripts/9.3-RELEASE/build.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/9.3-RELEASE/build.subr Sat Oct 24 18:53:22 2015 (r289883) @@ -0,0 +1,199 @@ +# Overrides to FreeBSD Update build subroutines for FreeBSD 9.0. + +# Download and verify a release ISO image. +fetchiso () { + log "Starting fetch" + + # Figure out where the disc1 ISO image is + RELNUM=${REL%-*} +# ISO=${FTP}/${TARGET}/ISO-IMAGES/${RELNUM}/${REL}-${TARGET}-disc1.iso + ISO=${FTP}/FreeBSD-${REL}-${TARGET}-disc1.iso + + # Fetch the ISO image. We consider the ISO image to be + # the One True Release and don't look at the files used + # for FTP installs. The FreeBSD 4.7-RELEASE ISO and FTP + # files were not identical, but this should never happen + # again. + fetch -o ${WORKDIR}/iso.img -rR ${ISO} 2>&1 + + log "Verifying dvd1 hash" + + # Check that the downloaded ISO has the correct hash. + if ! [ "`sha256 -q ${WORKDIR}/iso.img`" = "${RELH}" ]; then + echo "FreeBSD ${REL}-${TARGET}-dvd1.iso has incorrect hash." + rm ${WORKDIR}/iso.img + return 1 + fi +} + +# Extract the released trees and, if appropriate, construct a world (base +# plus source code) in which to perform builds. +extractiso () { + # Create and mount a md(4) attached to the ISO image. + ISOMD=`mdconfig -a -t vnode -f ${WORKDIR}/iso.img -n` + mkdir -p ${WORKDIR}/iso + mount -t cd9660 -o ro,nosuid /dev/md${ISOMD} ${WORKDIR}/iso + + # Extract the various components into different directories + log "Extracting components" + for C in ${WORLDPARTS}; do + mkdir -p ${WORKDIR}/release/R/trees/world/${C} + cat ${WORKDIR}/iso/usr/freebsd-dist/${C}.txz | + tar -xpzf - -C ${WORKDIR}/release/R/trees/world/${C} + done + for C in ${KERNELPARTS}; do + mkdir -p ${WORKDIR}/release/R/trees/kernel/${C} + cat ${WORKDIR}/iso/usr/freebsd-dist/${C}.txz | + tar -xpzf - -C ${WORKDIR}/release/R/trees/kernel/${C} + done + for C in ${SOURCEPARTS}; do + mkdir -p ${WORKDIR}/release/R/trees/src/${C} + cat ${WORKDIR}/iso/usr/freebsd-dist/${C}.txz | + tar -xpzf - -C ${WORKDIR}/release/R/trees/src/${C} + done + + # If the release ISO we're handling belongs to the platform + # we're running right now, create a world image for future use. + if [ ${TARGET} = ${HOSTPLATFORM} ]; then + log "Constructing world+src image" + + # Create directory for world + mkdir ${WORKDIR}/world/ + + # Extract world and source distributions + for C in ${WORLDPARTS}; do + cat ${WORKDIR}/iso/usr/freebsd-dist/${C}.txz | + tar -xpzf - -C ${WORKDIR}/world/ + done + for C in ${SOURCEPARTS}; do + cat ${WORKDIR}/iso/usr/freebsd-dist/${C}.txz | + tar -xpzf - -C ${WORKDIR}/world/ + done + + # build a single tarball of them. + tar -czf ${WORKDIR}/../world.tgz -C ${WORKDIR}/world . + + # clean up + nuke world + fi + + # Unmount and detach the ISO image md(4). + umount ${WORKDIR}/iso + rmdir ${WORKDIR}/iso + mdconfig -d -u ${ISOMD} +} + +# Perform a build in ${WORKDIR}/$1 with BRANCH_OVERRIDE set to $2 +buildworld () { + # We need a devfs inside the jail. Note that we are using a + # jail here in order to keep the environment as "clean" as + # possible, not for security reasons; we assume that the + # original source code plus patches we add personally will + # not do anything evil. + mount -t devfs devfs ${WORKDIR}/$1/dev + + # We need to be able to set file flags + sysctl security.jail.chflags_allowed=1 >/dev/null + + # Build stuff. + jail ${WORKDIR}/$1 ${BUILDHOSTNAME} 127.1.2.3 \ + /usr/bin/env -i PATH=${PATH} RELP=${RELP} \ + BRANCH_OVERRIDE=$2 VERSION="FreeBSD 9.1-RELEASE amd64 902001" \ + TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ + /bin/sh -e <<-"EOF" 2>&1 >${WORKDIR}/$1-build.log + # Function for logging what we're doing + log () { + echo "`date` $1 for FreeBSD/${TARGET} ${RELP}" 1>&2 + } + + # Build the world + log "Building world" + cd /usr/src && + make buildworld -j17 2>&1 + + # Build and kernel + log "Building kernel" + cd /usr/src && + make buildkernel -j17 2>&1 + + # Build and install release images + log "Building release" + cd /usr/src/release && + make release 2>&1 && + make install DESTDIR=/R 2>&1 + EOF + + # Put all the components into the right places. + log "Moving components into staging area" + jail ${WORKDIR}/$1 ${BUILDHOSTNAME} 127.1.2.3 \ + /usr/bin/env -i PATH=${PATH} \ + WORLDPARTS="${WORLDPARTS}" \ + KERNELPARTS="${KERNELPARTS}" \ + SOURCEPARTS="${SOURCEPARTS}" \ + /bin/sh -e <<-"EOF" 2>&1 >>${WORKDIR}/$1-build.log + # Create area for uncompressed components + mkdir -p /R/trees + + # Move world components into place + for C in ${WORLDPARTS}; do + mkdir -p /R/trees/world/${C} + cat /R/ftp/${C}.txz | + tar -xpzf - -C /R/trees/world/${C} + done + + # Move kernel components into place + for C in ${KERNELPARTS}; do + mkdir -p /R/trees/kernel/${C} + cat /R/ftp/${C}.txz | + tar -xpzf - -C /R/trees/kernel/${C} + done + + # Extract src components into place + for C in ${SOURCEPARTS}; do + mkdir -p /R/trees/src/${C} + cat /R/ftp/${C}.txz | + tar -xpzf - -C /R/trees/src/${C} + done + EOF + + # Get rid of the devfs we no longer need. + umount ${WORKDIR}/$1/dev +} + +# Perform a build in ${WORKDIR}/$1, but with the date set 400 days +# into the future. Turn off NTP before we change the date and +# turn it back on afterwards. +futurebuildworld () { + # Turn off ntpd if necessary + if /etc/rc.d/ntpd status | + grep -q 'is running'; then + ntpd_was_running=1 + log "Turning off NTP" + /etc/rc.d/ntpd stop >/dev/null + else + ntpd_was_running=0 + fi + + date -n `date -j -v+400d "+%y%m%d%H%M.%S"` >/dev/null + buildworld $1 FUTUREBUILD + date -n `date -j -v-400d "+%y%m%d%H%M.%S"` >/dev/null + + # Turn ntpd back on, if appropriate + if [ ${ntpd_was_running} = 1 ]; then + log "Turning NTP back on" + /etc/rc.d/ntpd start >/dev/null + fi +} + +# Add extra docs to ${WORKDIR}/$1 +addextradocs () { + log "Extracting extra docs" + + # 8.0 doesn't have any extra docs +} + +# Fixup: the "kernel" kernel is really the "generic" kernel. +indexpublish () { + sed -E 's,kernel\|kernel,kernel|generic,' +} + Added: user/cperciva/freebsd-update-build/scripts/9.3-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/9.3-RELEASE/i386/build.conf Sat Oct 24 18:53:22 2015 (r289883) @@ -0,0 +1,13 @@ +# SHA256 hash of disc1.iso image. +export RELH=cab6aad9c3d5ea6a3fb4059f808225c67f1edaea730c555a86a9707ac41ba75d + +# gjb's home directory +export FTP=http://people.freebsd.org/~gjb/9.3-RELEASE/ + +# Components of the world, source, and kernels +export WORLDPARTS="base doc games" +export SOURCEPARTS="src" +export KERNELPARTS="kernel" + +# EOL date +export EOL=1483228800