Deleted Added
full compact
release.sh (252846) release.sh (254293)
1#!/bin/sh
2#-
3# Copyright (c) 2013 Glen Barber
4# Copyright (c) 2011 Nathan Whitehorn
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions

--- 15 unchanged lines hidden (view full) ---

24# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26# SUCH DAMAGE.
27#
28# release.sh: check out source trees, and build release components with
29# totally clean, fresh trees.
30# Based on release/generate-release.sh written by Nathan Whitehorn
31#
1#!/bin/sh
2#-
3# Copyright (c) 2013 Glen Barber
4# Copyright (c) 2011 Nathan Whitehorn
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions

--- 15 unchanged lines hidden (view full) ---

24# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26# SUCH DAMAGE.
27#
28# release.sh: check out source trees, and build release components with
29# totally clean, fresh trees.
30# Based on release/generate-release.sh written by Nathan Whitehorn
31#
32# $FreeBSD: head/release/release.sh 252846 2013-07-05 22:04:49Z gjb $
32# $FreeBSD: head/release/release.sh 254293 2013-08-13 20:16:14Z gjb $
33#
34
35PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
36export PATH
37
38# The directory within which the release will be built.
39CHROOTDIR="/scratch"
40
41# The default svn checkout server, and svn branches for src/, doc/,
42# and ports/.
43SVNROOT="svn://svn.freebsd.org"
33#
34
35PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
36export PATH
37
38# The directory within which the release will be built.
39CHROOTDIR="/scratch"
40
41# The default svn checkout server, and svn branches for src/, doc/,
42# and ports/.
43SVNROOT="svn://svn.freebsd.org"
44SRCBRANCH="base/head"
45DOCBRANCH="doc/head"
46PORTBRANCH="ports/head"
44SRCBRANCH="base/head@rHEAD"
45DOCBRANCH="doc/head@rHEAD"
46PORTBRANCH="ports/head@rHEAD"
47
48# Sometimes one needs to checkout src with --force svn option.
49# If custom kernel configs copied to src tree before checkout, e.g.
50SRC_FORCE_CHECKOUT=
51
47
48# Sometimes one needs to checkout src with --force svn option.
49# If custom kernel configs copied to src tree before checkout, e.g.
50SRC_FORCE_CHECKOUT=
51
52# The default src/, doc/, and ports/ revisions.
53SRCREVISION="-rHEAD"
54DOCREVISION="-rHEAD"
55PORTREVISION="-rHEAD"
56
57# The default make.conf and src.conf to use. Set to /dev/null
58# by default to avoid polluting the chroot(8) environment with
59# non-default settings.
60MAKE_CONF="/dev/null"
61SRC_CONF="/dev/null"
62
63# The number of make(1) jobs, defaults to the number of CPUs available for
64# buildworld, and half of number of CPUs available for buildkernel.
52# The default make.conf and src.conf to use. Set to /dev/null
53# by default to avoid polluting the chroot(8) environment with
54# non-default settings.
55MAKE_CONF="/dev/null"
56SRC_CONF="/dev/null"
57
58# The number of make(1) jobs, defaults to the number of CPUs available for
59# buildworld, and half of number of CPUs available for buildkernel.
65WORLD_FLAGS="-j$(sysctl -n hw.ncpu)"
66KERNEL_FLAGS="-j$(expr $(sysctl -n hw.ncpu) / 2)"
60NCPU=$(sysctl -n hw.ncpu)
61if [ ${NCPU} -gt 1 ]; then
62 WORLD_FLAGS="-j${NCPU}"
63 KERNEL_FLAGS="-j$(expr ${NCPU} / 2)"
64fi
67MAKE_FLAGS="-s"
68
69# The name of the kernel to build, defaults to GENERIC.
70KERNEL="GENERIC"
71
65MAKE_FLAGS="-s"
66
67# The name of the kernel to build, defaults to GENERIC.
68KERNEL="GENERIC"
69
72# The TARGET and TARGET_ARCH to build, defaults to the running system.
73TARGET="$(uname -p)"
74TARGET_ARCH="${TARGET}"
75
76# Set to non-empty value to disable checkout of doc/ and/or ports/. Disabling
77# ports/ checkout also forces NODOC to be set.
78NODOC=
79NOPORTS=
80MAKE_FLAGS="${MAKE_FLAGS}"
81
82get_rev_branch () {
83 # Set up the OSVERSION, BRANCH, and REVISION based on the src/ tree

--- 47 unchanged lines hidden (view full) ---

131if [ "x${NODOC}" != "x" ]; then
132 DOCPORTS="${DOCPORTS}NODOC=yes"
133fi
134
135# The aggregated build-time flags based upon variables defined within
136# this file, unless overridden by release.conf. In most cases, these
137# will not need to be changed.
138CONF_FILES="__MAKE_CONF=${MAKE_CONF} SRCCONF=${SRC_CONF}"
70# Set to non-empty value to disable checkout of doc/ and/or ports/. Disabling
71# ports/ checkout also forces NODOC to be set.
72NODOC=
73NOPORTS=
74MAKE_FLAGS="${MAKE_FLAGS}"
75
76get_rev_branch () {
77 # Set up the OSVERSION, BRANCH, and REVISION based on the src/ tree

--- 47 unchanged lines hidden (view full) ---

125if [ "x${NODOC}" != "x" ]; then
126 DOCPORTS="${DOCPORTS}NODOC=yes"
127fi
128
129# The aggregated build-time flags based upon variables defined within
130# this file, unless overridden by release.conf. In most cases, these
131# will not need to be changed.
132CONF_FILES="__MAKE_CONF=${MAKE_CONF} SRCCONF=${SRC_CONF}"
139ARCH_FLAGS="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}"
133if [ "x${TARGET}" != "x" ] && [ "x${TARGET_ARCH}" != "x" ]; then
134 ARCH_FLAGS="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}"
135else
136 ARCH_FLAGS=
137fi
140CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}"
141CHROOT_IMAKEFLAGS="${CONF_FILES}"
142CHROOT_DMAKEFLAGS="${CONF_FILES}"
143RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}"
144RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}"
145RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \
146 ${DOCPORTS}"
147

