freebsd-dev/release/picobsd/mfs_tree/etc/rc
Luigi Rizzo 107a6eaf0a Major cleanup of PicoBSD startup scripts, which now should be
closer to doing "the right thing".

The structure is now the following:

  * /etc/rc (from MFS) loads the rest of /etc and /root from
    /fd and then from floppy (if present), then transfers control
    to /etc/rc1

  * /etc/rc1 loads defaults from /etc/rc.conf.defaults, tries to
    set the hostname basing on the MAC address of the first ethernet
    interface, and then sources /etc/rc.conf and /etc/rc.conf.local
    for local configurations

  * The rest of the startup process is then performed (rc.network and so on).

Everything except the initial /etc/rc (from MFS) can be overridden with
a local version loaded from floppy. But in most cases, you should only need
to customize the following files in /etc:

	rc.conf    rc.firewall    hosts

Previously there were a number of inconsistencies in the calling
between files, and also a lot of clutter in rc.conf and rc.firewall.
Also, "rc1" was called "rc" and would overwrite the initial /etc/rc
from MFS, making it really hard to figure out what was going on in
case of bugs.
2002-03-08 05:15:08 +00:00

25 lines
462 B
Bash

#!/bin/sh
stty status '^T'
trap : 2
trap : 3
HOME=/; export HOME
PATH=/sbin:/bin:/usr/sbin:/usr/bin; export PATH
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