freebsd-dev/release/picobsd/mfs_tree/etc/rc

26 lines
487 B
Plaintext
Raw Normal View History

#!/bin/sh
stty status '^T'
trap : 2
trap : 3
HOME=/; export HOME
PATH=/bin; export PATH
dev=`sysctl -n kern.bootdevname`
[ -z ${dev} ] && dev="/dev/fd0"
trap "echo 'Reboot interrupted'; exit 1" 3
echo "Loading /etc from MFS:/fd ..."
cp -Rp /fd/* /
echo "Updating /etc from ${dev}..."
mount -o rdonly ${dev} /fd && \
{ cd /fd; cp -Rp etc root / ; cd / ; umount /fd ; }
cd /etc
#rm files to stop overwrite warning
for i in *; do
[ -f $i.gz ] && rm $i
done
gzip -d *.gz
. rc1
exit 0