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