--- 12 unchanged lines hidden (view full) ---

160 echo "Needs to be run as root."
161 exit 1
162fi
163
164set -e # Everything must succeed
165
166mkdir -p ${CHROOTDIR}/usr
167
138CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}"
139CHROOT_IMAKEFLAGS="${CONF_FILES}"
140CHROOT_DMAKEFLAGS="${CONF_FILES}"
141RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}"
142RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}"
143RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \
144 ${DOCPORTS}"
145

--- 12 unchanged lines hidden (view full) ---

158 echo "Needs to be run as root."
159 exit 1
160fi
161
162set -e # Everything must succeed
163
164mkdir -p ${CHROOTDIR}/usr
165
168svn co ${FORCE_SRC_KEY} ${SVNROOT}/${SRCBRANCH} ${CHROOTDIR}/usr/src $SRCREVISION
166svn co ${FORCE_SRC_KEY} ${SVNROOT}/${SRCBRANCH} ${CHROOTDIR}/usr/src
169if [ "x${NODOC}" = "x" ]; then
167if [ "x${NODOC}" = "x" ]; then
170 svn co ${SVNROOT}/${DOCBRANCH} ${CHROOTDIR}/usr/doc $DOCREVISION
168 svn co ${SVNROOT}/${DOCBRANCH} ${CHROOTDIR}/usr/doc
171fi
172if [ "x${NOPORTS}" = "x" ]; then
169fi
170if [ "x${NOPORTS}" = "x" ]; then
173 svn co ${SVNROOT}/${PORTBRANCH} ${CHROOTDIR}/usr/ports $PORTREVISION
171 svn co ${SVNROOT}/${PORTBRANCH} ${CHROOTDIR}/usr/ports
174fi
175
176get_rev_branch
177
178cd ${CHROOTDIR}/usr/src
179make ${CHROOT_WMAKEFLAGS} buildworld
180make ${CHROOT_IMAKEFLAGS} installworld DESTDIR=${CHROOTDIR}
181make ${CHROOT_DMAKEFLAGS} distribution DESTDIR=${CHROOTDIR}

--- 44 unchanged lines hidden ---
172fi
173
174get_rev_branch
175
176cd ${CHROOTDIR}/usr/src
177make ${CHROOT_WMAKEFLAGS} buildworld
178make ${CHROOT_IMAKEFLAGS} installworld DESTDIR=${CHROOTDIR}
179make ${CHROOT_DMAKEFLAGS} distribution DESTDIR=${CHROOTDIR}

--- 44 unchanged lines hidden ---