Version 25 (modified by 15 years ago) ( diff ) | ,
---|
Welcome to NanoBSD, FreeBSD default method for installing FreeBSD on embedded devices, like Soekris and others. The manual described below is (loosely) based on the Concept plan of Tim Baas, but also consists of many hints by 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 nanobsd
Build environment
Get yourself a fresh freebsd host with ports and subversion installed
- 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 the FreeBSD handbook Chapter 2 Installing FreeBSD if you do not know the details.
- get latest sources
csup -g -L 2 -h cvsup.nl.freebsd.org /usr/share/examples/cvsup/standard-supfile
- install subversion
pkg_add -r subversion
- fetch ports
portsnap fetch extract
- 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:
- Compile all packages below using (cd /usr/ports$DIR; make package-recursive; cp *.tbz $R/pkg
- Rerun build, saving some time, no kernel/world rebuild
sh /usr/src/tools/tools/nanobsd/nanobsd.sh -b -c $R/cfg/nanobsd.wleiden
- XXX: TODO how-to install config into image
- 1. New image: Put full image on flash disk
dd bs=64k if=/usr/obj/nanobsd.wleiden/_.disk.full of=/dev/da0
- 1. Existing image: Put partial image on slice
dd bs=64k if=/usr/obj/nanobsd.wleiden/_.disk.image of=/dev/da0s[12]
- 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)
Testing
[TestingViaNFS]
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 virtual envirionment
cvsup.nl.freebsd.org
is the local dutch cvsup mirror, replacenl
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 send an email to our techniek mailinglist