Changes between Version 26 and Version 27 of NanoBSD


Ignore:
Timestamp:
Jun 18, 2009, 10:18:17 PM (16 years ago)
Author:
rick
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NanoBSD

    v26 v27  
    1414 Get yourself a fresh freebsd host with ports and subversion installed
    1515 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.
    16  1. get latest sources {{{ csup -g -L 2 -h cvsup.nl.freebsd.org /usr/share/examples/cvsup/standard-supfile }}}
     16
     17Please 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.
     18
     19 1. get latest sources {{{ csup  -h cvsup.nl.freebsd.org /usr/share/examples/cvsup/standard-supfile }}}
    1720 1. install subversion {{{ pkg_add -r subversion }}}
    1821 1. fetch ports {{{ portsnap fetch extract }}}
     
    2023
    2124= Introduction =
     25XXX: Make all paths into variables for easy reading
    2226First download the environment and run initial build
    2327{{{
     
    3438-w suppress buildworld
    3539-c specify config file
     40...
    3641}}}
    3742
    3843Briefly:
    39  1. Compile all packages below using (cd /usr/ports$DIR; make package-recursive; cp *.tbz $R/pkg
    40  1. Rerun build, saving some time, no kernel/world rebuild {{{sh /usr/src/tools/tools/nanobsd/nanobsd.sh -b -c $R/cfg/nanobsd.wleiden}}}
    41  1. XXX: TODO how-to install config into image
    42  1. 1. New image: Put full image on flash disk {{{dd bs=64k if=/usr/obj/nanobsd.wleiden/_.disk.full of=/dev/da0}}}
    43  1. 1. Existing image: Put partial image on slice {{{dd bs=64k if=/usr/obj/nanobsd.wleiden/_.disk.image of=/dev/da0s[12]}}}
    44  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'}}}
    45 
     44 1. Compile all packages below using {{{$ /root/nanobsd/tools/package-build.sh}}}
     45 1. Set your favorite root password to be used in the image
     46 {{{
     47 $ 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
     48 }}}
     49 (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
     50 1. Build nanobsd (make sure to prepare some coffee;-) )
     51 {{{
     52 $ sh /usr/src/tools/tools/nanobsd/nanobsd.sh -c /root/nanobsd/cfg/nanobsd.wleiden
     53 }}}
     54 take a coffee, this normally 2 - 8 hours depending on the machine configuration
     55 1. Fetch configuration onto image (pick your situation)
     56 {{{
     57 $ /root/nanobsd/tools/config-image.sh
     58 }}}
     59    a. New image: Put full image on flash disk
     60    {{{
     61    $ dd bs=64k if=/usr/obj/nanobsd.wleiden/_.disk.full of=/dev/da0
     62    }}}
     63    (giving {{{/dev/da0}}} is your compact flash entry
     64    a. Existing image: Put partial image on slice
     65    {{{
     66    $ dd bs=64k if=/usr/obj/nanobsd.wleiden/_.disk.image of=/dev/da0s[12]
     67    }}}
     68    a. Existing image remote update (slice 2)
     69    {{{
     70    $ gzip -c /usr/obj/nanobsd.wleiden/_.disk.image | ssh root@10.42.0.1 'gzip | sh /tools/updatep2'
     71    }}}
     72 1. All done! Place the image in the new machine and boot it up, you should be good to go!
     73 1. 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
     74 
     75= Development =
     76 For small changes there is a shortcut in the build (to save you some coffee ;-)). Pick the situation applicable
     77 1. First lets pump it's source to the latest version
     78 {{{
     79 $ svn up /root/nanobsd
     80 }}}
     81    a. Only changes in kernel options - rarely done {{{kernel.wleiden}}} altered - ETA 0:45
     82    {{{
     83    $ sh /usr/src/tools/tools/nanobsd/nanobsd.sh -w -c /root/nanobsd/cfg/nanobsd.wleiden
     84    }}}
     85    a. Only changes in world options - rarely done {{{CONF_WORLD}}} in  {{{nanobsd.wleiden}}} altered - ETA 2:00 - 6:00
     86    {{{
     87    $ sh /usr/src/tools/tools/nanobsd/nanobsd.sh -k -c /root/nanobsd/cfg/nanobsd.wleiden
     88    }}}
     89    a. _NO_ changes in build options - ETA 0:10
     90    {{{
     91    $ sh /usr/src/tools/tools/nanobsd/nanobsd.sh -b -c /root/nanobsd/cfg/nanobsd.wleiden
     92    }}}
    4693= WL specific =
    4794stumber, hidden gem maybe /usr/src/tools/tools/net80211/stumber
    4895
    49 Packages needed
    50 {{{
    51 net/pen (proxy load balancer)
    52 
    53 textproc/expat2 (apache2 dependency)
    54 converters/libiconv (apache2 dependency)
    55 devel/pcre (apache2 dependency
    56 lang/perl58 (apache2 dependency)
    57 www/apache2 BATCH=yes (webserver)
    58 net-mgmt/net-snmp WITHOUT_PERL=yes (monitoring)
    59 net/isc-dhcp30-server (dhcp server)
    60 devel/pkg-config (php5 dependency)
    61 textproc/libxml2 (php5 dependency)
    62 www/php5 (webserver cgi managment scripts)
    63 devel/gettext (nagios-plugins dependency)
    64 net-mgmt/nrpe2 (nagios remote management scripts)
    65 net-mgmt/nagios-plugins (nagios remote monitoring)
    66 benchmarks/iperf (bandwidth monitoring)
    67 
    68 }}}
     96Packages needed are to be found in svn:/tools/package-build.sh
    6997
    7098= Testing =
    7199 [wiki:TestingViaNFS]
    72100
    73 = TODO =
    74  * XXX: Merge into tickets
    75  * XXX: Complete list/set scope
    76  * Proper unique automated SSH key generation into image
    77  * Script to generate into
    78 
    79 
    80 = Optimization choices =
    81 == Library trim, delete unused libraries ===
    82 {{{
    83 ldd -a /usr/bin/* /bin/* /sbin/* /usr/sbin/* /usr/local/bin/* /usr/local/sbin/* | awk '/=>/ {print $1}' | sort -u
    84 basename `ls -1 /lib/* /usr/lib/* /usr/local/lib/*` | sort -u > /tmp/all.txt
    85 }}}
    86101
    87102== Light based packages =
     
    91106
    92107= Hints =
    93  * 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]
     108 * 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]
    94109 * {{{cvsup.nl.freebsd.org}}} is the local dutch cvsup mirror, replace `nl` with your proper country code
    95110 * 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.
    96111 * Default username/password = root/welkom01
    97  * Great mac os x terminal emulator is `screen` install using macports.org {{{$ screen /dev/tty.PL2303-0000101D 9600}}}
     112 * Always use {{{cu}}} or {{{hyperterminal}} for serial communication minicom, screen, putty all issues of some kind
    98113= Comments, questions or remarks? =
    99114Feel 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]
     115 * Handy .cshrc hints
     116{{{
     117alias quicknano sudo -E sh /usr/src/tools/tools/nanobsd/nanobsd.sh -b -c /root/nanobsd/cfg/nanobsd.wleiden
     118alias slownano sudo -E sh /usr/src/tools/tools/nanobsd/nanobsd.sh -c /root/nanobsd/cfg/nanobsd.wleiden
     119alias slownewkernelnano sudo -E sh /usr/src/tools/tools/nanobsd/nanobsd.sh -w -c /root/nanobsd/cfg/nanobsd.wleiden
     120alias slownewworldnano sudo -E sh /usr/src/tools/tools/nanobsd/nanobsd.sh -k -c /root/nanobsd/cfg/nanobsd.wleiden
     121alias prepare-nfs sudo -E /root/nanobsd/tools/prepare-nfs.sh -f -n
     122}}}