#!/bin/sh BASEDIR="rootfs" echo "Creating custom OpenBSD 4.4 install sets from $BASEDIR:" if [ `id -u` != 0 ]; then echo "Aborting, program must be run as root." exit 1 fi echo "Removing old sets..." rm -f base44.tgz rm -f etc44.tgz rm -f MD5 cd "$BASEDIR" echo "Tarballing base set..." for i in * ; do if [ "$i" != "etc" -a "$i" != "etc_premount" ]; then tar rf ../base44.tar "$i" fi done echo "Gzipping base set tarball..." gzip ../base44.tar echo "Renaming base set gzipped tarball from .tar.gz to .tgz..." mv ../base44.tar.gz ../base44.tgz echo "Tarballing etc set..." tar rf ../etc44.tar etc etc_premount echo "Gzipping etc set tarball..." gzip ../etc44.tar echo "Renaming etc set gzipped tarball from .tar.gz to .tgz..." mv ../etc44.tar.gz ../etc44.tgz echo "Creating new MD5 file for sets..." md5sum ../*.tgz | awk '{printf("MD5 (%s) = %s\n", $2, $1);}' > ../MD5 echo "Done!"