1 | ## Dit is een NanoBSD configuratie-template voor WirelessLeiden.
|
---|
2 | ## Instellingen weergegeven binnen dit bestand gelden als
|
---|
3 | ## standaard binnen de organisatie.
|
---|
4 |
|
---|
5 | # Little hack to allow proper secify of KERNL/PKG location
|
---|
6 | if [ -n "$NANO_CFG_FILE" ]; then
|
---|
7 | NANO_CONF_DIR=$(cd $(dirname $NANO_CFG_FILE); pwd -P)
|
---|
8 | else
|
---|
9 | NANO_CONF_DIR=$(cd $(dirname $2); pwd -P)
|
---|
10 | fi
|
---|
11 |
|
---|
12 | # object naam in /usr/obj/nanobsd.{obj}
|
---|
13 | NANO_NAME=wleiden-hybrid
|
---|
14 | NANO_SRC=/usr/src # nanobsd source tree
|
---|
15 | NANO_KERNEL=$NANO_CONF_DIR/kernel.wleiden # naam van het kernel configuratiebestand
|
---|
16 | NANO_IMAGES=2 # aantal nanobsd code slices/installs (1/2)
|
---|
17 |
|
---|
18 | NANO_CONFSIZE=8192 # volume van de config slice, default 2048 (512bs)
|
---|
19 | NANO_DATASIZE=0 # volume van de data slice, 0 = not configured
|
---|
20 | NANO_CODESIZE=819200
|
---|
21 | NANO_RAM_TMPVARSIZE=20480
|
---|
22 |
|
---|
23 | NANO_DRIVE=ada0
|
---|
24 |
|
---|
25 | #XXX: Eeks, fixed packages, needs building a hook to allow building the package
|
---|
26 | # of the shelfs if needed, copy to right directory, done. With only input needed
|
---|
27 | # a list of ports in the format like net/net-snmp
|
---|
28 | NANO_PACKAGE_DIR=$NANO_CONF_DIR/../pkg/All
|
---|
29 |
|
---|
30 | # Wireless Leiden ports from $WL_PORTSDIR are copied OVER $PORTSDIR
|
---|
31 | PORTSDIR='/usr/ports'
|
---|
32 | WL_PORTSDIR="$NANO_CONF_DIR/../ports/"
|
---|
33 |
|
---|
34 | # Dirty quirk to allow comments in part below
|
---|
35 | PACKAGE_LIST=`cat <<EOF | sed -e 's/#.*$//g' | xargs
|
---|
36 | benchmarks/iperf
|
---|
37 | devel/py-Jinja2
|
---|
38 | devel/py-yaml
|
---|
39 | dns/dnsmasq
|
---|
40 | editors/vim-lite
|
---|
41 | ftp/curl
|
---|
42 | lang/python
|
---|
43 | net-mgmt/net-snmp
|
---|
44 | net-mgmt/nrpe2
|
---|
45 | net/isc-dhcp42-server
|
---|
46 | net/pen
|
---|
47 | net/sixxs-aiccu
|
---|
48 | security/nmap
|
---|
49 | security/openvpn
|
---|
50 | security/sudo
|
---|
51 | shells/bash-static
|
---|
52 | sysutils/screen
|
---|
53 | sysutils/ucspi-tcp
|
---|
54 | www/thttpd
|
---|
55 | www/tinyproxy
|
---|
56 |
|
---|
57 | # Extra WL ports
|
---|
58 | net/lvrouted
|
---|
59 | `
|
---|
60 | # Package target
|
---|
61 | # Dirty quirk to allow comments in part below
|
---|
62 | PKG_MAKE_ARGS=`cat <<EOF | sed 's/#.*$//g' | xargs
|
---|
63 | PACKAGES=$(dirname $NANO_PACKAGE_DIR)
|
---|
64 | BATCH=yes PACKAGE_BUILDING=yes
|
---|
65 | # www/py-cherrypy
|
---|
66 | WITH_APACHE=yes
|
---|
67 | # net-mgmt/net-snmp
|
---|
68 | WITHOUT_PERL=yes
|
---|
69 | # net-mgmt/nagios-plugins
|
---|
70 | WITH_FPING=yes
|
---|
71 | # threads is broken in the version (atleast up to 9.0 - 20120213)
|
---|
72 | # Should be fix in current version in linux, but for some reason
|
---|
73 | # Not yet in BSD. We don't need threads
|
---|
74 | WITHOUT_THREADS=yes
|
---|
75 | # shells/bash-static
|
---|
76 | WITH_SYSLOG=yes
|
---|
77 | `
|
---|
78 |
|
---|
79 | ##NANO_PACKAGE_LIST=
|
---|
80 |
|
---|
81 | # Warning: set to 1 to debug make build errors
|
---|
82 | # Number of recurrent parrallel make builds
|
---|
83 | if `grep -q 'acpi0: <PRLS PRLS_OEM> on motherboard' /var/run/dmesg.boot`; then
|
---|
84 | # Mac OS X Parallels virtual machine
|
---|
85 | NANO_PMAKE="make -B"
|
---|
86 | else
|
---|
87 | # Default 2 times number of CPU's inside machine
|
---|
88 | NANO_PARALLEL_MAKE=`expr $(sysctl -n hw.ncpu) \* 2`
|
---|
89 | NANO_PMAKE="make -j ${NANO_PARALLEL_MAKE}"
|
---|
90 | fi
|
---|
91 |
|
---|
92 | # Starting from soekris bios version 1.31 upwards boot0sio does not seems work
|
---|
93 | # anymore, but boot0 does (weird)
|
---|
94 | NANO_BOOTLOADER="boot/boot0"
|
---|
95 |
|
---|
96 | # Strip down to a more acceptable size
|
---|
97 | # hints from http://people.freebsd.org/~phk/nanobsd/soekris_4x26/make.soekris_4x26.conf (46MB)
|
---|
98 | NANO_PRUNE="$NANO_PRUNE usr/share/examples"
|
---|
99 | NANO_PRUNE="$NANO_PRUNE usr/share/syscons"
|
---|
100 | NANO_PRUNE="$NANO_PRUNE usr/share/calendar"
|
---|
101 | # NB! usr/share/misc contains termcap, vi(1) etc fails to work without it.
|
---|
102 | # NANOBSD_PRUNE += usr/share/misc
|
---|
103 | NANO_PRUNE="$NANO_PRUNE usr/share/pcvt"
|
---|
104 | NANO_PRUNE="$NANO_PRUNE usr/share/me"
|
---|
105 | NANO_PRUNE="$NANO_PRUNE usr/share/doc"
|
---|
106 |
|
---|
107 |
|
---|
108 |
|
---|
109 |
|
---|
110 |
|
---|
111 | # Opties parsed gedurende build & install world
|
---|
112 | # Also check man 3 src.conf for details
|
---|
113 | # Some flags are misleading, e.g. could only be installworld (e.g.), for details:
|
---|
114 | # http://phk.freebsd.dk/misc/build_options/
|
---|
115 | # For details on make options also check:
|
---|
116 | # /usr/src/share/mk/bsd.own.mk
|
---|
117 | CONF_COMMON='
|
---|
118 | # Specific enabled options
|
---|
119 | #WITHOUT_ACPI=YES # geen advanced configuration power interface
|
---|
120 | #WITHOUT_BIND=YES # geen bind tools, dns/named geinstalleerd
|
---|
121 | #WITHOUT_CXX=YES # Set to not build g++(1) and related libraries.
|
---|
122 | #WITHOUT_GROFF=YES # Set to not build groff(1).
|
---|
123 | #WITHOUT_INET6=YES # geen ondersteuning inet versie 6 architectuur
|
---|
124 | #WITHOUT_INFO=YES # geen info bestanden, readable online docs
|
---|
125 | #WITHOUT_IPFILTER=YES # geen ip filtering geinstalleerd
|
---|
126 | #WITHOUT_KLDLOAD=YES # do not allow loading of kernel modules
|
---|
127 | #WITHOUT_MAILWRAPPER=YES # geen mailwrapper bij gebruik sendmail
|
---|
128 | #WITHOUT_MAN=YES # geen handleidingen gecompileerd
|
---|
129 | #WITHOUT_MISC=YES # geen misc sub directory
|
---|
130 | #WITHOUT_MODULES=YES # geen ondersteuning toevoegen modules
|
---|
131 | #WITHOUT_PAM=YES # geen ondersteuning pa modules
|
---|
132 | #WITHOUT_PF=YES # geen packet filtering geinstalleerd
|
---|
133 | #WITHOUT_SHARE=YES # geen share sub directory
|
---|
134 | #WITHOUT_USB=YES # geen ondersteuning usb modules
|
---|
135 | # Specific disabled options
|
---|
136 | WITHOUT_ATM=YES # geen ondersteuning Asynchronous Transfer Mode
|
---|
137 | WITHOUT_AUDIT=YES # geen event auditing / audit trails
|
---|
138 | WITHOUT_AUTHPF=YES # geen authenticating gateway user shell
|
---|
139 | WITHOUT_BLUETOOTH=YES # geen ondersteuning Bluetooth modules
|
---|
140 | WITHOUT_CALENDAR=YES # geen calendar reminder service gecompileerd
|
---|
141 | WITHOUT_CDDL=YES # Set to not build code licensed under Sun CDDL. (also ZFS)
|
---|
142 | WITHOUT_CPP=YES # Set to not build cpp(1).
|
---|
143 | WITHOUT_CVS=YES # geen cvs tools geinstalleerd
|
---|
144 | WITHOUT_DICT=YES # geen dictionary ondersteuning
|
---|
145 | WITHOUT_EXAMPLES=YES # geen voorbeeld configuratiebestanden
|
---|
146 | WITHOUT_FORTRAN=YES # geen ondersteuning fortran compilers
|
---|
147 | WITHOUT_GAMES=YES # geen games gecompileerd
|
---|
148 | WITHOUT_GCOV=YES # geen gcov test coverage program
|
---|
149 | WITHOUT_GDB=YES # geen gnu debugger gecompileerd
|
---|
150 | WITHOUT_GPIB=YES # geen ondersteuning gpib kaarten
|
---|
151 | WITHOUT_HTML=YES # geen html help bestanden gecompileerd
|
---|
152 | WITHOUT_I4B=YES # geen ondersteuning voor isdn
|
---|
153 | WITHOUT_IPX=YES # geen ondersteuning ipx protocols
|
---|
154 | WITHOUT_KERBEROS=YES # geen ondersteuning Kerberos authenticatie
|
---|
155 | WITHOUT_LOCALES=YES # geen ondersteuning lokalisatie
|
---|
156 | WITHOUT_LPR=YES # geen ondersteuning print services
|
---|
157 | WITHOUT_NIS=YES # geen ondersteuning network information system
|
---|
158 | WITHOUT_PROFILE=YES # Set to avoid compiling profiled libraries.
|
---|
159 | WITHOUT_RCMDS=YES # geen ondersteuning rcmds,
|
---|
160 | WITHOUT_RESCUE=YES # geen rescue bestanden gecompileerd
|
---|
161 | WITHOUT_SENDMAIL=YES # geen sendmail geinstalleerd
|
---|
162 | WITHOUT_SHAREDOCS=YES # geen share/docs directories
|
---|
163 | WITHOUT_SYSCONS=YES # geen syscon devices gecompileerd
|
---|
164 | '
|
---|
165 |
|
---|
166 | CONF_BUILD="
|
---|
167 | ${CONF_COMMON}
|
---|
168 | "
|
---|
169 |
|
---|
170 | CONF_INSTALL="
|
---|
171 | ${CONF_COMMON}
|
---|
172 | WITHOUT_TOOLCHAIN=YES # geen freebsd toolchain
|
---|
173 | "
|
---|
174 |
|
---|
175 |
|
---|
176 | # Flash disks arrived, sandisk 1g seems to match the geometry of the (blanc) cards
|
---|
177 | #FlashDevice sandisk 1g # nanobsd flashdevice entry
|
---|
178 | #FlashDevice sandisk 512mb # nanobsd flashdevice entry
|
---|
179 | #FlashDevice transcend 2g # nanobsd flashdevice entry
|
---|
180 | # Calculated value of PEAK hardware 1GB CF card
|
---|
181 | # C/H/S phys 1954/16/63, logical 977/32/63
|
---|
182 | # Mediasize is calculated as C*H*S*512
|
---|
183 |
|
---|
184 | # Using logical values reported by ALIX board
|
---|
185 | # values for PCEngines blanc 1 GB cards
|
---|
186 | # C/H/S phys 1966/16/63, logical 983/32/63
|
---|
187 | NANO_MEDIASIZE=`expr 1008451584 / 512`
|
---|
188 | NANO_HEADS=32
|
---|
189 | NANO_SECTS=63
|
---|
190 |
|
---|
191 |
|
---|
192 | # Version tagging
|
---|
193 | cust_version_tag() (
|
---|
194 | VERSION_FILE="${NANO_WORLDDIR}/tools/wl-release.txt"
|
---|
195 | (
|
---|
196 | echo "Generated by `id -un`@`hostname -f` at `date`"
|
---|
197 | echo ""
|
---|
198 | echo "=== CONFIG specifics ==="
|
---|
199 | svn info ${NANO_CONF_DIR}/../ || exit 0
|
---|
200 | svn diff ${NANO_CONF_DIR}/../ || exit 0
|
---|
201 | echo "=== BEGIN CONFIG specifics ==="
|
---|
202 | ) > $VERSION_FILE
|
---|
203 | )
|
---|
204 |
|
---|
205 | # Takes a very long time (10+) minutes to generate this file on an ALIX board,
|
---|
206 | # not practical for quick debugging and configuration.
|
---|
207 | cust_openvpn_dhparam() (
|
---|
208 | DHFILE=${NANO_WORLDDIR}/etc/easy-rsa-keys/dh1024.pem
|
---|
209 | mkdir -p `dirname $DHFILE`
|
---|
210 | openssl dhparam -out $DHFILE 1024
|
---|
211 | )
|
---|
212 |
|
---|
213 |
|
---|
214 |
|
---|
215 | # Assuming we are running a safe envirionment where snooping could occur during or after the build
|
---|
216 | cust_set_root_password() (
|
---|
217 | if [ -n "${CFG_ROOT_PASSWORD}" ]; then
|
---|
218 | pprint 2 "Set root password using CFG_ROOT_PASSWORD variable"
|
---|
219 | chroot ${NANO_WORLDDIR} sh -c "echo '${CFG_ROOT_PASSWORD}' | pw usermod -h 0 -u root"
|
---|
220 | else
|
---|
221 | pprint 2 "Root password is <blank>, no password provided at variable CFG_ROOT_PASSWORD"
|
---|
222 | fi
|
---|
223 | )
|
---|
224 |
|
---|
225 |
|
---|
226 |
|
---|
227 | # EXPERIMENTAL patch like envirionment
|
---|
228 | # Using '*-nanobsd.patch' files to only specify the bare differences between the base/default file to
|
---|
229 | # keep us as close as possible to the base OS
|
---|
230 | # Patches are applied to the directory they live in
|
---|
231 | cust_apply_nanobsd_patches() (
|
---|
232 | for PATCHFILE in `find ${NANO_WORLDDIR} -regex '.*-nanobsd\.patch$'`; do
|
---|
233 | cd `dirname ${PATCHFILE}`
|
---|
234 | patch -t -N -p0 -i `basename ${PATCHFILE}`
|
---|
235 | #XX: What to with installed patch files? Delete them for the time beeing
|
---|
236 | rm -v ${PATCHFILE}
|
---|
237 | done
|
---|
238 |
|
---|
239 |
|
---|
240 |
|
---|
241 | )
|
---|
242 |
|
---|
243 |
|
---|
244 |
|
---|
245 | # Compile & install lvroute daemon vanuit source in svn
|
---|
246 | cust_install_lvrouted() (
|
---|
247 | svn co http://svn.wirelessleiden.nl/svn/node-config/other/lvrouted/trunk/ /tmp/lvrouted
|
---|
248 | cd /tmp/lvrouted && autoconf && autoheader && ./configure && make || true
|
---|
249 | cp src/lvrouted.opt ${NANO_WORLDDIR}/usr/local/sbin
|
---|
250 | )
|
---|
251 |
|
---|
252 |
|
---|
253 |
|
---|
254 | # Customize ntpd
|
---|
255 | cust_ntpd() (
|
---|
256 | chroot ${NANO_WORLDDIR} sh -c "ln -fs /usr/local/etc/ntp.drift /var/db/ntp.drift"
|
---|
257 | )
|
---|
258 |
|
---|
259 |
|
---|
260 | # Enable Serial TTYs
|
---|
261 | cust_serial_ttys() (
|
---|
262 | chroot ${NANO_WORLDDIR} sed -i '' -e '/ttyv[1-9]/s/on /off/' -e '/ttyu0/s/off/on/' -e '/ttyu0/s/dialup/ansi/' /etc/ttys
|
---|
263 | )
|
---|
264 |
|
---|
265 |
|
---|
266 |
|
---|
267 | # Install files from specific relative location
|
---|
268 | cust_install_files () (
|
---|
269 | cd ${NANO_CONF_DIR}/../files
|
---|
270 | find . -print | grep -v -e /CVS -e .svn | cpio -dumpv ${NANO_WORLDDIR}
|
---|
271 | )
|
---|
272 |
|
---|
273 |
|
---|
274 | # pkgdb should live on persistent storage only
|
---|
275 | cust_alternate_pkg_db () (
|
---|
276 | mkdir -p ${NANO_WORLDDIR}/usr/local/var/db/pkg ${NANO_WORLDDIR}/usr/local/tmp
|
---|
277 | touch ${NANO_WORLDDIR}/usr/local/tmp/.hack-to-avoid-pruning-directory
|
---|
278 | # sh profile
|
---|
279 | ( echo 'PKG_DBDIR=/usr/local/var/db/pkg; export PKG_DBDIR'; \
|
---|
280 | echo 'PKG_TMPDIR=/usr/local/tmp; export PKG_TMPDIR' ) >> ${NANO_WORLDDIR}/etc/profile
|
---|
281 | # csh profile
|
---|
282 | ( echo 'setenv PKG_DBDIR /usr/local/var/db/pkg'; \
|
---|
283 | echo 'setenv PKG_TMPDIR /usr/local/tmp' ) >> ${NANO_WORLDDIR}/etc/csh.cshrc
|
---|
284 |
|
---|
285 | rmdir ${NANO_WORLDDIR}/var/db/pkg
|
---|
286 | ln -s /usr/local/var/db/pkg ${NANO_WORLDDIR}/var/db/pkg
|
---|
287 | )
|
---|
288 |
|
---|
289 | # Make tools available for root by default
|
---|
290 | cust_root_bin_to_tools() {
|
---|
291 | ln -s /tools ${NANO_WORLDDIR}/root/bin
|
---|
292 | }
|
---|
293 |
|
---|
294 | # Directly stolen from /usr/src/tools/tools/nanobsd/nanobsd.sh, and make sure
|
---|
295 | # to source /etc/profile in chroot to get PKG_* included, for alternate installs
|
---|
296 | cust_pkg () (
|
---|
297 | # If the package directory doesn't exist, we're done.
|
---|
298 | if [ ! -d ${NANO_PACKAGE_DIR} ]; then
|
---|
299 | echo "DONE 0 packages"
|
---|
300 | return 0
|
---|
301 | fi
|
---|
302 |
|
---|
303 | # Make sure to enable /dev as easy_install requires it for example
|
---|
304 | mount -t devfs devfs ${NANO_WORLDDIR}/dev
|
---|
305 | trap "umount ${NANO_WORLDDIR}/dev" 1 2 3 15
|
---|
306 |
|
---|
307 | # Copy packages into chroot
|
---|
308 | mkdir -p ${NANO_WORLDDIR}/Pkg
|
---|
309 | (
|
---|
310 | cd ${NANO_PACKAGE_DIR}
|
---|
311 | find ${NANO_PACKAGE_LIST} -print |
|
---|
312 | cpio -Ldumpv ${NANO_WORLDDIR}/Pkg
|
---|
313 | )
|
---|
314 |
|
---|
315 | # Count & report how many we have to install
|
---|
316 | todo=`ls ${NANO_WORLDDIR}/Pkg | wc -l`
|
---|
317 | echo "=== TODO: $todo"
|
---|
318 | ls ${NANO_WORLDDIR}/Pkg
|
---|
319 | echo "==="
|
---|
320 | NANO_PKG_DBDIR=${NANO_WORLDDIR}/`chroot ${NANO_WORLDDIR} sh -c '. /etc/profile; echo ${PKG_DBDIR:-/var/db/pkg}'`
|
---|
321 | while true
|
---|
322 | do
|
---|
323 | # Record how many we have now
|
---|
324 | have=`ls ${NANO_PKG_DBDIR} | wc -l`
|
---|
325 |
|
---|
326 | # Attempt to install more packages
|
---|
327 | # ...but no more than 200 at a time due to pkg_add's internal
|
---|
328 | # limitations.
|
---|
329 | chroot ${NANO_WORLDDIR} sh -c \
|
---|
330 | '. /etc/profile; ls Pkg/*tbz | xargs -n 200 pkg_add -F' || true
|
---|
331 |
|
---|
332 | # See what that got us
|
---|
333 | now=`ls ${NANO_PKG_DBDIR} | wc -l`
|
---|
334 | echo "=== NOW $now"
|
---|
335 | ls ${NANO_PKG_DBDIR}
|
---|
336 | echo "==="
|
---|
337 |
|
---|
338 |
|
---|
339 | if [ $now -eq $todo ] ; then
|
---|
340 | echo "DONE $now packages"
|
---|
341 | break
|
---|
342 | elif [ $now -eq $have ] ; then
|
---|
343 | echo "FAILED: Nothing happened on this pass"
|
---|
344 | exit 2
|
---|
345 | fi
|
---|
346 | done
|
---|
347 | rm -rf ${NANO_WORLDDIR}/Pkg
|
---|
348 |
|
---|
349 | # Return normal trap behaviour
|
---|
350 | trap - 1 2 3 15
|
---|
351 | umount ${NANO_WORLDDIR}/dev
|
---|
352 | )
|
---|
353 |
|
---|
354 |
|
---|
355 | # Prune no needed directories of image
|
---|
356 | cust_nano_prune () (
|
---|
357 | cd ${NANO_WORLDDIR}
|
---|
358 | for ENTRY in ${NANO_PRUNE}; do
|
---|
359 | rm -vfR ${ENTRY}
|
---|
360 | done
|
---|
361 | )
|
---|
362 |
|
---|
363 |
|
---|
364 | # Fill /cfg with custom files, based on 'create_i386_diskimage ( )'
|
---|
365 | last_nano_fill_cfg () (
|
---|
366 | # Variables to be used
|
---|
367 | IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME}
|
---|
368 | MNT=${MAKEOBJDIRPREFIX}/_.mnt
|
---|
369 |
|
---|
370 | # Mount '/cfg' slize in image
|
---|
371 | MD=`mdconfig -a -t vnode -f ${IMG}`
|
---|
372 | mount /dev/${MD}s3 ${MNT}
|
---|
373 |
|
---|
374 | # Location of '/cfg' directory
|
---|
375 | cd ${NANO_CONF_DIR}/../cfg-files
|
---|
376 | find . -print | grep -v -e /CVS -e .svn | cpio -dumpv ${MNT}
|
---|
377 |
|
---|
378 |
|
---|
379 | # Leave in nice end state
|
---|
380 | umount ${MNT}
|
---|
381 | mdconfig -d -u ${MD}
|
---|
382 | ) > ${MAKEOBJDIRPREFIX}/_.fc 2>&1
|
---|
383 |
|
---|
384 | last_nano_disk_usage () (
|
---|
385 | # Variables to be used
|
---|
386 | IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME}
|
---|
387 | MNT=${MAKEOBJDIRPREFIX}/_.mnt
|
---|
388 |
|
---|
389 | # Mount root slize
|
---|
390 | MD=`mdconfig -a -t vnode -f ${IMG}`
|
---|
391 | mount /dev/${MD}s1a ${MNT}
|
---|
392 |
|
---|
393 | # Show disk usage (percent free) inc header
|
---|
394 | pprint 2 $(df -h | head -1)
|
---|
395 | pprint 2 "$(df -h | grep /dev/${MD})"
|
---|
396 |
|
---|
397 | # Leave in nice end state
|
---|
398 | umount ${MNT}
|
---|
399 | mdconfig -d -u ${MD}
|
---|
400 | )
|
---|
401 |
|
---|
402 | last_orders () (
|
---|
403 | last_nano_fill_cfg
|
---|
404 | last_nano_disk_usage
|
---|
405 | )
|
---|
406 |
|
---|
407 | # Ugly hack to 'escaping' pprint from inside a customize_cmd to output
|
---|
408 | # instead of a file
|
---|
409 | exec 3>/dev/stdout
|
---|
410 | # Progress Print
|
---|
411 | # Print $2 at level $1
|
---|
412 | pprint() {
|
---|
413 | if [ "$1" -le $PPLEVEL ]; then
|
---|
414 | printf "%.${1}s %s\n" "#####" "$2" 1>&3
|
---|
415 | fi
|
---|
416 | }
|
---|
417 |
|
---|
418 | # Cust macro`s gestart in onderstaande volgorde
|
---|
419 | # XXX: Determine size before installing all find of additions to see how much
|
---|
420 | # base we are actually using ## du -h -d 0
|
---|
421 | customize_cmd cust_alternate_pkg_db
|
---|
422 | customize_cmd cust_pkg
|
---|
423 | customize_cmd cust_install_files
|
---|
424 | customize_cmd cust_ntpd
|
---|
425 | customize_cmd cust_serial_ttys
|
---|
426 | customize_cmd cust_version_tag
|
---|
427 | customize_cmd cust_root_bin_to_tools
|
---|
428 | customize_cmd cust_allow_ssh_root
|
---|
429 | customize_cmd cust_openvpn_dhparam
|
---|
430 | customize_cmd cust_nano_prune
|
---|
431 | customize_cmd cust_set_root_password
|
---|
432 | customize_cmd cust_apply_nanobsd_patches
|
---|
433 |
|
---|
434 | # Standard overwrite
|
---|
435 | if [ -r "$NANO_CONF_DIR/nanobsd.local" ]; then
|
---|
436 | . $NANO_CONF_DIR/nanobsd.local
|
---|
437 | fi
|
---|
438 |
|
---|
439 | # Extra config if existing is not suffient
|
---|
440 | if [ -n "$EXTRA_NANOBSD_CONFIG" ]; then
|
---|
441 | for FILE in $EXTRA_NANOBSD_CONFIG; do
|
---|
442 | # File relative to config directory
|
---|
443 | if [ "`echo $FILE | cut -c1`" != "/" ]; then
|
---|
444 | FILE=$NANO_CONF_DIR/$FILE
|
---|
445 | fi
|
---|
446 | pprint 1 "Loading $FILE"
|
---|
447 | . $FILE || exit 1
|
---|
448 | done
|
---|
449 | fi
|
---|