# startup actions to mount a memory filesystem for /usr, check and # mount the compact-flash or harddrive as /dev/wd0a, unpack and # possibly ungzip a tarball of files into the new /usr, and unmount # the CF device. For more information see the following URL: # http://256.com/gray/docs/soekris_openbsd_diskless/ echo "populating /usr from archive or directories on wd0" echo "making /usr mfs filesystem" # with 128mb of memory the 128000 blocks will create a 64mb /usr. if # you have only 64mb of memory then you need to change it to 70000 or so. mount_mfs -s 128000 swap /usr echo "checking /dev/wd0a" fsck -y /dev/wd0a echo "mounting /dev/wd0a on /mnt/wd0" mount -r -o noatime /dev/wd0a /mnt/wd0 if [ -r /mnt/wd0/usr.tgz ]; then echo "unpacking gzipped tarball into /usr" ( cd /usr ; gzip -dc /mnt/wd0/usr.tgz | tar -xpf - ) elif [ -r /mnt/wd0/usr.tar ]; then echo "unpacking tarball into /usr" ( cd /usr ; tar -xpf /mnt/wd0/usr.tar ) elif [ -d /mnt/wd0/usr ]; then echo "copying /mnt/wd0/usr into /usr" ( cd /mnt/wd0/usr ; cp -pR . /usr ) else echo "WARNING: no files copied into /usr" fi echo "/usr filesystem created" umount /mnt/wd0