Deleted Added
sdiff udiff text old ( 252846 ) new ( 254293 )
full compact
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 $
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"
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.
65WORLD_FLAGS="-j$(sysctl -n hw.ncpu)"
66KERNEL_FLAGS="-j$(expr $(sysctl -n hw.ncpu) / 2)"
67MAKE_FLAGS="-s"
68
69# The name of the kernel to build, defaults to GENERIC.
70KERNEL="GENERIC"
71
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}"
139ARCH_FLAGS="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}"
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
168svn co ${FORCE_SRC_KEY} ${SVNROOT}/${SRCBRANCH} ${CHROOTDIR}/usr/src $SRCREVISION
169if [ "x${NODOC}" = "x" ]; then
170 svn co ${SVNROOT}/${DOCBRANCH} ${CHROOTDIR}/usr/doc $DOCREVISION
171fi
172if [ "x${NOPORTS}" = "x" ]; then
173 svn co ${SVNROOT}/${PORTBRANCH} ${CHROOTDIR}/usr/ports $PORTREVISION
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 ---