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_TOOLS=$(pwd)
|
---|
16 | NANO_KERNEL=$NANO_CONF_DIR/kernel.wleiden # naam van het kernel configuratiebestand
|
---|
17 | NANO_IMAGES=2 # aantal nanobsd code slices/installs (1/2)
|
---|
18 |
|
---|
19 | NANO_CONFSIZE=20480 # Volume van de config slice (10MB) in 512bs
|
---|
20 | NANO_DATASIZE=0 # volume van de data slice, 0 = not configured
|
---|
21 | NANO_CODESIZE=819200 # Let buildscript the operating system slice as large as posible
|
---|
22 |
|
---|
23 | # Size of the /etc ramdisk in 512 bytes sectors
|
---|
24 | NANO_RAM_ETCSIZE=20480
|
---|
25 |
|
---|
26 | NANO_RAM_TMPVARSIZE=102400 # Volume of combined var & tmp slice (50MB) in 512bs
|
---|
27 |
|
---|
28 | NANO_LABEL=WLIMG
|
---|
29 | NANO_NEWFS="-b 4096 -f 512 -i 8192" # Overwrite the default stettings to disable Soft-updates
|
---|
30 |
|
---|
31 |
|
---|
32 | #XXX: Eeks, fixed packages, needs building a hook to allow building the package
|
---|
33 | # of the shelfs if needed, copy to right directory, done. With only input needed
|
---|
34 | # a list of ports in the format like net/net-snmp
|
---|
35 | NANO_PACKAGE_DIR=$NANO_CONF_DIR/../pkg/All
|
---|
36 | NANO_PACKAGE_LIST="*"
|
---|
37 |
|
---|
38 | VERSION=$(uname -r | sed -e 's/-.*//g' -e 's/\./_/')
|
---|
39 | NANO_PACKAGE_REPOS="/usr/local/poudriere/data/packages/wlpkgbuild${VERSION}-default-node/"
|
---|
40 |
|
---|
41 |
|
---|
42 | # Wireless Leiden ports from $WL_PORTSDIR are copied OVER $PORTSDIR
|
---|
43 | PORTSDIR='/usr/ports'
|
---|
44 | WL_PORTSDIR="$NANO_CONF_DIR/../ports/"
|
---|
45 |
|
---|
46 | # Dirty quirk to allow comments in part below
|
---|
47 | PACKAGE_LIST=`cat <<EOF | sed -e 's/#.*$//g' | xargs
|
---|
48 | benchmarks/iperf
|
---|
49 | devel/py-Jinja2
|
---|
50 | devel/py-yaml
|
---|
51 | editors/vim-lite
|
---|
52 | dns/dnsmasq
|
---|
53 | dns/nsd
|
---|
54 | dns/unbound
|
---|
55 | ftp/curl
|
---|
56 | lang/python2
|
---|
57 | lang/python
|
---|
58 | net/ladvd
|
---|
59 | net-mgmt/iftop
|
---|
60 | net-mgmt/net-snmp
|
---|
61 | net/mtr
|
---|
62 | net/isc-dhcp43-server
|
---|
63 | net/pen
|
---|
64 | net/py-speedtest-cli
|
---|
65 | ports-mgmt/pkg
|
---|
66 | security/sudo
|
---|
67 | security/ca_root_nss
|
---|
68 | sysutils/screen
|
---|
69 | sysutils/ucspi-tcp
|
---|
70 | www/apache24
|
---|
71 | www/tinyproxy
|
---|
72 |
|
---|
73 | # Extra WL ports
|
---|
74 | net/lvrouted
|
---|
75 | `
|
---|
76 | # Package target
|
---|
77 | PKG_MAKE_ARGS="PACKAGES=$(dirname $NANO_PACKAGE_DIR) BATCH=yes PACKAGE_BUILDING=yes"
|
---|
78 |
|
---|
79 | PKG_MAKE_CONF="
|
---|
80 | # www/py-cherrypy - include apache templating
|
---|
81 | # net-mgmt/net-snmp - no perl please (size)
|
---|
82 | # net-mgmt/nagios-plugins - no threading (single CPU)
|
---|
83 | # shells/bash-static - logging via syslog
|
---|
84 | # net/mtr - no X11 (no screen)
|
---|
85 | # lang/ocaml - no TK support (requires X11)
|
---|
86 | # devel/ocaml-findlib - no TOOLBOX support (requires ocaml with TK support)
|
---|
87 | OPTIONS_SET= APACHE FPING SYSLOG
|
---|
88 | OPTIONS_UNSET= PERL PERL_EMBEDDED X11 TK TOOLBOX
|
---|
89 | "
|
---|
90 |
|
---|
91 | ##NANO_PACKAGE_LIST=
|
---|
92 |
|
---|
93 | # Warning: set to 1 to debug make build errors
|
---|
94 | # Number of recurrent parrallel make builds
|
---|
95 | if `grep -q 'acpi0: <PRLS PRLS_OEM> on motherboard' /var/run/dmesg.boot`; then
|
---|
96 | # Mac OS X Parallels virtual machine
|
---|
97 | NANO_PMAKE="make -B"
|
---|
98 | else
|
---|
99 | # Default 2 times number of CPU's inside machine
|
---|
100 | NANO_PARALLEL_MAKE=`expr $(sysctl -n hw.ncpu) \* 2`
|
---|
101 | NANO_PMAKE="make -j ${NANO_PARALLEL_MAKE}"
|
---|
102 | fi
|
---|
103 |
|
---|
104 | # Starting from soekris bios version 1.31 upwards boot0sio does not seems work
|
---|
105 | # anymore, but boot0 does (weird)
|
---|
106 | NANO_BOOTLOADER="boot/boot0"
|
---|
107 |
|
---|
108 | # Strip down to a more acceptable size
|
---|
109 | # hints from http://people.freebsd.org/~phk/nanobsd/soekris_4x26/make.soekris_4x26.conf (46MB)
|
---|
110 | NANO_PRUNE="$NANO_PRUNE usr/share/examples"
|
---|
111 | NANO_PRUNE="$NANO_PRUNE usr/share/syscons"
|
---|
112 | NANO_PRUNE="$NANO_PRUNE usr/share/calendar"
|
---|
113 | # NB! usr/share/misc contains termcap, vi(1) etc fails to work without it.
|
---|
114 | # NANOBSD_PRUNE += usr/share/misc
|
---|
115 | NANO_PRUNE="$NANO_PRUNE usr/share/pcvt"
|
---|
116 | NANO_PRUNE="$NANO_PRUNE usr/share/me"
|
---|
117 | NANO_PRUNE="$NANO_PRUNE usr/share/doc"
|
---|
118 | # Debugging removal
|
---|
119 | NANO_PRUNE="$NANO_PRUNE usr/lib/debug"
|
---|
120 | NANO_PRUNE="$NANO_PRUNE usr/tests"
|
---|
121 | # Installed ports strip down
|
---|
122 | NANO_PRUNE="$NANO_PRUNE usr/local/share/doc"
|
---|
123 | NANO_PRUNE="$NANO_PRUNE usr/local/share/examples"
|
---|
124 |
|
---|
125 |
|
---|
126 |
|
---|
127 |
|
---|
128 |
|
---|
129 | # Opties parsed gedurende build & install world
|
---|
130 | # Also check man 5 src.conf for details
|
---|
131 | # Some flags are misleading, e.g. could only be installworld (e.g.), for details:
|
---|
132 | # http://phk.freebsd.dk/misc/build_options/
|
---|
133 | # For details on make options also check:
|
---|
134 | # /usr/src/share/mk/bsd.own.mk
|
---|
135 | CONF_COMMON='
|
---|
136 | # Specific enabled options
|
---|
137 | #WITHOUT_ACPI=YES # geen advanced configuration power interface
|
---|
138 | #WITHOUT_BIND=YES # geen bind tools, dns/named geinstalleerd
|
---|
139 | #WITHOUT_CXX=YES # Set to not build g++(1) and related libraries.
|
---|
140 | #WITHOUT_GROFF=YES # Set to not build groff(1).
|
---|
141 | #WITHOUT_INET6=YES # geen ondersteuning inet versie 6 architectuur
|
---|
142 | #WITHOUT_INFO=YES # geen info bestanden, readable online docs
|
---|
143 | #WITHOUT_IPFILTER=YES # geen ip filtering geinstalleerd
|
---|
144 | #WITHOUT_KLDLOAD=YES # do not allow loading of kernel modules
|
---|
145 | #WITHOUT_MAILWRAPPER=YES # geen mailwrapper bij gebruik sendmail
|
---|
146 | #WITHOUT_MAN=YES # geen handleidingen gecompileerd
|
---|
147 | #WITHOUT_MISC=YES # geen misc sub directory
|
---|
148 | #WITHOUT_MODULES=YES # geen ondersteuning toevoegen modules
|
---|
149 | #WITHOUT_PAM=YES # geen ondersteuning pa modules
|
---|
150 | #WITHOUT_PF=YES # geen packet filtering geinstalleerd
|
---|
151 | #WITHOUT_SHARE=YES # geen share sub directory
|
---|
152 | #WITHOUT_USB=YES # geen ondersteuning usb modules
|
---|
153 | # Specific disabled options
|
---|
154 | WITHOUT_ATM=YES # geen ondersteuning Asynchronous Transfer Mode
|
---|
155 | WITHOUT_AUDIT=YES # geen event auditing / audit trails
|
---|
156 | WITHOUT_AUTHPF=YES # geen authenticating gateway user shell
|
---|
157 | WITHOUT_BLUETOOTH=YES # geen ondersteuning Bluetooth modules
|
---|
158 | WITHOUT_CALENDAR=YES # geen calendar reminder service gecompileerd
|
---|
159 | WITHOUT_CDDL=YES # Set to not build code licensed under Sun CDDL. (also ZFS)
|
---|
160 | WITHOUT_CPP=YES # Set to not build cpp(1).
|
---|
161 | WITHOUT_CXX=YES # Set to not build c++(1) and related libraries.
|
---|
162 | WITHOUT_CLANG=YES # Set to not build the Clang C/C++ compiler.
|
---|
163 | WITHOUT_CVS=YES # geen cvs tools geinstalleerd
|
---|
164 | WITHOUT_DICT=YES # geen dictionary ondersteuning
|
---|
165 | WITHOUT_EXAMPLES=YES # geen voorbeeld configuratiebestanden
|
---|
166 | WITHOUT_FORTRAN=YES # geen ondersteuning fortran compilers
|
---|
167 | WITHOUT_GAMES=YES # geen games gecompileerd
|
---|
168 | WITHOUT_GCOV=YES # geen gcov test coverage program
|
---|
169 | WITHOUT_GDB=YES # geen gnu debugger gecompileerd
|
---|
170 | WITHOUT_GPIB=YES # geen ondersteuning gpib kaarten
|
---|
171 | WITHOUT_HTML=YES # geen html help bestanden gecompileerd
|
---|
172 | WITHOUT_I4B=YES # geen ondersteuning voor isdn
|
---|
173 | WITHOUT_ICONV=YES # No iconv support (no need to support native files)
|
---|
174 | WITHOUT_IPX=YES # geen ondersteuning ipx protocols
|
---|
175 | WITHOUT_KERBEROS=YES # geen ondersteuning Kerberos authenticatie
|
---|
176 | WITHOUT_LOCALES=YES # geen ondersteuning lokalisatie
|
---|
177 | WITHOUT_LPR=YES # geen ondersteuning print services
|
---|
178 | WITHOUT_NIS=YES # geen ondersteuning network information system
|
---|
179 | WITHOUT_PROFILE=YES # Set to avoid compiling profiled libraries.
|
---|
180 | WITHOUT_RCMDS=YES # geen ondersteuning rcmds,
|
---|
181 | WITHOUT_RESCUE=YES # geen rescue bestanden gecompileerd
|
---|
182 | WITHOUT_SENDMAIL=YES # geen sendmail geinstalleerd
|
---|
183 | WITHOUT_SHAREDOCS=YES # geen share/docs directories
|
---|
184 | WITHOUT_SSP=YES # Set to not build world with propolice stack smashing protection.
|
---|
185 | WITHOUT_SYSCONS=YES # geen syscon devices gecompileerd
|
---|
186 | WITHOUT_UNBOUND=YES # Port version will be used if any is used
|
---|
187 | WITHOUT_LOCALES=YES # No localization support
|
---|
188 | '
|
---|
189 |
|
---|
190 | CONF_BUILD="
|
---|
191 | ${CONF_COMMON}
|
---|
192 | "
|
---|
193 |
|
---|
194 | CONF_INSTALL="
|
---|
195 | ${CONF_COMMON}
|
---|
196 | WITHOUT_TOOLCHAIN=YES # geen freebsd toolchain
|
---|
197 | "
|
---|
198 |
|
---|
199 |
|
---|
200 | # Flash disks arrived, sandisk 1g seems to match the geometry of the (blanc) cards
|
---|
201 | #FlashDevice sandisk 1g # nanobsd flashdevice entry
|
---|
202 | #FlashDevice sandisk 512mb # nanobsd flashdevice entry
|
---|
203 | #FlashDevice transcend 2g # nanobsd flashdevice entry
|
---|
204 | # Calculated value of PEAK hardware 1GB CF card
|
---|
205 | # C/H/S phys 1954/16/63, logical 977/32/63
|
---|
206 | # Mediasize is calculated as C*H*S*512
|
---|
207 |
|
---|
208 | # Using logical values reported by ALIX board
|
---|
209 | # values for PCEngines blanc 1 GB cards
|
---|
210 | # C/H/S phys 1966/16/63, logical 983/32/63
|
---|
211 | NANO_MEDIASIZE=`expr 1008451584 / 512`
|
---|
212 | NANO_HEADS=32
|
---|
213 | NANO_SECTS=63
|
---|
214 |
|
---|
215 |
|
---|
216 | # Version tagging
|
---|
217 | cust_version_tag() (
|
---|
218 | VERSION_FILE="${NANO_WORLDDIR}/tools/wl-release.txt"
|
---|
219 | (
|
---|
220 | echo "Generated by `id -un`@`hostname -f` at `date`"
|
---|
221 | echo ""
|
---|
222 | echo "=== CONFIG specifics ==="
|
---|
223 | svn info ${NANO_CONF_DIR}/../ || exit 0
|
---|
224 | svn diff ${NANO_CONF_DIR}/../ || exit 0
|
---|
225 | echo "=== BEGIN CONFIG specifics ==="
|
---|
226 | ) > $VERSION_FILE
|
---|
227 | )
|
---|
228 |
|
---|
229 | # Takes a very long time (10+) minutes to generate this file on an ALIX board,
|
---|
230 | # not practical for quick debugging and configuration.
|
---|
231 | cust_openvpn_dhparam() (
|
---|
232 | if [ -r ${NANO_CONF_DIR}/usr/local/bin/openvpn ]; then
|
---|
233 | DHFILE=${NANO_WORLDDIR}/etc/easy-rsa-keys/dh1024.pem
|
---|
234 | mkdir -p `dirname $DHFILE`
|
---|
235 | openssl dhparam -out $DHFILE 1024
|
---|
236 | fi
|
---|
237 | )
|
---|
238 |
|
---|
239 | # Unbound is running in alternative chroot location (port default) how-ever
|
---|
240 | # this directory needs to be writeable by unbound for key generation etc.
|
---|
241 | cust_unbound_rights() (
|
---|
242 | if [ -r ${NANO_WORLDDIR}/usr/local/etc/unbound ]; then
|
---|
243 | chroot ${NANO_WORLDDIR} sh -c "chown unbound:unbound /usr/local/etc/unbound"
|
---|
244 | fi
|
---|
245 | )
|
---|
246 |
|
---|
247 |
|
---|
248 | # Assuming we are running a safe envirionment where snooping could occur during or after the build
|
---|
249 | cust_set_root_password() (
|
---|
250 | if [ -n "${CFG_ROOT_PASSWORD}" ]; then
|
---|
251 | pprint 2 "Set root password using CFG_ROOT_PASSWORD variable"
|
---|
252 | chroot ${NANO_WORLDDIR} sh -c "echo '${CFG_ROOT_PASSWORD}' | pw usermod -h 0 -n root"
|
---|
253 | else
|
---|
254 | pprint 2 "Root password is <blank>, no password provided at variable CFG_ROOT_PASSWORD"
|
---|
255 | fi
|
---|
256 | )
|
---|
257 |
|
---|
258 |
|
---|
259 |
|
---|
260 | # EXPERIMENTAL patch like envirionment
|
---|
261 | # Using '*-nanobsd.patch' files to only specify the bare differences between the base/default file to
|
---|
262 | # keep us as close as possible to the base OS
|
---|
263 | # Patches are applied to the directory they live in
|
---|
264 | #cust_apply_nanobsd_patches() (
|
---|
265 | # for PATCHFILE in `find ${NANO_WORLDDIR} -regex '.*-nanobsd\.patch$'`; do
|
---|
266 | # cd `dirname ${PATCHFILE}`
|
---|
267 | # patch -t -N -p0 -i `basename ${PATCHFILE}`
|
---|
268 | # #XX: What to with installed patch files? Delete them for the time beeing
|
---|
269 | # rm -v ${PATCHFILE}
|
---|
270 | #done
|
---|
271 |
|
---|
272 |
|
---|
273 |
|
---|
274 | #)
|
---|
275 |
|
---|
276 |
|
---|
277 |
|
---|
278 | # Customize ntpd
|
---|
279 | cust_ntpd() (
|
---|
280 | chroot ${NANO_WORLDDIR} sh -c "ln -fs /usr/local/etc/ntp.drift /var/db/ntp.drift"
|
---|
281 | )
|
---|
282 |
|
---|
283 |
|
---|
284 | # Enable Serial TTYs
|
---|
285 | cust_serial_ttys() (
|
---|
286 | chroot ${NANO_WORLDDIR} sed -i '' -e '/ttyv[0-9]/s/on /off/' -e '/ttyu0/s/off/on/' -e '/ttyu0/s/dialup/ansi/' /etc/ttys
|
---|
287 |
|
---|
288 | # Serial login is consided to be phycically secured, so no credentials are required
|
---|
289 | chroot ${NANO_WORLDDIR} sed -i '' -e '/ttyu0/s/std.9600/al.9600/' /etc/ttys
|
---|
290 | )
|
---|
291 |
|
---|
292 | # Customize sudoers files
|
---|
293 | cust_sudo_rules() {
|
---|
294 | chroot ${NANO_WORLDDIR} find /usr/local/etc/sudoers.d/ -type f -exec chmod 0640 {} \+
|
---|
295 | }
|
---|
296 |
|
---|
297 |
|
---|
298 |
|
---|
299 | # Install files from specific relative location
|
---|
300 | cust_install_files () (
|
---|
301 | cd ${NANO_CONF_DIR}/../files
|
---|
302 | find . -print | grep -v -e /CVS -e .svn | cpio -dumpv ${NANO_WORLDDIR}
|
---|
303 | )
|
---|
304 |
|
---|
305 |
|
---|
306 | # Make tools available for root by default
|
---|
307 | cust_root_bin_to_tools() {
|
---|
308 | ln -s /tools ${NANO_WORLDDIR}/root/bin
|
---|
309 | }
|
---|
310 |
|
---|
311 |
|
---|
312 | # Prune no needed directories of image
|
---|
313 | cust_nano_prune () (
|
---|
314 | cd ${NANO_WORLDDIR}
|
---|
315 | for ENTRY in ${NANO_PRUNE}; do
|
---|
316 | rm -vfR ${ENTRY}
|
---|
317 | done
|
---|
318 | )
|
---|
319 |
|
---|
320 | # We actually do need an seperate /tmp, so undo the symlinking done in
|
---|
321 | # setup_nanobsd()
|
---|
322 | late_cust_unset_common_var_and_tmp() (
|
---|
323 | cd ${NANO_WORLDDIR}
|
---|
324 | rm tmp
|
---|
325 | mkdir -m 1777 tmp
|
---|
326 | )
|
---|
327 |
|
---|
328 |
|
---|
329 | # Fill /cfg wmth custom files, based on 'create_i386_diskimage ( )'
|
---|
330 | last_nano_fill_cfg () (
|
---|
331 | # Variables to be used
|
---|
332 | IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME}
|
---|
333 | MNT=${MAKEOBJDIRPREFIX}/_.mnt
|
---|
334 |
|
---|
335 | # Mount '/cfg' slize in image
|
---|
336 | MD=`mdconfig -a -t vnode -f ${IMG}`
|
---|
337 | mount /dev/${MD}s3 ${MNT}
|
---|
338 |
|
---|
339 | # Location of '/cfg' directory
|
---|
340 | cd ${NANO_CONF_DIR}/../cfg-files
|
---|
341 | find . -print | grep -v -e /CVS -e .svn | cpio -dumpv ${MNT}
|
---|
342 |
|
---|
343 |
|
---|
344 | # Leave in nice end state
|
---|
345 | umount ${MNT}
|
---|
346 | mdconfig -d -u ${MD}
|
---|
347 | ) > ${MAKEOBJDIRPREFIX}/_.fc 2>&1
|
---|
348 |
|
---|
349 | last_nano_disk_usage () (
|
---|
350 | # Variables to be used
|
---|
351 | IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME}
|
---|
352 | MNT=${MAKEOBJDIRPREFIX}/_.mnt
|
---|
353 |
|
---|
354 | # Mount root slize
|
---|
355 | MD=`mdconfig -a -t vnode -f ${IMG}`
|
---|
356 | mount /dev/${MD}s1a ${MNT}
|
---|
357 |
|
---|
358 | # Show disk usage (percent free) inc header
|
---|
359 | pprint 2 $(df -h | head -1)
|
---|
360 | pprint 2 "$(df -h | grep /dev/${MD})"
|
---|
361 |
|
---|
362 | # Leave in nice end state
|
---|
363 | umount ${MNT}
|
---|
364 | mdconfig -d -u ${MD}
|
---|
365 | )
|
---|
366 |
|
---|
367 |
|
---|
368 | cust_pkgng () (
|
---|
369 |
|
---|
370 | # If the package directory doesn't exist, we're done.
|
---|
371 | if [ ! -d ${NANO_PACKAGE_REPOS} ]; then
|
---|
372 | echo "DONE 0 packages"
|
---|
373 | return 0
|
---|
374 | fi
|
---|
375 |
|
---|
376 | # Find a pkg-* package
|
---|
377 | if [ -z "${NANO_PACKAGE_REPOS}/Latest/pkg.txz" ]; then
|
---|
378 | echo "FAILED: need a pkg/ package for bootstrapping"
|
---|
379 | exit 2
|
---|
380 | fi
|
---|
381 |
|
---|
382 | # Replicate the packages into the NanoBSD world (as hard links) so we can
|
---|
383 | # access them from the chroot in which pkg is being run.
|
---|
384 | cp -lpR ${NANO_PACKAGE_REPOS} ${NANO_WORLDDIR}/Repos
|
---|
385 |
|
---|
386 | #Bootstrap pkg
|
---|
387 | CR env ASSUME_ALWAYS_YES=YES SIGNATURE_TYPE=none /usr/sbin/pkg add /Repos/Latest/pkg.txz
|
---|
388 | CR pkg -N >/dev/null 2>&1
|
---|
389 | if [ "$?" -ne "0" ]; then
|
---|
390 | echo "FAILED: pkg bootstrapping faied"
|
---|
391 | exit 2
|
---|
392 | fi
|
---|
393 |
|
---|
394 | mkdir -p ${NANO_WORLDDIR}/usr/local/etc/pkg/repos
|
---|
395 | echo "FreeBSD: { enabled: no }" > ${NANO_WORLDDIR}/usr/local/etc/pkg/repos/FreeBSD.conf
|
---|
396 |
|
---|
397 | # Generate a reference to our local repository
|
---|
398 | cat > ${NANO_WORLDDIR}/usr/local/etc/pkg/repos/LOCAL.conf <<-EOF
|
---|
399 | LOCAL: {
|
---|
400 | url : file:///Repos
|
---|
401 | enabled : yes
|
---|
402 | mirror_type : none
|
---|
403 | signature_type : none
|
---|
404 | }
|
---|
405 | EOF
|
---|
406 |
|
---|
407 |
|
---|
408 | # Count & report how many we have to install
|
---|
409 | todo=`echo ${PACKAGE_LIST} | /usr/bin/wc -l`
|
---|
410 | todo=$(expr $todo + 1) # add one for pkg since it is installed already
|
---|
411 | echo "=== TODO: $todo"
|
---|
412 | echo "${PACKAGE_LIST}"
|
---|
413 | echo "==="
|
---|
414 | for PKG in ${PACKAGE_LIST}
|
---|
415 | do
|
---|
416 | CR env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg install $PKG
|
---|
417 | done
|
---|
418 | rm -rf ${NANO_WORLDDIR}/Repos
|
---|
419 | )
|
---|
420 |
|
---|
421 | last_orders () (
|
---|
422 | last_nano_fill_cfg
|
---|
423 | last_nano_disk_usage
|
---|
424 | )
|
---|
425 |
|
---|
426 | # Ugly hack to 'escaping' pprint from inside a customize_cmd to output
|
---|
427 | # instead of a file
|
---|
428 | exec 3>/dev/stdout
|
---|
429 | # Progress Print
|
---|
430 | # Print $2 at level $1
|
---|
431 | pprint() {
|
---|
432 | if [ "$1" -le $PPLEVEL ]; then
|
---|
433 | printf "%.${1}s %s\n" "#####" "$2" 1>&3
|
---|
434 | fi
|
---|
435 | }
|
---|
436 |
|
---|
437 | # Cust macro`s gestart in onderstaande volgorde
|
---|
438 | # XXX: Determine size before installing all find of additions to see how much
|
---|
439 | # base we are actually using ## du -h -d 0
|
---|
440 | customize_cmd cust_pkgng
|
---|
441 | customize_cmd cust_install_files
|
---|
442 | customize_cmd cust_ntpd
|
---|
443 | customize_cmd cust_serial_ttys
|
---|
444 | customize_cmd cust_version_tag
|
---|
445 | customize_cmd cust_root_bin_to_tools
|
---|
446 | customize_cmd cust_allow_ssh_root
|
---|
447 | customize_cmd cust_openvpn_dhparam
|
---|
448 | customize_cmd cust_nano_prune
|
---|
449 | customize_cmd cust_set_root_password
|
---|
450 | customize_cmd cust_sudo_rules
|
---|
451 | customize_cmd cust_unbound_rights
|
---|
452 | #customize_cmd cust_apply_nanobsd_patches
|
---|
453 | late_customize_cmd late_cust_unset_common_var_and_tmp
|
---|
454 |
|
---|
455 | # Standard overwrite
|
---|
456 | if [ -r "$NANO_CONF_DIR/nanobsd.local" ]; then
|
---|
457 | . $NANO_CONF_DIR/nanobsd.local
|
---|
458 | fi
|
---|
459 |
|
---|
460 | # Extra config if existing is not suffient
|
---|
461 | if [ -n "$EXTRA_NANOBSD_CONFIG" ]; then
|
---|
462 | for FILE in $EXTRA_NANOBSD_CONFIG; do
|
---|
463 | # File relative to config directory
|
---|
464 | if [ "`echo $FILE | cut -c1`" != "/" ]; then
|
---|
465 | FILE=$NANO_CONF_DIR/$FILE
|
---|
466 | fi
|
---|
467 | pprint 1 "Loading $FILE"
|
---|
468 | . $FILE || exit 1
|
---|
469 | done
|
---|
470 | fi
|
---|