1
|
#!/bin/sh
|
2
|
|
3
|
###########################################
|
4
|
# pfSense builder configuration file #
|
5
|
# Please don't modify this file, you #
|
6
|
# can put your settings and options #
|
7
|
# in pfsense-build.conf, which is #
|
8
|
# sourced at the beginning of this file #
|
9
|
###########################################
|
10
|
|
11
|
export BUILD_CONF=./pfsense-build.conf
|
12
|
|
13
|
# Ensure file exists
|
14
|
if [ -f ${BUILD_CONF} ]; then
|
15
|
. ${BUILD_CONF}
|
16
|
elif [ -f ../${BUILD_CONF} ]; then
|
17
|
. ../${BUILD_CONF}
|
18
|
elif [ -z "${_SET_VERSION_SH}" ]; then
|
19
|
echo
|
20
|
echo "You must first run ./set_version.sh !"
|
21
|
echo "See http://devwiki.pfsense.org/DevelopersBootStrapAndDevIso for more information."
|
22
|
echo
|
23
|
echo "You can also run ./menu.sh which will assist with the available options"
|
24
|
echo
|
25
|
exit 2
|
26
|
fi
|
27
|
|
28
|
OIFS=$IFS
|
29
|
IFS=%
|
30
|
|
31
|
# Architecture, supported ARCH values are:
|
32
|
# Tier 1: i386, AMD64, and PC98
|
33
|
# Tier 2: ARM, PowerPC, ia64, Sparc64 and sun4v
|
34
|
# Tier 3: MIPS and S/390
|
35
|
# Tier 4: None at the moment
|
36
|
# Source: http://www.freebsd.org/doc/en/articles/committers-guide/archs.html
|
37
|
export TARGET=${TARGET:-"`uname -m`"}
|
38
|
export TARGET_ARCH=${TARGET_ARCH:-${TARGET}}
|
39
|
# Set TARGET_ARCH_CONF_DIR
|
40
|
if [ "$TARGET_ARCH" = "" ]; then
|
41
|
export TARGET_ARCH=`uname -p`
|
42
|
fi
|
43
|
export BUILDER_HOST_TARGET=`uname -m`
|
44
|
|
45
|
# FreeBSD version and build information
|
46
|
export FREEBSD_VERSION=${FREEBSD_VERSION:-10}
|
47
|
# This is used for using svn for retrieving src
|
48
|
# export USE_SVN=yes
|
49
|
export FREEBSD_REPO_BASE=${FREEBSD_REPO_BASE:-"git@git.pfmechanics.com:outsidemirrors/freebsd.git"}
|
50
|
export FREEBSD_BRANCH=${FREEBSD_BRANCH:-"stable/10"}
|
51
|
|
52
|
# Version that will be applied to this build
|
53
|
export PFSENSE_VERSION=${PFSENSE_VERSION:-2.2-DEVELOPMENT}
|
54
|
|
55
|
# pfSense repository tag to build
|
56
|
export PFSENSETAG=${PFSENSETAG:-RELENG_2_2}
|
57
|
|
58
|
export PRODUCT_NAME=${PRODUCT_NAME:-pfSense}
|
59
|
|
60
|
# Directory to be used for writing temporary information
|
61
|
export SCRATCHDIR=${SCRATCHDIR:-/tmp}
|
62
|
|
63
|
# Area that the final image will appear in
|
64
|
export MAKEOBJDIRPREFIXFINAL=${MAKEOBJDIRPREFIXFINAL:-${SCRATCHDIR}/${PRODUCT_NAME}/}
|
65
|
|
66
|
# Leave near the top.
|
67
|
export MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX:-/usr/obj.${TARGET}}
|
68
|
|
69
|
# Generally /home/pfsense
|
70
|
export BASE_DIR=${BASE_DIR:-/home/pfsense}
|
71
|
|
72
|
# pfSense and tools directory name
|
73
|
# Used for Git checkout
|
74
|
export TOOLS_DIR=${TOOLS_DIR:-tools}
|
75
|
|
76
|
# Generally /home/pfsense/tools
|
77
|
export BUILDER_TOOLS=${BUILDER_TOOLS:-${BASE_DIR}/${TOOLS_DIR}}
|
78
|
|
79
|
# Generally /home/pfsense/tools/builder_scripts
|
80
|
export BUILDER_SCRIPTS=${BUILDER_SCRIPTS:-${BUILDER_TOOLS}/builder_scripts}
|
81
|
export BUILDER_LOGS=${BUILDER_LOGS:-${BUILDER_TOOLS}/logs}
|
82
|
if [ ! -d ${BUILDER_LOGS} ]; then
|
83
|
mkdir -p ${BUILDER_LOGS}
|
84
|
fi
|
85
|
|
86
|
# Generally /home/pfsense/tools/builder_scripts/builder_profiles
|
87
|
export BUILDER_PROFILES=${BUILDER_SCRIPTS}/builder_profiles
|
88
|
|
89
|
# path to pfPorts
|
90
|
export pfSPORTS_BASE_DIR=${pfSPORTS_BASE_DIR:-${BUILDER_TOOLS}/pfPorts}
|
91
|
|
92
|
# Set it to "-c" to don't rebuild already built packages
|
93
|
CHECK_PORTS_INSTALLED=${CHECK_PORTS_INSTALLED:-""}
|
94
|
|
95
|
# This is where files will be staged
|
96
|
export PFSENSESTAGEDIR=${PFSENSESTAGEDIR:-/usr/local/pfsense-fs}
|
97
|
|
98
|
export SRCDIR=${SRCDIR:-/usr/pfSensesrc/src}
|
99
|
export PFSPKGFILE=${PFSPKGFILE:-${SCRATCHDIR}/pfspackages}
|
100
|
export PFSBUILDERREQUIREDPORTS=${PFSBUILDERREQUIREDPORTS:-${BUILDER_SCRIPTS}/conf/pfPorts/builder_required_ports}
|
101
|
|
102
|
# Items beyond this must be defined after MAKEOBJDIRPREFIX!
|
103
|
|
104
|
# OVF/vmdk parms
|
105
|
export OVFPATH=${OVFPATH:-${MAKEOBJDIRPREFIXFINAL}}
|
106
|
# Name of ovf file included inside OVA archive
|
107
|
export OVFFILE=${OVFFILE:-${PRODUCT_NAME}.ovf}
|
108
|
# On disk name of VMDK file included in OVA
|
109
|
export OVFVMDK=${OVFVMDK:-${PRODUCT_NAME}.vmdk}
|
110
|
# Filename of final image output
|
111
|
export OVAFILE=${OVAFILE:-${PRODUCT_NAME}.ova}
|
112
|
# optional
|
113
|
export OVFCERT=${OVFCERT:-""}
|
114
|
# optional
|
115
|
export OVFSTRINGS=${OVFSTRINGS:-""}
|
116
|
# optional
|
117
|
export OVFMF=${OVFMF:-""}
|
118
|
# 10 gigabyte on disk VMDK size
|
119
|
export OVADISKSIZE=${OVADISKSIZE:-"10737418240"}
|
120
|
# dd buffering size when creating raw backed VMDK
|
121
|
export OVABLOCKSIZE=${OVABLOCKSIZE:-"409600"}
|
122
|
# first partition size (freebsd-ufs) GPT
|
123
|
export OVA_FIRST_PART_SIZE=${OVA_FIRST_PART_SIZE:-"8G"}
|
124
|
# swap partition size (freebsd-swap) GPT -
|
125
|
# remaining space of 10G-8G - 128 block beginning/loader
|
126
|
export OVA_SWAP_PART_SIZE=${OVA_SWAP_PART_SIZE:-"4193725"}
|
127
|
# 10737254400 = 10240MB = virtual box vmdk file size XXX grab this value from vbox creation
|
128
|
export OVA_DISKSECTIONALLOCATIONUNITS=${OVA_DISKSECTIONALLOCATIONUNITS:-"10737254400"}
|
129
|
# end of OVF
|
130
|
|
131
|
# Leave this alone.
|
132
|
export SRC_CONF=${SRC_CONF:-"${BUILDER_SCRIPTS}/conf/src/src.conf.$FREEBSD_VERSION"}
|
133
|
export SRC_CONF_INSTALL=${SRC_CONF_INSTALL:-"${BUILDER_SCRIPTS}/conf/src/src.conf.${FREEBSD_VERSION}.install"}
|
134
|
|
135
|
#### User settable options follow ###
|
136
|
|
137
|
# "UNBREAK TEXTMATE FORMATTING. PLEASE LEAVE ME THANKS.
|
138
|
|
139
|
# Patch directory and patch file that lists patches to apply
|
140
|
export PFSPATCHDIR=${PFSPATCHDIR:-${BUILDER_TOOLS}/patches/${FREEBSD_BRANCH}}
|
141
|
export PFSPATCHFILE=${PFSPATCHFILE:-${BUILDER_TOOLS}/builder_scripts/conf/patchlist/${FREEBSD_BRANCH}/patches}
|
142
|
|
143
|
# Path to kernel files being built
|
144
|
export KERNEL_BUILD_PATH=${KERNEL_BUILD_PATH:-"${SCRATCHDIR}/kernels"}
|
145
|
|
146
|
# Controls how many concurrent make processes are run for each stage
|
147
|
if [ "${NO_MAKEJ}" = "" ]; then
|
148
|
CPUS=`sysctl -n kern.smp.cpus`
|
149
|
CPUS=`expr $CPUS '*' 2`
|
150
|
export MAKEJ_WORLD=${MAKEJ_WORLD:-"-j$CPUS"}
|
151
|
export MAKEJ_KERNEL=${MAKEJ_KERNEL:-"-j$CPUS"}
|
152
|
else
|
153
|
export MAKEJ_WORLD=${MAKEJ_WORLD:-""}
|
154
|
export MAKEJ_KERNEL=${MAKEJ_KERNEL:-""}
|
155
|
fi
|
156
|
if [ ${FREEBSD_VERSION} -ge 10 ]; then
|
157
|
if [ "${TARGET}" = "mips" ]; then
|
158
|
export MODULES_OVERRIDE=${MODULES_OVERRIDE:-"i2c ipfw ipdivert dummynet fdescfs opensolaris zfs if_stf sfxge"}
|
159
|
else
|
160
|
export MODULES_OVERRIDE=${MODULES_OVERRIDE:-"i2c ipmi ndis ipfw ipdivert dummynet fdescfs opensolaris zfs glxsb if_stf coretemp amdtemp aesni sfxge"}
|
161
|
fi
|
162
|
else
|
163
|
export MODULES_OVERRIDE=${MODULES_OVERRIDE:-"i2c ipmi acpi ndis ipfw ipdivert dummynet fdescfs cpufreq opensolaris zfs glxsb runfw if_stf virtio coretemp amdtemp aesni sfxge mps ahci"}
|
164
|
fi
|
165
|
export MAKEJ_PORTS=${MAKEJ_PORTS:-""}
|
166
|
export NOEXTRA_DEVICES=${NOEXTRA_DEVICES:-}
|
167
|
export EXTRA_OPTIONS=${EXTRA_OPTIONS:-}
|
168
|
export NOEXTRA_OPTIONS=${NOEXTRA_OPTIONS:-}
|
169
|
|
170
|
# DO NOT SET THIS. IT WILL BREAK 1.2.3 builds. This is now
|
171
|
# set by default in setup_overlay.sh
|
172
|
# export EXTRA_DEVICES=${EXTRA_DEVICES:-"siba_bwn,bwn,run"}
|
173
|
|
174
|
# Config directory for nanobsd build
|
175
|
export CONFIG_DIR=nano
|
176
|
# Number of code images on media (1 or 2)
|
177
|
export NANO_IMAGES=2
|
178
|
# 0 -> Leave second image all zeroes so it compresses better.
|
179
|
# 1 -> Initialize second image with a copy of the first
|
180
|
export NANO_INIT_IMG2=1
|
181
|
export NANO_RAM_ETCSIZE=30720
|
182
|
export NANO_RAM_TMPVARSIZE=51200
|
183
|
export NANO_WITH_VGA=${NANO_WITH_VGA:-""}
|
184
|
export NANO_NEWFS="-b 4096 -f 512 -i 8192 -O1"
|
185
|
export FLASH_MODEL=${FLASH_MODEL:-"sandisk"}
|
186
|
export FLASH_SIZE=${FLASH_SIZE:-"1g"}
|
187
|
# Size of code file system in 512 bytes sectors
|
188
|
# If zero, size will be as large as possible.
|
189
|
export NANO_CODESIZE=0
|
190
|
# Size of data file system in 512 bytes sectors
|
191
|
# If zero: no partition configured.
|
192
|
# If negative: max size possible
|
193
|
export NANO_DATASIZE=0
|
194
|
# Size of pfSense /conf partition # 102400 = 50 megabytes.
|
195
|
export NANO_CONFSIZE=102400
|
196
|
# packet is OK for 90% of embedded
|
197
|
export NANO_BOOT0CFG="-o packet -s 1 -m 3"
|
198
|
|
199
|
# Custom Copy and Remove lists that override base remove.list.* and copy.list.*
|
200
|
export CUSTOM_REMOVE_LIST=${CUSTOM_REMOVE_LIST:-"${BUILDER_SCRIPTS}/conf/rmlist/remove.list.iso.$FREEBSD_VERSION"}
|
201
|
export CUSTOM_COPY_LIST=${CUSTOM_COPY_LIST:-"${BUILDER_TOOLS}/builder_scripts/conf/copylist/copy.list.$PSENSETAG"}
|
202
|
|
203
|
# " - UNBREAK TEXTMATE FORMATTING - PLEASE LEAVE.
|
204
|
|
205
|
# Use a custom config.xml
|
206
|
#export USE_CONFIG_XML=${USE_CONFIG_XML:-"/path/to/custom/config.xml"}
|
207
|
|
208
|
# GIT pfSense, BSDInstaller GIT repo settings
|
209
|
export GIT_REPO_PFSENSE=${GIT_REPO_PFSENSE:-"git@git.pfmechanics.com:pfsense/pfsense.git"}
|
210
|
export GIT_REPO_DIR="${BASE_DIR}/pfSenseGITREPO"
|
211
|
export GIT_REPO_TOOLS=${GIT_REPO_TOOLS:-"git@git.pfmechanics.com:pfsense/pfsense-tools.git ${TOOLS_DIR}"}
|
212
|
export GIT_REPO_BSDINSTALLER=${GIT_REPO_BSDINSTALLER:-"git@git.pfmechanics.com:pfsense/bsdinstaller.git"}
|
213
|
|
214
|
# Custom overlay for people building or extending pfSense images.
|
215
|
# The custom overlay tar gzipped file will be extracted over the root
|
216
|
# of the prepared image allowing for customization.
|
217
|
#
|
218
|
# Note: It is also possible to specify a directory instead of a
|
219
|
# gzipped tarball.
|
220
|
#
|
221
|
# Tarball overlay (please uncomment):
|
222
|
#export custom_overlay="${BASE_DIR}/custom_overlay.tgz"
|
223
|
#
|
224
|
# Directory overlay (please uncomment):
|
225
|
#export custom_overlay="${BASE_DIR}/custom_overlay"
|
226
|
|
227
|
# Package overlay. This gives people a chance to build a pfSense
|
228
|
# installable image that already contains certain pfSense packages.
|
229
|
#
|
230
|
# Needs to contain comma separated package names. Of course
|
231
|
# package names must be valid. Using non existent
|
232
|
# package name would yield an error.
|
233
|
#
|
234
|
#export custom_package_list=""
|
235
|
|
236
|
# Directory that will clone to in order to create
|
237
|
# iso staging area.
|
238
|
export PFSENSEISODIR=${PFSENSEISODIR:-/usr/local/pfsense-clone}
|
239
|
|
240
|
# NOTE: Date string is used for creating file names of images
|
241
|
# The file is used for sharing the same value with build_snapshots.sh
|
242
|
export _BUILDER_EPOCH=$(date +"%s")
|
243
|
export DATESTRINGFILE=${DATESTRINGFILE:-$SCRATCHDIR/version.snapshots}
|
244
|
if [ "${DATESTRING}" = "" ]; then
|
245
|
if [ -f $DATESTRINGFILE ]; then
|
246
|
# If the file is more than 30 minutes old regenerate it
|
247
|
TMPDATESTRINGFILE=$(($_BUILDER_EPOCH - `stat -f %m $DATESTRINGFILE`))
|
248
|
if [ $TMPDATESTRINGFILE -gt 1800 ]; then
|
249
|
export DATESTRING=`date "+%Y%m%d-%H%M"`
|
250
|
else
|
251
|
export DATESTRING=`cat $DATESTRINGFILE`
|
252
|
fi
|
253
|
unset TMPDATESTRINGFILE
|
254
|
else
|
255
|
export DATESTRING=`date "+%Y%m%d-%H%M"`
|
256
|
fi
|
257
|
echo "$DATESTRING" > $DATESTRINGFILE
|
258
|
fi
|
259
|
|
260
|
# NOTE: Date string is placed on the final image etc folder to help detect new updates
|
261
|
# The file is used for sharing the same value with build_snapshots.sh
|
262
|
export BUILTDATESTRINGFILE=${BUILTDATESTRINGFILE:-$SCRATCHDIR/version.buildtime}
|
263
|
if [ "${BUILTDATESTRING}" = "" ]; then
|
264
|
if [ -f $BUILTDATESTRINGFILE ]; then
|
265
|
# If the file is more than 30 minutes old regenerate it
|
266
|
TMPBUILTDATESTRINGFILE=$(($_BUILDER_EPOCH - `stat -f %m $BUILTDATESTRINGFILE`))
|
267
|
if [ $TMPBUILTDATESTRINGFILE -gt 1800 ]; then
|
268
|
export BUILTDATESTRING=`date "+%Y%m%d-%H%M"`
|
269
|
else
|
270
|
export BUILTDATESTRING=`cat $BUILTDATESTRINGFILE`
|
271
|
fi
|
272
|
unset TMPBUILTDATESTRINGFILE
|
273
|
else
|
274
|
export BUILTDATESTRING=`date "+%a %b %d %T %Z %Y"`
|
275
|
fi
|
276
|
echo "$BUILTDATESTRING" > $BUILTDATESTRINGFILE
|
277
|
fi
|
278
|
|
279
|
# General builder output filenames
|
280
|
export UPDATESDIR=${UPDATESDIR:-$MAKEOBJDIRPREFIXFINAL/updates}
|
281
|
export ISOPATH=${ISOPATH:-${MAKEOBJDIRPREFIXFINAL}/${PRODUCT_NAME}-LiveCD-${PFSENSE_VERSION}-${TARGET}-${DATESTRING}.iso}
|
282
|
export MEMSTICKPATH=${MEMSTICKPATH:-${MAKEOBJDIRPREFIXFINAL}/${PRODUCT_NAME}-memstick-${PFSENSE_VERSION}-${TARGET}-${DATESTRING}.img}
|
283
|
export MEMSTICKSERIALPATH=${MEMSTICKSERIALPATH:-${MAKEOBJDIRPREFIXFINAL}/${PRODUCT_NAME}-memstick-serial-${PFSENSE_VERSION}-${TARGET}-${DATESTRING}.img}
|
284
|
|
285
|
# set full-update update filename
|
286
|
export UPDATES_TARBALL_FILENAME=${UPDATES_TARBALL_FILENAME:-"${UPDATESDIR}/${PRODUCT_NAME}-Full-Update-${PFSENSE_VERSION}-${TARGET}-${DATESTRING}.tgz"}
|
287
|
|
288
|
# Do not compress /usr and make it geom_uzip usable
|
289
|
export NO_COMPRESSEDFS=yes
|
290
|
|
291
|
# " - UNBREAK TEXTMATE FORMATTING - PLEASE LEAVE.
|
292
|
|
293
|
# Can call custom functions during build such as disable_lan_disable_dhcpd_enable_sshd
|
294
|
export CUSTOM_CALL_SHELL_FUNCTION=${CUSTOM_CALL_SHELL_FUNCTION:-""}
|
295
|
|
296
|
if [ ${FREEBSD_VERSION} -ge 10 ]; then
|
297
|
USE_PKGNG=yes
|
298
|
PKG_INFO="pkg info"
|
299
|
PKG_QUERY="pkg query %n"
|
300
|
|
301
|
if [ "${TARGET}" = "i386" ]; then
|
302
|
export BUILD_KERNELS=${BUILD_KERNELS:-"pfSense_SMP.${FREEBSD_VERSION} pfSense_wrap.${FREEBSD_VERSION}.${TARGET} pfSense_wrap_vga.${FREEBSD_VERSION}.${TARGET}"}
|
303
|
else
|
304
|
export BUILD_KERNELS=${BUILD_KERNELS:-pfSense_SMP.${FREEBSD_VERSION}}
|
305
|
fi
|
306
|
else
|
307
|
PKG_INFO="pkg_info"
|
308
|
PKG_QUERY="pkg_info -e"
|
309
|
|
310
|
export BUILD_KERNELS=${BUILD_KERNELS:-"pfSense_SMP.${FREEBSD_VERSION} pfSense_wrap.${FREEBSD_VERSION}.${TARGET} pfSense_wrap_vga.${FREEBSD_VERSION}.${TARGET}"}
|
311
|
fi
|
312
|
|
313
|
# This needs to be at the very end of the file.
|
314
|
IFS=$OIFS
|