Welcome to NanoBSD, [http://www.freebsd.org/doc/en/articles/nanobsd/index.html FreeBSD default method] for installing [http://www.freebsd.org FreeBSD] on embedded devices, like [http://www.soekris.com Soekris] and others. The manual described below is (loosely) based on the [source:"doc/Concept v0.3.pdf" Concept plan of Tim Baas], but also consists of many hints by [http://www.freebsd.org/doc/en/articles/nanobsd/index.html official 'Introduction to NanoBSD' manual] = Have to remember links = * [http://people.freebsd.org/~phk/nanobsd/soekris_4x26/make.soekris_4x26.conf] * [http://www.paeps.cx/weblog/2005/Jul/10] * Active work in progress node images at [http://webfolder.wirelessleiden.nl/rick/nodefactory/] = Procedure = Please note to find the supporting files in the subdirectory [source:nanobsd] = Build environment = Get yourself a fresh freebsd host with ports and subversion installed 1. Run the basic CD installer of 7.x. Manual tested with 7.1-RELEASE (real basic install will fit our needs). Installing FreeBSD is not scope of the document, take a look into [http://www.freebsd.org/doc/en/books/handbook/install.html the FreeBSD handbook Chapter 2 Installing FreeBSD] if you do not know the details. 1. get latest sources {{{ csup -g -L 2 -h cvsup.nl.freebsd.org /usr/share/examples/cvsup/standard-supfile }}} 1. install subversion {{{ pkg_add -r subversion }}} 1. fetch ports {{{ portsnap fetch extract }}} 1. OPTIONAL, every developer has his own preferences, these are mine ;-) {{{ pkg_add -r vim-lite sudo screen }}} = Introduction = First download the environment and run initial build {{{ $ setenv R /root/nanobsd $ svn checkout http://svn.wirelessleiden.nl/svn/projects/iris/nanobsd $R $ cd $R $ sh /usr/src/tools/tools/nanobsd/nanobsd.sh -c $R/cfg/nanobsd.wleiden }}} Even the little script got flags, check the output of {{{sh /usr/src/tools/tools/nanobsd/nanobsd.sh -h}}} {{{ -b suppress builds (both kernel and world) -k suppress buildkernel -w suppress buildworld -c specify config file }}} Briefly: 1. Compile all packages below using (cd /usr/ports$DIR; make package-recursive; cp *.tbz $R/pkg 1. Rerun build, saving some time, no kernel/world rebuild {{{sh /usr/src/tools/tools/nanobsd/nanobsd.sh -b -c $R/cfg/nanobsd.wleiden}}} 1. XXX: TODO how-to install config into image 1. 1. New image: Put full image on flash disk {{{dd bs=64k if=/usr/obj/nanobsd.wleiden/_.disk.full of=/dev/da0}}} 1. 1. Existing image: Put partial image on slice {{{dd bs=64k if=/usr/obj/nanobsd.wleiden/_.disk.image of=/dev/da0s[12]}}} 1. 1. Existing image remote update (slice 2) {{{gzip -c /usr/obj/nanobsd.wleiden/_.disk.image | ssh root@10.42.0.1 'gzip | sh /tools/updatep2'}}} = WL specific = stumber, hidden gem maybe /usr/src/tools/tools/net80211/stumber Packages needed {{{ net/pen (proxy load balancer) textproc/expat2 (apache2 dependency) converters/libiconv (apache2 dependency) devel/pcre (apache2 dependency lang/perl58 (apache2 dependency) www/apache2 BATCH=yes (webserver) net-mgmt/net-snmp WITHOUT_PERL=yes (monitoring) net/isc-dhcp30-server (dhcp server) devel/pkg-config (php5 dependency) textproc/libxml2 (php5 dependency) www/php5 (webserver cgi managment scripts) devel/gettext (nagios-plugins dependency) net-mgmt/nrpe2 (nagios remote management scripts) net-mgmt/nagios-plugins (nagios remote monitoring) benchmarks/iperf (bandwidth monitoring) }}} = TODO = * XXX: Merge into tickets * XXX: Complete list/set scope * Proper unique automated SSH key generation into image * Script to generate into = Optimization choices = == Library trim, delete unused libraries === {{{ ldd -a /usr/bin/* /bin/* /sbin/* /usr/sbin/* /usr/local/bin/* /usr/local/sbin/* | awk '/=>/ {print $1}' | sort -u basename `ls -1 /lib/* /usr/lib/* /usr/local/lib/*` | sort -u > /tmp/all.txt }}} == Light based packages = * dnsmasq instead of isc-dhcp30-server and bind * thttpd instead of apache = Hints = * You could always decide to install your FreeBSD base instance into a [http://www.freebsd.org/doc/en/books/handbook/virtualization-guest.html virtual envirionment] * {{{cvsup.nl.freebsd.org}}} is the local dutch cvsup mirror, replace `nl` with your proper country code * It seems tempting to follow {{{/usr/share/examples/cvsup/stable-supfile}}} instead of {{{/usr/share/examples/cvsup/standard-supfile}}} please __DO NOT__ unless your like big trouble as stable-supfile is the stable __DEVELOPMENT__ branch e.g. upcoming stable. * Default username/password = root/welkom01 * Great mac os x terminal emulator is `screen` install using macports.org {{{$ screen /dev/tty.PL2303-0000101D 9600}}} = Comments, questions or remarks? = Feel free to edit this page or [mailto:techniek@lijst.wirelessleiden.nl?subject=NanoBSD%20odefactory%improvement send an email] to our [http://lijst.wirelessleiden.nl/mailman/listinfo/techniek techniek mailinglist]