#!/bin/sh # var-init --- creates /var/. # first, it formats the /var partition with mkfs; # then it copies the contents of /var-ro/ into /var/. # This assumes that /var-ro/ is already set up the way you # want /var to eventually be. # # /var must not be mounted when this is called. # At the end of this process, /var remains unmounted. # # jwz, 21-May-00 (sun); 8:18 PM PATH=/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc export PATH dev=`sed -n 's@^\([^ ]*\) */var .*@\1@p' < /etc/fstab` if [ "$dev" = "" ]; then echo "$0: unable to find /var file system in /etc/fstab" >&2 exit 1 fi set -e mkfs -t ext2 $dev mount /var cd /var-ro find . -depth -print | cpio -pdm /var cd / umount /var exit 0