diff -urN flashboot.old/README flashboot/README
--- flashboot.old/README	Sat Aug 26 20:08:25 2006
+++ flashboot/README	Tue Aug 29 14:57:47 2006
@@ -93,7 +93,7 @@
 execute it, it will build the dynamic release in the current dir.
 If you are storing your src & sys-folders somewhere else, then
 you will have to edit build-release.sh. This build can take a very
-long time. (Make sure you run this in the flashdist-directory
+long time. (Make sure you run this in the flashdist-directory)
 
     # ./build-release.sh
 
@@ -115,41 +115,63 @@
 Customisation
 -------------
 
-This system is customised to _my_ needs, but is general enough
-to be (IMO) useful to others. The most likely change will be the
-kernel configuration. It is probably best that different kernel
-configurations be derived from the GENERIC-RD template provided. Once
-a derivative kernel config has been created, modify the KERNEL
-variable in the Makefile to specify its filename.
+The system support customisation in three different ways.
 
-A couple of caveats regarding kernel customisation: First, if your
-kernel+ramdisk blob is larger than 16Mb, then you will need to increase
-NKPTP in the kernel config (just uncomment the entry in the file, it's
-good for 32Mb kernels). The symptom of a kernel with a too-small NKPTP
-is an immediate crash or reboot after the kernel is loaded. Another
-caveat is that kernels larger than about 14Mb in size will use up all
-the ISA DMA memory and the kernel will panic at boot unless isadma is
-disabled in the config or via UKC. This leads to the final problem: if
-isadma is disabled, then things that attempt to use it (e.g. floppy disk
-access) will panic the kernel. The best solution is to try to keep your
-kernels small.
+1. Any file that you add to the root of the flash-card (/flash) that 
+has the tgz-extension is automatically extracted to the ramdisk 
+during boot. This is useful for small extensions or configuration 
+that you can distribute in a single tgz-package. Files can also be 
+added to the /flash/conf directory, they are then automatically 
+copied (not extracted) to the ramdisk during boot.
 
-The contents of the ramdisk filesystem may be easily modified by
-editing the "list" file. The format is the same as used by the OpenBSD
-installation media and is fairly self-explanatory.
+2. There is also an option in rc.conf to create a second ramdisk in 
+/usr/local. By default this is not done at all to save memory on the 
+device. If activated this will also extract any files located in 
+/flash/pkg/ ending with the tgz-extension to /usr/local. This 
+provides an excellent way to add packages directly from the OpenBSD 
+ftp-server without needing to expand the original ramdisk. The 
+rc-script will even remove some unnecessary files from the packages 
+such as man-pages and files needed only for compiling.
 
-This infrastructure does a couple of things to save space, but is
-not at all ferocious as I stopped tweaking once I reached my target
-(bsd.gz < 5Mb). To save space, only a couple of term{cap,info} entries
-are transferred (see TERMTYPES in the Makefile).
+3. Recompile a kernel that suits your needs and that includes or 
+excludes the binaries and libs that you need for your application. 
+Change the list to include extra files. You can also use the script 
+build-largekernel.sh which is an exact copy of the build-kernel.sh 
+with the difference that it creates a 25MB ramdisk instead of a ~15 
+MB kernel. It also includes the content of the list.largekernel-file 
+to include some extra binaries and libs that does not fit in the 
+original distribution. If you have decided to go down this road you 
+might just as well modify the default configuration located under 
+the initial-conf directory.
 
+The first two alternatives can be done without having to recompile 
+the distribution and should be sufficient for most needs. But on 
+devices that do not have the memory concern, there should be much 
+easier to do build the larger kernel and add stuff as you need them.
+
+Kernelsizes are a problem when piggybacking a ramdisk blob. 
+Kernel+ramdisks larger than 16MB needs to increase the NKPTP in the 
+kernel config. This is already done for all the kernels and you 
+shouldn't have to do anything as long as you stay under 32MB. The 
+second problem is that kernels larger than about 14MB will use up 
+all the ISA DMA memory, for this reason ISA DMA is disabled. This 
+leads to the final problem: if isadma is disabled, then things that 
+attempt to use it (e.g. floppy disk access) will panic the kernel. 
+In the end the best solution is to try to keep your kernels small.
+
+This infrastructure does a couple of things to save space, but is 
+not at all ferocious as I stopped tweaking once I reached my target 
+(bsd.gz < 5Mb). To save space, only a couple of term{cap,info} 
+entries are transferred (see TERMTYPES in the Makefile).
+
+
 Support and bug reporting
 -------------------------
 
-Please send bug reports to djm@mindrot.org. I don't have time to
-support this software, so if you run into problems you are on your
-own. This code works very well for me, so hopefully it will for you
-too.
+Please send bug reports to djm@mindrot.org or subscibe to the 
+mailinglist flashboot@mindrot.org. I don't have time to support this 
+software, so if you run into problems you are on your own. This code 
+works very well for me, so hopefully it will for you too.
 
 Damien Miller <djm@mindrot.org>
 
diff -urN flashboot.old/build-largekernel.sh flashboot/build-largekernel.sh
--- flashboot.old/build-largekernel.sh	Thu Jan  1 01:00:00 1970
+++ flashboot/build-largekernel.sh	Tue Aug 29 13:02:21 2006
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# $Id: build-kernel.sh,v 1.1 2006/08/26 17:52:44 jakob Exp $
+# Builds a 25MB kernel
+
+BASE=`pwd`
+SRCDIR=${BSDSRCDIR:-/usr/src}
+DESTDIR=${DESTDIR:-${BASE}/flash-dist}
+SUDO=sudo
+
+export SRCDIR DESTDIR SUDO
+
+# Don't start without a kernel as a parameter
+if [ "$1" = "" ]; then
+  echo "usage: $0 kernel"
+  exit 1
+fi
+
+# Does the kernel exist at all
+if [ ! -r $1 ]; then
+  echo "ERROR! $1 does not exist or is not readable."
+  exit 1
+fi
+
+# Create dir if not there
+mkdir -p obj
+
+# Create a templist 
+cat list list.largekernel > list.temp
+
+# Which kernel to use?
+export KERNEL=$1.LARGE
+
+# Create the kernelfile
+grep -v MINIROOTSIZE $1 > $KERNEL
+echo "option          MINIROOTSIZE=51200" >> $KERNEL
+
+# Cleanup just in case the previous build failed
+${SUDO} umount /mnt/ 
+${SUDO} vnconfig -u vnd0
+make KCONF=${KERNEL} clean
+
+# Make kernel
+make KCONF=${KERNEL} LIST=${BASE}/list.temp NBLKS=51200 DISKPROTO=${BASE}/disktabs/disktab.25mb $2 $3 $4
+
+# Cleanup
+rm -f list.temp
+rm -f $KERNEL
+
+# Done
+echo "Your kernel is stored here ${BASE}/obj/"
diff -urN flashboot.old/contrib/blink flashboot/contrib/blink
--- flashboot.old/contrib/blink	Thu Jan  1 01:00:00 1970
+++ flashboot/contrib/blink	Tue Aug 29 10:10:20 2006
@@ -0,0 +1,21 @@
+#/bin/sh
+# Blinks a led using gpioctl.
+# Wrap has leds on pin 2,3 and 18
+# Soekris has leds on pin 9
+# Contributed by Rickard Dahlstrand rd@tilde.se
+
+if [ "$1" = "" ]; then
+  echo "usage: $0 gpio-pin"
+  echo "Wrap has leds on pin 2,3 and 18"
+  echo "Soekris has a led on pin 9"
+  exit 1
+fi
+
+gpioctl -q -c $1 pp out 
+
+while true; do
+  gpioctl -q $1 0
+  sleep 3
+  gpioctl -q $1 1
+  sleep 3
+done
diff -urN flashboot.old/contrib/kitt flashboot/contrib/kitt
--- flashboot.old/contrib/kitt	Thu Jan  1 01:00:00 1970
+++ flashboot/contrib/kitt	Tue Aug 29 10:09:41 2006
@@ -0,0 +1,35 @@
+#/bin/sh
+# For all your Knight Rider fans out there.
+# Only works on Wrap and draws a lot of cpu.
+# Contributed by Rickard Dahlstand rd@tilde.se
+
+gpioctl -q -c 2 pp out 
+gpioctl -q -c 3 pp out 
+gpioctl -q -c 18 pp out 
+
+while true; do
+  gpioctl -q 2 0
+  sleep .05
+  gpioctl -q 3 0
+  sleep .05
+  gpioctl -q 18 0
+  sleep .05
+  gpioctl -q 2 1
+  sleep .05
+  gpioctl -q 3 1
+  sleep .05
+  gpioctl -q 18 1
+  sleep .3
+  gpioctl -q 18 0
+  sleep .05
+  gpioctl -q 3 0
+  sleep .05
+  gpioctl -q 2 0
+  sleep .05
+  gpioctl -q 18 1
+  sleep .05
+  gpioctl -q 3 1
+  sleep .05
+  gpioctl -q 2 1
+  sleep .3
+done
diff -urN flashboot.old/disktabs/disktab.20mb flashboot/disktabs/disktab.20mb
--- flashboot.old/disktabs/disktab.20mb	Thu Jan  1 01:00:00 1970
+++ flashboot/disktabs/disktab.20mb	Tue Aug 29 11:09:47 2006
@@ -0,0 +1,23 @@
+# /dev/rsvnd0c:
+type: unknown
+disk: rdroot8
+label: 
+flags:
+bytes/sector: 512
+sectors/track: 40
+tracks/cylinder: 1
+sectors/cylinder: 40
+cylinders: 1024
+total sectors: 40960
+rpm: 3600
+interleave: 1
+trackskew: 0
+cylinderskew: 0
+headswitch: 0		# microseconds
+track-to-track seek: 0	# microseconds
+drivedata: 0 
+
+2 partitions:
+#        size   offset    fstype   [fsize bsize   cpg]
+  a:    40960        0    4.2BSD     1024  4096    20 	# (Cyl.    0 - 1023)
+  c:    40960        0    unused        0     0       	# (Cyl.    0 - 1023)
diff -urN flashboot.old/disktabs/disktab.25mb flashboot/disktabs/disktab.25mb
--- flashboot.old/disktabs/disktab.25mb	Thu Jan  1 01:00:00 1970
+++ flashboot/disktabs/disktab.25mb	Tue Aug 29 11:20:33 2006
@@ -0,0 +1,23 @@
+# /dev/rsvnd0c:
+type: unknown
+disk: rdroot8
+label: 
+flags:
+bytes/sector: 512
+sectors/track: 50
+tracks/cylinder: 1
+sectors/cylinder: 50
+cylinders: 1024
+total sectors: 51200
+rpm: 3600
+interleave: 1
+trackskew: 0
+cylinderskew: 0
+headswitch: 0		# microseconds
+track-to-track seek: 0	# microseconds
+drivedata: 0 
+
+2 partitions:
+#        size   offset    fstype   [fsize bsize   cpg]
+  a:    51200        0    4.2BSD     1024  4096    20 	# (Cyl.    0 - 1023)
+  c:    51200        0    unused        0     0       	# (Cyl.    0 - 1023)
diff -urN flashboot.old/initial-conf/rc.conf flashboot/initial-conf/rc.conf
--- flashboot.old/initial-conf/rc.conf	Fri May  5 09:41:19 2006
+++ flashboot/initial-conf/rc.conf	Tue Aug 29 14:00:23 2006
@@ -22,3 +22,7 @@
 bootparamd_flags=NO	# for normal use: ""
 portmap=NO		# Note: inetd(8) rpc services need portmap too
 named_flags=NO
+watchdogd_flags=NO
+
+# Control the /usr/local partition
+usrrd_size=NO	 	# No of 512-byte blocks e.g. "30720" = about 15MB
diff -urN flashboot.old/initial-conf/rc.initial flashboot/initial-conf/rc.initial
--- flashboot.old/initial-conf/rc.initial	Sat Aug 26 19:36:56 2006
+++ flashboot/initial-conf/rc.initial	Tue Aug 29 13:32:25 2006
@@ -34,7 +34,7 @@
 trap : 3	# shouldn't be needed
 
 HOME=/; export HOME
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/lib
 export PATH
 
 if [ $1x = shutdownx ]; then
@@ -255,6 +255,37 @@
 fi
 
 echo -n ' cron';		cron
+
+echo "."
+
+if [ X"${usrrd_size}" != X"NO" ]; then
+        echo "Creating usrlocal.."
+        mkdir /usr/local
+        mount_mfs -s ${usrrd_size} /dev/wd0c /usr/local
+        cd /usr/local/
+
+        echo "Unpacking packages.."
+        for x in /flash/pkg/*.tgz ; do 
+                if [ -r $x ]; then
+                        echo -n "Unpacking package ${x} from flash... "
+                        if ! tar zxpf $x ; then
+                                exit 1
+                        fi
+                        rm -fR include
+                        rm -fR share/doc
+                        rm -f +*
+                        rm -fR man
+                        echo "done"
+                fi
+        done
+
+	/sbin/ldconfig /usr/local/lib
+
+fi
+
+if [ X"${watchdogd_flags}" != X"NO" ]; then
+        echo -n ' watchdogd';       watchdogd $watchdogd_flags
+fi
 
 echo "."
 
diff -urN flashboot.old/list flashboot/list
--- flashboot.old/list	Sat Aug 26 19:28:23 2006
+++ flashboot/list	Tue Aug 29 13:31:40 2006
@@ -73,6 +73,14 @@
 COPY	${CURDIR}/initial-conf/sysctl.conf	etc/sysctl.conf
 COPY	${CURDIR}/initial-conf/syslog.conf	etc/syslog.conf
 COPY	${CURDIR}/initial-conf/ttys		etc/ttys
+COPY	${CURDIR}/tools/rw			bin/rw
+COPY	${CURDIR}/tools/ro			bin/ro
+#COPY	${CURDIR}/contrib/blink			bin/blink
+#COPY	${CURDIR}/contrib/kitt			bin/kitt
+SPECIAL chmod 755 bin/rw
+SPECIAL chmod 755 bin/ro
+#SPECIAL chmod 755 bin/blink
+#SPECIAL chmod 755 bin/kitt
 SPECIAL chmod 755 etc/rc
 SPECIAL chown root.wheel etc/master.passwd
 SPECIAL chmod 0600 etc/master.passwd etc/ssh/sshd_config
@@ -107,6 +115,7 @@
 COPY ${DESTDIR}/bin/systrace			bin/systrace
 COPY ${DESTDIR}/bin/test			bin/test
 COPY ${DESTDIR}/sbin/brconfig			sbin/brconfig
+COPY ${DESTDIR}/sbin/ldconfig			sbin/ldconfig
 COPY ${DESTDIR}/sbin/dhclient			sbin/dhclient
 COPY ${DESTDIR}/sbin/dhclient-script		sbin/dhclient-script
 COPY ${DESTDIR}/sbin/dmesg			sbin/dmesg
@@ -191,6 +200,7 @@
 COPY ${DESTDIR}/usr/sbin/gpioctl		usr/sbin/gpioctl
 COPY ${DESTDIR}/usr/sbin/hostapd		usr/sbin/hostapd
 COPY ${DESTDIR}/usr/sbin/inetd			usr/sbin/inetd
+COPY ${DESTDIR}/usr/sbin/watchdogd		usr/sbin/watchdogd
 #COPY ${DESTDIR}/usr/sbin/kvm_mkdb		usr/sbin/kvm_mkdb
 #COPY ${DESTDIR}/usr/sbin/mtree			usr/sbin/mtree
 #COPY ${DESTDIR}/usr/sbin/named			usr/sbin/named
diff -urN flashboot.old/list.largekernel flashboot/list.largekernel
--- flashboot.old/list.largekernel	Thu Jan  1 01:00:00 1970
+++ flashboot/list.largekernel	Tue Aug 29 13:38:27 2006
@@ -0,0 +1,41 @@
+# This list is added on top of the existing list for the megakernel
+
+COPY	${DESTDIR}/var/named/etc/named.conf	var/named/etc/named.conf
+COPY	/dev/null				var/named/etc/rndc.key
+COPY	${DESTDIR}/var/named/standard/localhost var/named/standard/localhost
+COPY	${DESTDIR}/var/named/standard/loopback	var/named/standard/loopback
+COPY	${DESTDIR}/var/named/standard/loopback6.arpa var/named/standard/loopback6.arpa
+COPY	${DESTDIR}/var/named/standard/root.hint var/named/standard/root.hint
+COPY	${DESTDIR}/etc/mtree/4.4BSD.dist	etc/mtree/4.4BSD.dist
+
+# optional ral(4) firmware (copied from build system)
+#COPY	/etc/firmware/ral-rt2561		etc/firmware
+#COPY	/etc/firmware/ral-rt2561s		etc/firmware
+#COPY	/etc/firmware/ral-rt2661		etc/firmware
+
+# optional ipw(4) firmware (copied from build system)
+#COPY	/etc/firmware/ipw-bss			etc/firmware
+#COPY	/etc/firmware/ipw-ibss			etc/firmware
+#COPY	/etc/firmware/ipw-license		etc/firmware
+#COPY	/etc/firmware/ipw-monitor		etc/firmware
+
+# optional iwi(4) firmware (copied from build system)
+#COPY	/etc/firmware/iwi-bss			etc/firmware
+#COPY	/etc/firmware/iwi-ibss			etc/firmware
+#COPY	/etc/firmware/iwi-license		etc/firmware
+#COPY	/etc/firmware/iwi-monitor		etc/firmware
+
+COPY	${CURDIR}/contrib/blink			bin/blink
+COPY	${CURDIR}/contrib/kitt			bin/kitt
+SPECIAL chmod 755 bin/blink
+SPECIAL chmod 755 bin/kitt
+COPY ${DESTDIR}/sbin/wicontrol			sbin/wicontrol
+COPY ${DESTDIR}/usr/sbin/mtree			usr/sbin/mtree
+COPY ${DESTDIR}/usr/sbin/named			usr/sbin/named
+COPY ${DESTDIR}/usr/sbin/dig			usr/sbin/dig
+COPY ${DESTDIR}/usr/sbin/portmap		usr/sbin/portmap
+COPY ${DESTDIR}/usr/sbin/rarpd			usr/sbin/rarpd
+COPY ${DESTDIR}/usr/sbin/rpc.bootparamd		usr/sbin/rpc.bootparamd
+
+# Extra libs needed
+COPY	${DESTDIR}/usr/lib/libssl.so.10.0	usr/lib/libssl.so.10.0
diff -urN flashboot.old/tools/ro flashboot/tools/ro
--- flashboot.old/tools/ro	Thu Jan  1 01:00:00 1970
+++ flashboot/tools/ro	Mon Aug 28 13:44:15 2006
@@ -0,0 +1 @@
+mount -u -o ro /dev/wd0a /flash
diff -urN flashboot.old/tools/rw flashboot/tools/rw
--- flashboot.old/tools/rw	Thu Jan  1 01:00:00 1970
+++ flashboot/tools/rw	Mon Aug 28 13:44:05 2006
@@ -0,0 +1 @@
+mount -u -o rw,sync,noatime /dev/wd0a /flash
