0064 Mbyte Memory CPU 80486 133 MHz Pri Mas ATA_FLASH LBA 489-4-32 31 Mbyte
In the sample above, 489-4-32 represents the Cylinders-TracksPerCyl(Heads)-SectorsPerTrack, the C-H-S values
Connect your serial console to the Soekris box (19200 baud). Plug in the flash card to your Soekris box, turn it on, and note the C-H-S values in your serial console session. Write them down. Flashdist will ask you for them when you run it.
(If your Soekris box does _not_ display these values, use the instructions at the Soekris web site to upgrade to the 1.15 or newer BIOS)
(Be sure to use root permissions and the p option with tar or else files will not be extracted with the correct permissions and your installation [at least sshd and login] will not work properly!)
(alternately, if you run flashdist from OpenBSD/i386 and you want to skip this step, you can specify / rather than /tmp/openbsd as argument 4 to install flash32mb.txt content from your current OS image. This saves you time, but it copies the current state of /etc, including master.passwd and other configuration files, so you will have to edit those.)
mkdir /tmp/openbsd cd /tmp/openbsd tar xzpf /path/to/base42.tgz tar xzpf /path/to/etc42.tgz tar xzpf /path/to/man42.tgz
cp /path/to/NET4501 /usr/src/sys/arch/i386/conf/NET4501 cd /usr/src/sys/arch/i386/conf config NET4501 cd ../compile/NET4501 makeOf course, whatever kernel you compile should be built the same source as that of the userland you install. Or, if you are using a snapshot to install from, at least try to build a kernel using sources from a close date to that of the snapshot build.
tar xvf flashdist.tar cd flashdist vi rc
./flashdist.sh sd2 flash32mb.txt /usr/src/sys/arch/i386/compile/NET4501/bsd /tmp/openbsdOr, if you want to source everything (/etc, /usr) from your workstation. (I use this option in a time pinch, but you have to be careful about what is in /etc on your source machine.)
./flashdist.sh sd2 flash32mb.txt /bsd /
export TERM=vt220For all use, if you want to make changes to the read-only media while logged in, do this:
rw
Make your changes, and then mount it read-only again:
ro
dd if=/dev/zero of=flashimg bs=512 count=125440Where bs, the blocksize, is equal to the bytes per sector used on the flash media (almost always 512), and count as the total number of sectors. In this example, the total number of sectors is 125440, but of course this differs with each type of flash card or hard disk. It is calculated as C*H*S, where C is Cylinders, H is Heads (tracks per cylinder), and S is Sectors per track.
Once you have the image file, you need to make it look like a regular disk.
vnconfig -c svnd0 flashimgNow you can use the svnd0 device with flashdist, instead of sd0 or another actual disk on the system. When you are done installing to the the flash image, you need to unconfigure it from the kernel before you use it.
vnconfig -u svnd0Now the file 'flashimg' is your disk image and it is ready to be written to flash.
dd if=flashimg of=/dev/sd0c
cd flashdist-XXXXXXXX tar xvf ~/nsh-XXXXXXX.tarAt this point, build NSH.
cd nsh makeWith NSH built, flashdist will automatically install it on subsequent runs.