1 |
6f73c362
|
Renato Botelho
|
#!/bin/sh
|
2 |
|
|
#
|
3 |
98a4b7a0
|
Renato Botelho
|
# builder_defaults.sh
|
4 |
6f73c362
|
Renato Botelho
|
#
|
5 |
8acd654a
|
Renato Botelho
|
# part of pfSense (https://www.pfsense.org)
|
6 |
2a2396a6
|
Renato Botelho
|
# Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
|
7 |
8acd654a
|
Renato Botelho
|
# All rights reserved.
|
8 |
6f73c362
|
Renato Botelho
|
#
|
9 |
|
|
# Redistribution and use in source and binary forms, with or without
|
10 |
|
|
# modification, are permitted provided that the following conditions are met:
|
11 |
|
|
#
|
12 |
|
|
# 1. Redistributions of source code must retain the above copyright notice,
|
13 |
|
|
# this list of conditions and the following disclaimer.
|
14 |
|
|
#
|
15 |
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
16 |
|
|
# notice, this list of conditions and the following disclaimer in
|
17 |
|
|
# the documentation and/or other materials provided with the
|
18 |
|
|
# distribution.
|
19 |
|
|
#
|
20 |
|
|
# 3. All advertising materials mentioning features or use of this software
|
21 |
|
|
# must display the following acknowledgment:
|
22 |
|
|
# "This product includes software developed by the pfSense Project
|
23 |
|
|
# for use in the pfSense® software distribution. (http://www.pfsense.org/).
|
24 |
|
|
#
|
25 |
|
|
# 4. The names "pfSense" and "pfSense Project" must not be used to
|
26 |
|
|
# endorse or promote products derived from this software without
|
27 |
|
|
# prior written permission. For written permission, please contact
|
28 |
|
|
# coreteam@pfsense.org.
|
29 |
|
|
#
|
30 |
|
|
# 5. Products derived from this software may not be called "pfSense"
|
31 |
|
|
# nor may "pfSense" appear in their names without prior written
|
32 |
|
|
# permission of the Electric Sheep Fencing, LLC.
|
33 |
|
|
#
|
34 |
|
|
# 6. Redistributions of any form whatsoever must retain the following
|
35 |
|
|
# acknowledgment:
|
36 |
|
|
#
|
37 |
|
|
# "This product includes software developed by the pfSense Project
|
38 |
|
|
# for use in the pfSense software distribution (http://www.pfsense.org/).
|
39 |
|
|
#
|
40 |
|
|
# THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
|
41 |
|
|
# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
42 |
|
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
43 |
|
|
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
|
44 |
|
|
# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
45 |
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
46 |
|
|
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
47 |
|
|
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
48 |
|
|
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
49 |
|
|
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
50 |
|
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
51 |
|
|
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
52 |
|
|
|
53 |
|
|
###########################################
|
54 |
|
|
# Product builder configuration file #
|
55 |
|
|
# Please don't modify this file, you #
|
56 |
|
|
# can put your settings and options #
|
57 |
|
|
# in build.conf, which is sourced at the #
|
58 |
|
|
# beginning of this file #
|
59 |
|
|
###########################################
|
60 |
|
|
|
61 |
f36b26f8
|
Renato Botelho
|
if [ -z "${BUILDER_ROOT}" ]; then
|
62 |
|
|
echo ">>> ERROR: BUILDER_ROOT must be defined by script that includes builder_defaults.sh"
|
63 |
|
|
exit 1
|
64 |
|
|
fi
|
65 |
|
|
|
66 |
77308bce
|
Renato Botelho
|
if [ ! -d "${BUILDER_ROOT}" ]; then
|
67 |
f36b26f8
|
Renato Botelho
|
echo ">>> ERROR: BUILDER_ROOT is invalid"
|
68 |
|
|
exit 1
|
69 |
|
|
fi
|
70 |
|
|
|
71 |
|
|
export BUILDER_TOOLS=${BUILDER_TOOLS:-"${BUILDER_ROOT}/tools"}
|
72 |
4a6ea7b2
|
Renato Botelho
|
|
73 |
77308bce
|
Renato Botelho
|
if [ ! -d "${BUILDER_TOOLS}" ]; then
|
74 |
f36b26f8
|
Renato Botelho
|
echo ">>> ERROR: BUILDER_TOOLS is invalid"
|
75 |
|
|
exit 1
|
76 |
4a6ea7b2
|
Renato Botelho
|
fi
|
77 |
|
|
|
78 |
78b0f246
|
Renato Botelho
|
BUILD_CONF="${BUILDER_ROOT}/build.conf"
|
79 |
6f73c362
|
Renato Botelho
|
|
80 |
|
|
# Ensure file exists
|
81 |
|
|
if [ -f ${BUILD_CONF} ]; then
|
82 |
|
|
. ${BUILD_CONF}
|
83 |
|
|
fi
|
84 |
|
|
|
85 |
|
|
# Make sure pkg will not be interactive
|
86 |
|
|
export ASSUME_ALWAYS_YES=true
|
87 |
|
|
|
88 |
97bc6c78
|
Phil Davis
|
# Architecture, supported ARCH values are:
|
89 |
6f73c362
|
Renato Botelho
|
# Tier 1: i386, AMD64, and PC98
|
90 |
|
|
# Tier 2: ARM, PowerPC, ia64, Sparc64 and sun4v
|
91 |
|
|
# Tier 3: MIPS and S/390
|
92 |
|
|
# Tier 4: None at the moment
|
93 |
|
|
# Source: http://www.freebsd.org/doc/en/articles/committers-guide/archs.html
|
94 |
|
|
export TARGET=${TARGET:-"`uname -m`"}
|
95 |
|
|
export TARGET_ARCH=${TARGET_ARCH:-${TARGET}}
|
96 |
|
|
# Set TARGET_ARCH_CONF_DIR
|
97 |
|
|
if [ "$TARGET_ARCH" = "" ]; then
|
98 |
|
|
export TARGET_ARCH=`uname -p`
|
99 |
|
|
fi
|
100 |
|
|
|
101 |
934e3e04
|
Renato Botelho
|
# Directory to be used for writing temporary information
|
102 |
|
|
export SCRATCHDIR=${SCRATCHDIR:-"${BUILDER_ROOT}/tmp"}
|
103 |
|
|
if [ ! -d ${SCRATCHDIR} ]; then
|
104 |
|
|
mkdir -p ${SCRATCHDIR}
|
105 |
|
|
fi
|
106 |
6f73c362
|
Renato Botelho
|
|
107 |
|
|
# Product details
|
108 |
46f33ce5
|
Renato Botelho
|
export PRODUCT_NAME=${PRODUCT_NAME:-"nonSense"}
|
109 |
029098fe
|
Renato Botelho
|
export PRODUCT_NAME_SUFFIX=${PRODUCT_NAME_SUFFIX:-"-CE"}
|
110 |
774b0d82
|
Renato Botelho
|
export PRODUCT_URL=${PRODUCT_URL:-""}
|
111 |
694028d6
|
Renato Botelho
|
export PRODUCT_SRC=${PRODUCT_SRC:-"${BUILDER_ROOT}/src"}
|
112 |
a3bb036b
|
Renato Botelho
|
export PRODUCT_EMAIL=${PRODUCT_EMAIL:-"coreteam@pfsense.org"}
|
113 |
2f6260c5
|
Renato Botelho
|
export XML_ROOTOBJ=${XML_ROOTOBJ:-$(echo "${PRODUCT_NAME}" | tr '[[:upper:]]' '[[:lower:]]')}
|
114 |
6f73c362
|
Renato Botelho
|
|
115 |
2a2396a6
|
Renato Botelho
|
if [ "${PRODUCT_NAME}" = "pfSense" -a "${BUILD_AUTHORIZED_BY_NETGATE}" != "yes" ]; then
|
116 |
|
|
echo ">>>ERROR: According the following license, only Netgate can build genuine pfSense® software"
|
117 |
46f33ce5
|
Renato Botelho
|
echo ""
|
118 |
|
|
cat ${BUILDER_ROOT}/license.txt
|
119 |
|
|
exit 1
|
120 |
|
|
fi
|
121 |
|
|
|
122 |
eb31cdf1
|
Renato Botelho
|
if [ -z "${PRODUCT_VERSION}" ]; then
|
123 |
|
|
if [ ! -f ${PRODUCT_SRC}/etc/version ]; then
|
124 |
|
|
echo ">>> ERROR: PRODUCT_VERSION is not defined and ${PRODUCT_SRC}/etc/version was not found"
|
125 |
|
|
print_error_pfS
|
126 |
|
|
fi
|
127 |
|
|
|
128 |
|
|
export PRODUCT_VERSION=$(head -n 1 ${PRODUCT_SRC}/etc/version)
|
129 |
|
|
fi
|
130 |
69c97748
|
Renato Botelho
|
export PRODUCT_REVISION=${PRODUCT_REVISION:-""}
|
131 |
eb31cdf1
|
Renato Botelho
|
|
132 |
6f73c362
|
Renato Botelho
|
# Product repository tag to build
|
133 |
1b0a9747
|
Renato Botelho
|
_cur_git_repo_branch_or_tag=$(git -C ${BUILDER_ROOT} rev-parse --abbrev-ref HEAD)
|
134 |
d111360d
|
Renato Botelho
|
if [ "${_cur_git_repo_branch_or_tag}" = "HEAD" ]; then
|
135 |
|
|
# We are on a tag, lets find out its name
|
136 |
|
|
export GIT_REPO_BRANCH_OR_TAG=$(git -C ${BUILDER_ROOT} describe --tags)
|
137 |
|
|
else
|
138 |
|
|
export GIT_REPO_BRANCH_OR_TAG="${_cur_git_repo_branch_or_tag}"
|
139 |
|
|
fi
|
140 |
7761dab5
|
Renato Botelho
|
# Use vX_Y instead of RELENG_X_Y for poudriere to make it shorter
|
141 |
defa7cab
|
Renato Botelho
|
# Replace . by _ to make tag names look correct
|
142 |
|
|
POUDRIERE_BRANCH=$(echo "${GIT_REPO_BRANCH_OR_TAG}" | sed 's,RELENG_,v,; s,\.,_,g')
|
143 |
6f73c362
|
Renato Botelho
|
|
144 |
0a75e428
|
Renato Botelho
|
GIT_REPO_BASE=$(git -C ${BUILDER_ROOT} config --get remote.origin.url | sed -e 's,/[^/]*$,,')
|
145 |
04efa936
|
Renato Botelho
|
|
146 |
934e3e04
|
Renato Botelho
|
# This is used for using svn for retrieving src
|
147 |
04efa936
|
Renato Botelho
|
export FREEBSD_REPO_BASE=${FREEBSD_REPO_BASE:-"${GIT_REPO_BASE}/freebsd-src.git"}
|
148 |
db2a45da
|
Renato Botelho
|
export FREEBSD_BRANCH=${FREEBSD_BRANCH:-"RELENG_2_3_4"}
|
149 |
fd466a86
|
Renato Botelho
|
export FREEBSD_PARENT_BRANCH=${FREEBSD_PARENT_BRANCH:-"releng/10.3"}
|
150 |
934e3e04
|
Renato Botelho
|
export FREEBSD_SRC_DIR=${FREEBSD_SRC_DIR:-"${SCRATCHDIR}/FreeBSD-src"}
|
151 |
|
|
|
152 |
|
|
if [ "${TARGET}" = "i386" ]; then
|
153 |
afbac7f3
|
Renato Botelho
|
export BUILD_KERNELS=${BUILD_KERNELS:-"${PRODUCT_NAME} ${PRODUCT_NAME}_wrap ${PRODUCT_NAME}_wrap_vga"}
|
154 |
934e3e04
|
Renato Botelho
|
else
|
155 |
|
|
export BUILD_KERNELS=${BUILD_KERNELS:-"${PRODUCT_NAME}"}
|
156 |
|
|
fi
|
157 |
|
|
|
158 |
|
|
# Leave this alone.
|
159 |
|
|
export SRC_CONF=${SRC_CONF:-"${FREEBSD_SRC_DIR}/release/conf/${PRODUCT_NAME}_src.conf"}
|
160 |
|
|
export MAKE_CONF=${MAKE_CONF:-"${FREEBSD_SRC_DIR}/release/conf/${PRODUCT_NAME}_make.conf"}
|
161 |
|
|
|
162 |
|
|
# Extra tools to be added to ITOOLS
|
163 |
|
|
export EXTRA_TOOLS=${EXTRA_TOOLS:-"uuencode uudecode ex"}
|
164 |
|
|
|
165 |
|
|
# Path to kernel files being built
|
166 |
|
|
export KERNEL_BUILD_PATH=${KERNEL_BUILD_PATH:-"${SCRATCHDIR}/kernels"}
|
167 |
|
|
|
168 |
3236b6f4
|
Renato Botelho
|
# Do not touch builder /usr/obj
|
169 |
|
|
export MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX:-"${SCRATCHDIR}/obj"}
|
170 |
|
|
|
171 |
934e3e04
|
Renato Botelho
|
# Controls how many concurrent make processes are run for each stage
|
172 |
1b0a9747
|
Renato Botelho
|
_CPUS=""
|
173 |
934e3e04
|
Renato Botelho
|
if [ -z "${NO_MAKEJ}" ]; then
|
174 |
|
|
_CPUS=$(expr $(sysctl -n kern.smp.cpus) '*' 2)
|
175 |
|
|
if [ -n "${_CPUS}" ]; then
|
176 |
|
|
_CPUS="-j${_CPUS}"
|
177 |
|
|
fi
|
178 |
|
|
fi
|
179 |
|
|
|
180 |
|
|
export MAKEJ_WORLD=${MAKEJ_WORLD:-"${_CPUS}"}
|
181 |
|
|
export MAKEJ_KERNEL=${MAKEJ_KERNEL:-"${_CPUS}"}
|
182 |
|
|
|
183 |
|
|
if [ "${TARGET}" = "i386" ]; then
|
184 |
|
|
export MODULES_OVERRIDE=${MODULES_OVERRIDE:-"i2c ipmi ndis ipfw ipdivert dummynet fdescfs opensolaris zfs glxsb if_stf coretemp amdtemp hwpmc"}
|
185 |
|
|
else
|
186 |
f82c7c88
|
Luiz Otavio O Souza
|
export MODULES_OVERRIDE=${MODULES_OVERRIDE:-"i2c ipmi ndis ipfw ipdivert dummynet fdescfs opensolaris zfs glxsb if_stf coretemp amdtemp aesni sfxge hwpmc vmm nmdm ixgbe"}
|
187 |
78b0f246
|
Renato Botelho
|
fi
|
188 |
6f73c362
|
Renato Botelho
|
|
189 |
7b774647
|
Renato Botelho
|
# gnid
|
190 |
b1b55221
|
Renato Botelho
|
export GNID_REPO_BASE=${GNID_REPO_BASE:-"${GIT_REPO_BASE}/gnid.git"}
|
191 |
7b774647
|
Renato Botelho
|
export GNID_SRC_DIR=${GNID_SRC_DIR:-"${SCRATCHDIR}/gnid"}
|
192 |
|
|
export GNID_BRANCH=${GNID_BRANCH:-"master"}
|
193 |
877b284d
|
Renato Botelho
|
export GNID_INCLUDE_DIR=${GNID_INCLUDE_DIR:-"${MAKEOBJDIRPREFIX}/${FREEBSD_SRC_DIR}/tmp/usr/include"}
|
194 |
|
|
export GNID_LIBCRYPTO_DIR=${GNID_LIBCRYPTO_DIR:-"${MAKEOBJDIRPREFIX}/${FREEBSD_SRC_DIR}/secure/lib/libcrypto"}
|
195 |
7b774647
|
Renato Botelho
|
|
196 |
6f73c362
|
Renato Botelho
|
# Area that the final image will appear in
|
197 |
84331fdc
|
Renato Botelho
|
export IMAGES_FINAL_DIR=${IMAGES_FINAL_DIR:-"${SCRATCHDIR}/${PRODUCT_NAME}/"}
|
198 |
6f73c362
|
Renato Botelho
|
|
199 |
84331fdc
|
Renato Botelho
|
export BUILDER_LOGS=${BUILDER_LOGS:-"${BUILDER_ROOT}/logs"}
|
200 |
6f73c362
|
Renato Botelho
|
if [ ! -d ${BUILDER_LOGS} ]; then
|
201 |
|
|
mkdir -p ${BUILDER_LOGS}
|
202 |
|
|
fi
|
203 |
|
|
|
204 |
|
|
# This is where files will be staged
|
205 |
328c4fb9
|
Renato Botelho
|
export STAGE_CHROOT_DIR=${STAGE_CHROOT_DIR:-"${SCRATCHDIR}/stage-dir"}
|
206 |
|
|
|
207 |
|
|
# Directory that will clone to in order to create
|
208 |
|
|
# iso staging area.
|
209 |
|
|
export FINAL_CHROOT_DIR=${FINAL_CHROOT_DIR:-"${SCRATCHDIR}/final-dir"}
|
210 |
6f73c362
|
Renato Botelho
|
|
211 |
|
|
# 400M is not enough for amd64
|
212 |
1e70041e
|
Renato Botelho
|
export MEMORYDISK_SIZE=${MEMORYDISK_SIZE:-"1024M"}
|
213 |
6f73c362
|
Renato Botelho
|
|
214 |
|
|
# OVF/vmdk parms
|
215 |
|
|
# Name of ovf file included inside OVA archive
|
216 |
173fa93f
|
Renato Botelho
|
export OVFTEMPLATE=${OVFTEMPLATE:-"${BUILDER_TOOLS}/templates/ovf/${PRODUCT_NAME}.ovf"}
|
217 |
89a72b59
|
Renato Botelho
|
# / partition to be used by mkimg
|
218 |
f2d83cfb
|
Renato Botelho
|
export OVFUFS=${OVFUFS:-"${PRODUCT_NAME}${PRODUCT_NAME_SUFFIX}-disk1.ufs"}
|
219 |
679b5a66
|
Renato Botelho
|
# Raw disk to be converted to vmdk
|
220 |
f2d83cfb
|
Renato Botelho
|
export OVFRAW=${OVFRAW:-"${PRODUCT_NAME}${PRODUCT_NAME_SUFFIX}-disk1.raw"}
|
221 |
6f73c362
|
Renato Botelho
|
# On disk name of VMDK file included in OVA
|
222 |
f2d83cfb
|
Renato Botelho
|
export OVFVMDK=${OVFVMDK:-"${PRODUCT_NAME}${PRODUCT_NAME_SUFFIX}-disk1.vmdk"}
|
223 |
502db0bd
|
Renato Botelho
|
# 8 gigabyte on disk VMDK size
|
224 |
|
|
export VMDK_DISK_CAPACITY_IN_GB=${VMDK_DISK_CAPACITY_IN_GB:-"8"}
|
225 |
|
|
# swap partition size (freebsd-swap)
|
226 |
5213dbb8
|
Renato Botelho
|
export OVA_SWAP_PART_SIZE_IN_GB=${OVA_SWAP_PART_SIZE_IN_GB:-"0"}
|
227 |
89a72b59
|
Renato Botelho
|
# Temporary place to save files
|
228 |
|
|
export OVA_TMP=${OVA_TMP:-"${SCRATCHDIR}/ova_tmp"}
|
229 |
6f73c362
|
Renato Botelho
|
# end of OVF
|
230 |
|
|
|
231 |
|
|
# Number of code images on media (1 or 2)
|
232 |
|
|
export NANO_IMAGES=2
|
233 |
|
|
# 0 -> Leave second image all zeroes so it compresses better.
|
234 |
|
|
# 1 -> Initialize second image with a copy of the first
|
235 |
|
|
export NANO_INIT_IMG2=1
|
236 |
|
|
export NANO_NEWFS="-b 4096 -f 512 -i 8192 -O1"
|
237 |
7d9c553c
|
Renato Botelho
|
export FLASH_SIZE=${FLASH_SIZE:-"2g"}
|
238 |
6f73c362
|
Renato Botelho
|
# Size of code file system in 512 bytes sectors
|
239 |
|
|
# If zero, size will be as large as possible.
|
240 |
|
|
export NANO_CODESIZE=0
|
241 |
|
|
# Size of data file system in 512 bytes sectors
|
242 |
|
|
# If zero: no partition configured.
|
243 |
|
|
# If negative: max size possible
|
244 |
|
|
export NANO_DATASIZE=0
|
245 |
|
|
# Size of Product /conf partition # 102400 = 50 megabytes.
|
246 |
|
|
export NANO_CONFSIZE=102400
|
247 |
|
|
# packet is OK for 90% of embedded
|
248 |
|
|
export NANO_BOOT0CFG="-o packet -s 1 -m 3"
|
249 |
|
|
|
250 |
|
|
# NOTE: Date string is used for creating file names of images
|
251 |
|
|
# The file is used for sharing the same value with build_snapshots.sh
|
252 |
84331fdc
|
Renato Botelho
|
export DATESTRINGFILE=${DATESTRINGFILE:-"$SCRATCHDIR/version.snapshots"}
|
253 |
6329e1eb
|
Renato Botelho
|
if [ -z "${DATESTRING}" ]; then
|
254 |
|
|
if [ -f "${DATESTRINGFILE}" -a -n "${_USE_OLD_DATESTRING}" ]; then
|
255 |
|
|
export DATESTRING=$(cat $DATESTRINGFILE)
|
256 |
6f73c362
|
Renato Botelho
|
else
|
257 |
cf31d8ae
|
Renato Botelho
|
export DATESTRING=$(date "+%Y%m%d-%H%M")
|
258 |
6f73c362
|
Renato Botelho
|
fi
|
259 |
|
|
fi
|
260 |
6329e1eb
|
Renato Botelho
|
echo "$DATESTRING" > $DATESTRINGFILE
|
261 |
6f73c362
|
Renato Botelho
|
|
262 |
|
|
# NOTE: Date string is placed on the final image etc folder to help detect new updates
|
263 |
|
|
# The file is used for sharing the same value with build_snapshots.sh
|
264 |
84331fdc
|
Renato Botelho
|
export BUILTDATESTRINGFILE=${BUILTDATESTRINGFILE:-"$SCRATCHDIR/version.buildtime"}
|
265 |
6329e1eb
|
Renato Botelho
|
if [ -z "${BUILTDATESTRING}" ]; then
|
266 |
|
|
if [ -f "${BUILTDATESTRINGFILE}" -a -n "${_USE_OLD_DATESTRING}" ]; then
|
267 |
|
|
export BUILTDATESTRING=$(cat $BUILTDATESTRINGFILE)
|
268 |
6f73c362
|
Renato Botelho
|
else
|
269 |
6329e1eb
|
Renato Botelho
|
export BUILTDATESTRING=$(date "+%a %b %d %T %Z %Y")
|
270 |
6f73c362
|
Renato Botelho
|
fi
|
271 |
|
|
fi
|
272 |
6329e1eb
|
Renato Botelho
|
echo "$BUILTDATESTRING" > $BUILTDATESTRINGFILE
|
273 |
6f73c362
|
Renato Botelho
|
|
274 |
006cc4ca
|
Renato Botelho
|
STAGING_HOSTNAME=${STAGING_HOSTNAME:-"release-staging.netgate.com"}
|
275 |
|
|
|
276 |
934e3e04
|
Renato Botelho
|
# Poudriere
|
277 |
512ef80d
|
Renato Botelho
|
export ZFS_TANK=${ZFS_TANK:-"zroot"}
|
278 |
934e3e04
|
Renato Botelho
|
export ZFS_ROOT=${ZFS_ROOT:-"/poudriere"}
|
279 |
7761dab5
|
Renato Botelho
|
export POUDRIERE_PORTS_NAME=${POUDRIERE_PORTS_NAME:-"${PRODUCT_NAME}_${POUDRIERE_BRANCH}"}
|
280 |
934e3e04
|
Renato Botelho
|
|
281 |
|
|
export POUDRIERE_BULK=${POUDRIERE_BULK:-"${BUILDER_TOOLS}/conf/pfPorts/poudriere_bulk"}
|
282 |
04efa936
|
Renato Botelho
|
export POUDRIERE_PORTS_GIT_URL=${POUDRIERE_PORTS_GIT_URL:-"${GIT_REPO_BASE}/freebsd-ports.git"}
|
283 |
db2a45da
|
Renato Botelho
|
export POUDRIERE_PORTS_GIT_BRANCH=${POUDRIERE_PORTS_GIT_BRANCH:-"RELENG_2_3_4"}
|
284 |
934e3e04
|
Renato Botelho
|
|
285 |
5fcc717d
|
Renato Botelho
|
unset _IS_RELEASE
|
286 |
26f2e751
|
Renato Botelho
|
unset _IS_RC
|
287 |
5fcc717d
|
Renato Botelho
|
unset CORE_PKG_DATESTRING
|
288 |
|
|
export TIMESTAMP_SUFFIX="-${DATESTRING}"
|
289 |
|
|
# pkg doesn't like - as version separator, use . instead
|
290 |
|
|
export PKG_DATESTRING=$(echo "${DATESTRING}" | sed 's,-,.,g')
|
291 |
|
|
case "${PRODUCT_VERSION##*-}" in
|
292 |
|
|
RELEASE)
|
293 |
|
|
export _IS_RELEASE=yes
|
294 |
|
|
unset TIMESTAMP_SUFFIX
|
295 |
|
|
;;
|
296 |
|
|
ALPHA|DEVELOPMENT)
|
297 |
|
|
export CORE_PKG_DATESTRING=".a.${PKG_DATESTRING}"
|
298 |
|
|
;;
|
299 |
c96b2242
|
Renato Botelho
|
BETA*)
|
300 |
5fcc717d
|
Renato Botelho
|
export CORE_PKG_DATESTRING=".b.${PKG_DATESTRING}"
|
301 |
|
|
;;
|
302 |
c96b2242
|
Renato Botelho
|
RC*)
|
303 |
26f2e751
|
Renato Botelho
|
export _IS_RC=yes
|
304 |
5fcc717d
|
Renato Botelho
|
export CORE_PKG_DATESTRING=".r.${PKG_DATESTRING}"
|
305 |
|
|
;;
|
306 |
|
|
*)
|
307 |
|
|
echo ">>> ERROR: Invalid PRODUCT_VERSION format ${PRODUCT_VERSION}"
|
308 |
|
|
exit 1
|
309 |
|
|
esac
|
310 |
f48a09c7
|
Renato Botelho
|
|
311 |
347ee9e3
|
Renato Botelho
|
# Host to rsync pkg repos from poudriere
|
312 |
|
|
export PKG_RSYNC_HOSTNAME=${PKG_RSYNC_HOSTNAME:-${STAGING_HOSTNAME}}
|
313 |
|
|
export PKG_RSYNC_USERNAME=${PKG_RSYNC_USERNAME:-"wwwsync"}
|
314 |
|
|
export PKG_RSYNC_SSH_PORT=${PKG_RSYNC_SSH_PORT:-"22"}
|
315 |
|
|
export PKG_RSYNC_DESTDIR=${PKG_RSYNC_DESTDIR:-"/staging/ce/packages"}
|
316 |
|
|
export PKG_RSYNC_LOGS=${PKG_RSYNC_LOGS:-"/staging/ce/packages/logs/${POUDRIERE_BRANCH}/${TARGET}"}
|
317 |
|
|
|
318 |
|
|
# Final packages server
|
319 |
|
|
if [ -n "${_IS_RELEASE}" ]; then
|
320 |
ed51f518
|
Renato Botelho
|
export PKG_FINAL_RSYNC_HOSTNAME=${PKG_FINAL_RSYNC_HOSTNAME:-"nfs1.nyi.netgate.com"}
|
321 |
|
|
export PKG_FINAL_RSYNC_DESTDIR=${PKG_FINAL_RSYNC_DESTDIR:-"/storage/files/pkg"}
|
322 |
347ee9e3
|
Renato Botelho
|
else
|
323 |
|
|
export PKG_FINAL_RSYNC_HOSTNAME=${PKG_FINAL_RSYNC_HOSTNAME:-"beta.pfsense.org"}
|
324 |
|
|
export PKG_FINAL_RSYNC_DESTDIR=${PKG_FINAL_RSYNC_DESTDIR:-"/usr/local/www/beta/packages"}
|
325 |
|
|
fi
|
326 |
|
|
export PKG_FINAL_RSYNC_USERNAME=${PKG_FINAL_RSYNC_USERNAME:-"wwwsync"}
|
327 |
|
|
export PKG_FINAL_RSYNC_SSH_PORT=${PKG_FINAL_RSYNC_SSH_PORT:-"22"}
|
328 |
|
|
export SKIP_FINAL_RSYNC=${SKIP_FINAL_RSYNC:-}
|
329 |
|
|
|
330 |
7ffef0a2
|
Renato Botelho
|
# pkg repo variables
|
331 |
16538775
|
Renato Botelho
|
export USE_PKG_REPO_STAGING="1"
|
332 |
f2c8058a
|
Renato Botelho
|
export PKG_REPO_SERVER_DEVEL=${PKG_REPO_SERVER_DEVEL:-"pkg+https://beta.pfsense.org/packages"}
|
333 |
|
|
export PKG_REPO_SERVER_RELEASE=${PKG_REPO_SERVER_RELEASE:-"pkg+https://pkg.pfsense.org"}
|
334 |
006cc4ca
|
Renato Botelho
|
export PKG_REPO_SERVER_STAGING=${PKG_REPO_SERVER_STAGING:-"pkg+http://${STAGING_HOSTNAME}/ce/packages"}
|
335 |
7ffef0a2
|
Renato Botelho
|
|
336 |
26f2e751
|
Renato Botelho
|
if [ -n "${_IS_RELEASE}" -o -n "${_IS_RC}" ]; then
|
337 |
7ffef0a2
|
Renato Botelho
|
export PKG_REPO_BRANCH_RELEASE=${PKG_REPO_BRANCH_RELEASE:-${POUDRIERE_BRANCH}}
|
338 |
|
|
export PKG_REPO_BRANCH_DEVEL=${PKG_REPO_BRANCH_DEVEL:-"v2_3"}
|
339 |
8b1323aa
|
Renato Botelho
|
export PKG_REPO_BRANCH_STAGING=${PKG_REPO_BRANCH_STAGING:-${PKG_REPO_BRANCH_RELEASE}}
|
340 |
c43216c4
|
Renato Botelho
|
else
|
341 |
db2a45da
|
Renato Botelho
|
export PKG_REPO_BRANCH_RELEASE=${PKG_REPO_BRANCH_RELEASE:-"v2_3_4"}
|
342 |
7ffef0a2
|
Renato Botelho
|
export PKG_REPO_BRANCH_DEVEL=${PKG_REPO_BRANCH_DEVEL:-${POUDRIERE_BRANCH}}
|
343 |
8b1323aa
|
Renato Botelho
|
export PKG_REPO_BRANCH_STAGING=${PKG_REPO_BRANCH_STAGING:-${PKG_REPO_BRANCH_DEVEL}}
|
344 |
c43216c4
|
Renato Botelho
|
fi
|
345 |
|
|
|
346 |
66f469df
|
Renato Botelho
|
if [ -n "${_IS_RELEASE}" ]; then
|
347 |
|
|
export PKG_REPO_SIGN_KEY=${PKG_REPO_SIGN_KEY:-"release${PRODUCT_NAME_SUFFIX}"}
|
348 |
|
|
else
|
349 |
|
|
export PKG_REPO_SIGN_KEY=${PKG_REPO_SIGN_KEY:-"beta${PRODUCT_NAME_SUFFIX}"}
|
350 |
|
|
fi
|
351 |
7ffef0a2
|
Renato Botelho
|
# Command used to sign pkg repo
|
352 |
66f469df
|
Renato Botelho
|
export PKG_REPO_SIGNING_COMMAND=${PKG_REPO_SIGNING_COMMAND:-"ssh sign@codesigner.netgate.com sudo ./sign.sh ${PKG_REPO_SIGN_KEY}"}
|
353 |
e366c806
|
Renato Botelho
|
export DO_NOT_SIGN_PKG_REPO=${DO_NOT_SIGN_PKG_REPO:-}
|
354 |
7ffef0a2
|
Renato Botelho
|
|
355 |
6f73c362
|
Renato Botelho
|
# Define base package version, based on date for snaps
|
356 |
69c97748
|
Renato Botelho
|
export CORE_PKG_VERSION="${PRODUCT_VERSION%%-*}${CORE_PKG_DATESTRING}${PRODUCT_REVISION:+_}${PRODUCT_REVISION}"
|
357 |
7761dab5
|
Renato Botelho
|
export CORE_PKG_PATH=${CORE_PKG_PATH:-"${SCRATCHDIR}/${PRODUCT_NAME}_${POUDRIERE_BRANCH}_${TARGET_ARCH}-core"}
|
358 |
1eb4344e
|
Renato Botelho
|
export CORE_PKG_REAL_PATH="${CORE_PKG_PATH}/.real_${DATESTRING}"
|
359 |
efd95df7
|
Renato Botelho
|
export CORE_PKG_ALL_PATH="${CORE_PKG_PATH}/All"
|
360 |
6f73c362
|
Renato Botelho
|
export CORE_PKG_TMP=${CORE_PKG_TMP:-"${SCRATCHDIR}/core_pkg_tmp"}
|
361 |
|
|
|
362 |
3c2b0a83
|
Renato Botelho
|
export PKG_REPO_BASE=${PKG_REPO_BASE:-"${BUILDER_TOOLS}/templates/pkg_repos"}
|
363 |
a90f1c9b
|
Renato Botelho
|
export PKG_REPO_DEFAULT=${PKG_REPO_DEFAULT:-"${PKG_REPO_BASE}/${PRODUCT_NAME}-repo.conf"}
|
364 |
52efc840
|
Renato Botelho
|
export PKG_REPO_PATH=${PKG_REPO_PATH:-"/usr/local/etc/pkg/repos/${PRODUCT_NAME}.conf"}
|
365 |
|
|
|
366 |
651f440c
|
Renato Botelho
|
export PRODUCT_SHARE_DIR=${PRODUCT_SHARE_DIR:-"/usr/local/share/${PRODUCT_NAME}"}
|
367 |
|
|
|
368 |
934e3e04
|
Renato Botelho
|
# Package overlay. This gives people a chance to build product
|
369 |
|
|
# installable image that already contains certain extra packages.
|
370 |
|
|
#
|
371 |
|
|
# Needs to contain comma separated package names. Of course
|
372 |
|
|
# package names must be valid. Using non existent
|
373 |
|
|
# package name would yield an error.
|
374 |
|
|
#
|
375 |
|
|
#export custom_package_list=""
|
376 |
|
|
|
377 |
6f73c362
|
Renato Botelho
|
# General builder output filenames
|
378 |
84331fdc
|
Renato Botelho
|
export UPDATESDIR=${UPDATESDIR:-"${IMAGES_FINAL_DIR}/updates"}
|
379 |
5b7cc4e2
|
Renato Botelho
|
export ISOPATH=${ISOPATH:-"${IMAGES_FINAL_DIR}/${PRODUCT_NAME}${PRODUCT_NAME_SUFFIX}-${PRODUCT_VERSION}${PRODUCT_REVISION:+-p}${PRODUCT_REVISION}-${TARGET}${TIMESTAMP_SUFFIX}.iso"}
|
380 |
|
|
export MEMSTICKPATH=${MEMSTICKPATH:-"${IMAGES_FINAL_DIR}/${PRODUCT_NAME}${PRODUCT_NAME_SUFFIX}-memstick-${PRODUCT_VERSION}${PRODUCT_REVISION:+-p}${PRODUCT_REVISION}-${TARGET}${TIMESTAMP_SUFFIX}.img"}
|
381 |
|
|
export MEMSTICKSERIALPATH=${MEMSTICKSERIALPATH:-"${IMAGES_FINAL_DIR}/${PRODUCT_NAME}${PRODUCT_NAME_SUFFIX}-memstick-serial-${PRODUCT_VERSION}${PRODUCT_REVISION:+-p}${PRODUCT_REVISION}-${TARGET}${TIMESTAMP_SUFFIX}.img"}
|
382 |
|
|
export MEMSTICKADIPATH=${MEMSTICKADIPATH:-"${IMAGES_FINAL_DIR}/${PRODUCT_NAME}${PRODUCT_NAME_SUFFIX}-memstick-ADI-${PRODUCT_VERSION}${PRODUCT_REVISION:+-p}${PRODUCT_REVISION}-${TARGET}${TIMESTAMP_SUFFIX}.img"}
|
383 |
|
|
export OVAPATH=${OVAPATH:-"${IMAGES_FINAL_DIR}/${PRODUCT_NAME}${PRODUCT_NAME_SUFFIX}-${PRODUCT_VERSION}${PRODUCT_REVISION:+-p}${PRODUCT_REVISION}-${TARGET}${TIMESTAMP_SUFFIX}.ova"}
|
384 |
39cc232b
|
Renato Botelho
|
export MEMSTICK_VARIANTS=${MEMSTICK_VARIANTS:-}
|
385 |
|
|
export VARIANTIMAGES=""
|
386 |
|
|
export VARIANTUPDATES=""
|
387 |
6f73c362
|
Renato Botelho
|
|
388 |
|
|
# set full-update update filename
|
389 |
5b7cc4e2
|
Renato Botelho
|
export UPDATES_TARBALL_FILENAME=${UPDATES_TARBALL_FILENAME:-"${UPDATESDIR}/${PRODUCT_NAME}${PRODUCT_NAME_SUFFIX}-Full-Update-${PRODUCT_VERSION}${PRODUCT_REVISION:+-p}${PRODUCT_REVISION}-${TARGET}${TIMESTAMP_SUFFIX}.tgz"}
|
390 |
a95458c2
|
Renato Botelho
|
|
391 |
acd5c0cd
|
Renato Botelho
|
# nanobsd templates
|
392 |
5b7cc4e2
|
Renato Botelho
|
export NANOBSD_IMG_TEMPLATE=${NANOBSD_IMG_TEMPLATE:-"${PRODUCT_NAME}${PRODUCT_NAME_SUFFIX}-${PRODUCT_VERSION}${PRODUCT_REVISION:+-p}${PRODUCT_REVISION}-%%SIZE%%-${TARGET}-%%TYPE%%${TIMESTAMP_SUFFIX}.img"}
|
393 |
|
|
export NANOBSD_UPGRADE_TEMPLATE=${NANOBSD_UPGRADE_TEMPLATE:-"${PRODUCT_NAME}${PRODUCT_NAME_SUFFIX}-${PRODUCT_VERSION}${PRODUCT_REVISION:+-p}${PRODUCT_REVISION}-%%SIZE%%-${TARGET}-%%TYPE%%-upgrade${TIMESTAMP_SUFFIX}.img"}
|
394 |
acd5c0cd
|
Renato Botelho
|
|
395 |
a95458c2
|
Renato Botelho
|
# Rsync data to send snapshots
|
396 |
|
|
export RSYNCUSER=${RSYNCUSER:-"snapshots"}
|
397 |
|
|
export RSYNCPATH=${RSYNCPATH:-"/usr/local/www/snapshots/${TARGET}/${PRODUCT_NAME}_${GIT_REPO_BRANCH_OR_TAG}"}
|
398 |
ab943fc9
|
Renato Botelho
|
|
399 |
|
|
# staging area used on snapshots build
|
400 |
|
|
STAGINGAREA=${STAGINGAREA:-"${SCRATCHDIR}/staging"}
|
401 |
|
|
mkdir -p ${STAGINGAREA}
|
402 |
|
|
|
403 |
|
|
export SNAPSHOTSLOGFILE=${SNAPSHOTSLOGFILE:-"${SCRATCHDIR}/snapshots-build.log"}
|
404 |
|
|
export SNAPSHOTSLASTUPDATE=${SNAPSHOTSLASTUPDATE:-"${SCRATCHDIR}/snapshots-lastupdate.log"}
|
405 |
919c8486
|
Renato Botelho
|
|
406 |
|
|
if [ -n "${POUDRIERE_SNAPSHOTS}" ]; then
|
407 |
|
|
export SNAPSHOTS_RSYNCIP=${PKG_RSYNC_HOSTNAME}
|
408 |
|
|
export SNAPSHOTS_RSYNCUSER=${PKG_RSYNC_USERNAME}
|
409 |
|
|
else
|
410 |
|
|
export SNAPSHOTS_RSYNCIP=${RSYNCIP}
|
411 |
|
|
export SNAPSHOTS_RSYNCUSER=${RSYNCUSER}
|
412 |
|
|
fi
|
413 |
adf82769
|
Renato Botelho
|
|
414 |
|
|
if [ "${PRODUCT_NAME}" = "pfSense" ]; then
|
415 |
2a2396a6
|
Renato Botelho
|
export VENDOR_NAME=${VENDOR_NAME:-"Rubicon Communications, LLC (Netgate)"}
|
416 |
adf82769
|
Renato Botelho
|
export OVF_INFO=${OVF_INFO:-"pfSense is a free, open source customized distribution of FreeBSD tailored for use as a firewall and router. In addition to being a powerful, flexible firewalling and routing platform, it includes a long list of related features and a package system allowing further expandability without adding bloat and potential security vulnerabilities to the base distribution. pfSense is a popular project with more than 1 million downloads since its inception, and proven in countless installations ranging from small home networks protecting a PC and an Xbox to large corporations, universities and other organizations protecting thousands of network devices."}
|
417 |
|
|
else
|
418 |
|
|
export VENDOR_NAME=${VENDOR_NAME:-"nonSense"}
|
419 |
|
|
export OVF_INFO=${OVF_INFO:-"none"}
|
420 |
|
|
fi
|