Version 33 (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.
Please do mind that all commands below needed to be executed as root user, due to the many mounts and un-mounts done in various phases.
- get latest sources
$ csup -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
XXX: Make all paths into variables for easy reading
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
$ /root/nanobsd/tools/package-build.sh
- Set your favorite root password to be used in the image
$ setenv CFG_ROOT_PASSWORD `dd if=/dev/random bs=10k count=10 | & tr -cd '[a-zA-Z0-9]' | cut -c -15`; echo $CFG_ROOT_PASSWORD
(if you like a simple password substitute the`dd if=/dev/random bs=10k count=10 | & tr -cd '[a-zA-Z0-9]' | cut -c -15`
for your password - Build nanobsd (make sure to prepare some coffee;-) )
$ sh /usr/src/tools/tools/nanobsd/nanobsd.sh -c /root/nanobsd/cfg/nanobsd.wleiden
take a coffee, this normally 2 - 8 hours depending on the machine configuration - Fetch configuration onto image (pick your situation)
$ /root/nanobsd/tools/config-image.sh
- New image: Put full image on flash disk
$ dd bs=64k if=/usr/obj/nanobsd.wleiden/_.disk.full of=/dev/da0
(giving/dev/da0
is your compact flash entry - Existing image: Put partial image on slice (slice 2)
$ dd bs=64k if=/usr/obj/nanobsd.wleiden/_.disk.image of=/dev/da0s2
- Existing image remote update (slice 2)
$ gzip -c /usr/obj/nanobsd.wleiden/_.disk.image | ssh root@192.168.4.100 'gzip | sh /tools/updatep2'
- New image: Put full image on flash disk
- All done! Place the image in the new machine and boot it up, you should be good to go!
- For next nodes you can skip the build if you are not going to use the same image again and go directly for step 4
Development
For small changes there is a shortcut in the build (to save you some coffee ;-)). Pick the situation applicable
- First lets pump it's source to the latest version
$ svn up /root/nanobsd
- Only changes in kernel options -
kernel.wleiden
altered - ETA 0:45$ sh /usr/src/tools/tools/nanobsd/nanobsd.sh -w -c /root/nanobsd/cfg/nanobsd.wleiden }} a. Only changes in world options - {{{CONF_{BUILD,COMMON,INSTALL}}}} in {{{nanobsd.wleiden}}} altered - ETA 2:00 - 6:00 {{{ $ sh /usr/src/tools/tools/nanobsd/nanobsd.sh -k -c /root/nanobsd/cfg/nanobsd.wleiden }}} a. _NO_ changes in build options - any other file altered - ETA 0:10 {{{ $ sh /usr/src/tools/tools/nanobsd/nanobsd.sh -b -c /root/nanobsd/cfg/nanobsd.wleiden }}} = WL specific = stumber, hidden gem maybe /usr/src/tools/tools/net80211/stumber Packages needed are to be found in svn:/tools/package-build.sh = Testing = [wiki:TestingViaNFS] == 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 environment] * {{{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 * Always use `cu` or `putty` for serial communication minicom, screen, putty all issues of some kind. = 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] * Handy .cshrc hints {{{ alias quicknano sudo -E sh /usr/src/tools/tools/nanobsd/nanobsd.sh -b -c /root/nanobsd/cfg/nanobsd.wleiden alias slownano sudo -E sh /usr/src/tools/tools/nanobsd/nanobsd.sh -c /root/nanobsd/cfg/nanobsd.wleiden alias slownewkernelnano sudo -E sh /usr/src/tools/tools/nanobsd/nanobsd.sh -w -c /root/nanobsd/cfg/nanobsd.wleiden alias slownewworldnano sudo -E sh /usr/src/tools/tools/nanobsd/nanobsd.sh -k -c /root/nanobsd/cfg/nanobsd.wleiden alias prepare-nfs sudo -E /root/nanobsd/tools/prepare-nfs.sh -f -n }}}
- Only changes in kernel options -