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