head	1.6;
access;
symbols
	RELENG_4_11_0_RELEASE:1.3.2.3
	RELENG_4_11:1.3.2.3.0.12
	RELENG_4_11_BP:1.3.2.3
	RELENG_4_10_0_RELEASE:1.3.2.3
	RELENG_4_10:1.3.2.3.0.10
	RELENG_4_10_BP:1.3.2.3
	RELENG_4_9_0_RELEASE:1.3.2.3
	RELENG_4_9:1.3.2.3.0.8
	RELENG_4_9_BP:1.3.2.3
	RELENG_4_8_0_RELEASE:1.3.2.3
	RELENG_4_8:1.3.2.3.0.6
	RELENG_4_8_BP:1.3.2.3
	RELENG_4_7_0_RELEASE:1.3.2.3
	RELENG_4_7:1.3.2.3.0.4
	RELENG_4_7_BP:1.3.2.3
	RELENG_4_6_2_RELEASE:1.3.2.3
	RELENG_4_6_1_RELEASE:1.3.2.3
	RELENG_4_6_0_RELEASE:1.3.2.3
	RELENG_4_6:1.3.2.3.0.2
	RELENG_4_6_BP:1.3.2.3
	RELENG_4_5_0_RELEASE:1.3.2.2
	RELENG_4_5:1.3.2.2.0.2
	RELENG_4_5_BP:1.3.2.2
	RELENG_4_4_0_RELEASE:1.3.2.1
	RELENG_4_4:1.3.2.1.0.4
	RELENG_4_4_BP:1.3.2.1
	RELENG_4_3_0_RELEASE:1.3.2.1
	RELENG_4_3:1.3.2.1.0.2
	RELENG_4_3_BP:1.3.2.1
	RELENG_4_2_0_RELEASE:1.3
	RELENG_4_1_1_RELEASE:1.3
	PRE_SMPNG:1.3
	RELENG_4_1_0_RELEASE:1.3
	RELENG_3_5_0_RELEASE:1.1.2.4
	RELENG_4_0_0_RELEASE:1.3
	RELENG_4:1.3.0.2
	RELENG_4_BP:1.3
	RELENG_3_4_0_RELEASE:1.1.2.2
	RELENG_3_3_0_RELEASE:1.1.2.2
	RELENG_3:1.1.0.2;
locks; strict;
comment	@# @;


1.6
date	2002.03.08.05.15.08;	author luigi;	state dead;
branches;
next	1.5;

1.5
date	2001.10.04.00.46.44;	author luigi;	state Exp;
branches;
next	1.4;

1.4
date	2000.12.23.19.11.53;	author joe;	state Exp;
branches;
next	1.3;

1.3
date	2000.02.08.14.20.51;	author luigi;	state Exp;
branches
	1.3.2.1;
next	1.2;

1.2
date	99.08.28.01.33.27;	author peter;	state Exp;
branches;
next	1.1;

1.1
date	99.08.22.21.43.23;	author dwhite;	state Exp;
branches
	1.1.2.1;
next	;

1.1.2.1
date	99.08.22.23.08.13;	author dwhite;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	99.08.29.15.52.49;	author peter;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2000.02.12.19.04.17;	author luigi;	state Exp;
branches;
next	1.1.2.4;

1.1.2.4
date	2000.05.31.12.52.51;	author luigi;	state Exp;
branches;
next	;

1.3.2.1
date	2000.12.23.01.08.32;	author luigi;	state Exp;
branches;
next	1.3.2.2;

1.3.2.2
date	2001.10.04.00.50.39;	author luigi;	state Exp;
branches;
next	1.3.2.3;

1.3.2.3
date	2002.03.08.05.17.25;	author luigi;	state dead;
branches;
next	;


desc
@@


1.6
log
@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.
@
text
@#!/bin/sh
# $FreeBSD: src/release/picobsd/floppy.tree/etc/rc,v 1.5 2001/10/04 00:46:44 luigi Exp $
############################################
### Special setup for one floppy PICOBSD ###
### THIS IS NOT THE NORMAL /etc/rc !!!!! ###
############################################
mount -a -t nonfs
# before calling rc.conf, try to identify the system by using the
# ethernet address and name of the first interface. This is available
# to rc.conf and others as $main_eth $main_if for further processing.

main_ether=""
for main_if in `ifconfig -l` ; do
    set `ifconfig $main_if`
    while [ "$1" != "" ] ; do
	if [ $1 = "ether" ] ; then
	    main_ether=$2
	    break 2
	else
	    shift
	fi
    done
done

if [ -f /etc/rc.conf ]; then
    . /etc/rc.conf
    set_main_interface
    set_all_interfaces
fi
rm -f /var/run/*
if [ "x$swapfile" != "xNO" -a -w "$swapfile" -a -b /dev/vn0b ]; then
	echo "Adding $swapfile as additional swap."
	vnconfig /dev/vn0b $swapfile && swapon /dev/vn0b
fi
# configure serial devices
if [ -f /etc/rc.serial ]; then
	. /etc/rc.serial
fi
# start up the initial network configuration.
if [ -f /etc/rc.network ]; then
	. /etc/rc.network
	network_pass1
fi
mount -a -t nfs
chmod 666 /dev/tty[pqrsPQRS]*
# clean up left-over files
(cd /var/run && { cp /dev/null utmp; chmod 644 utmp; })
if [ -n "$network_pass1_done" ]; then
    network_pass2
fi
if [ -n "$network_pass2_done" ]; then
    network_pass3
fi
if [ "X${inetd_enable}" = X"YES" -a -f /stand/inetd ]; then
	echo "Starting inetd."; inetd ${inetd_flags}
fi

[ "X${sshd_enable}" = "XYES" ] && [ -f /stand/sshd ] && \
	sshd -f /etc/sshd_config

dev_mkdb

echo ''
if [ "x$swapfile" = "xNO" ]; then
	echo "WARNING: no swap partition!"
	echo "Don't run too many programs at the same time..."
fi
cat /etc/motd
exit 0
@


1.5
log
@Add functions to lookup in /etc/networks and set interface
addresses, invoke them from /etc/rc
@
text
@d2 1
a2 1
# $FreeBSD: src/release/picobsd/floppy.tree/etc/rc,v 1.4 2000/12/23 19:11:53 joe Exp $
@


1.4
log
@MF4: revision 1.3.2.1.
     inetd is not always present, check before invoking it.
@
text
@d2 1
a2 1
# $FreeBSD: src/release/picobsd/floppy.tree/etc/rc,v 1.3 2000/02/08 14:20:51 luigi Exp $
d27 2
@


1.3
log
@Cleanup of the default floppy tree for PicoBSD builds.

Approved-by: jordan
@
text
@d2 1
a2 1
# $FreeBSD: src/release/picobsd/floppy.tree/etc/rc,v 1.2 1999/08/28 01:33:27 peter Exp $
d52 1
a52 1
if [ "X${inetd_enable}" = X"YES" ]; then
@


1.3.2.1
log
@inetd is not always present, check before invoking it.
@
text
@d2 1
a2 1
# $FreeBSD: src/release/picobsd/floppy.tree/etc/rc,v 1.3 2000/02/08 14:20:51 luigi Exp $
d52 1
a52 1
if [ "X${inetd_enable}" = X"YES" -a -f /stand/inetd ]; then
@


1.3.2.2
log
@MFC: create functions to lookup/set interface addresses, and use them.
@
text
@d2 1
a2 1
# $FreeBSD: src/release/picobsd/floppy.tree/etc/rc,v 1.3.2.1 2000/12/23 01:08:32 luigi Exp $
a26 2
    set_main_interface
    set_all_interfaces
@


1.3.2.3
log
@MFC: sync with the version in -current.
@
text
@d2 1
a2 1
# $FreeBSD: src/release/picobsd/floppy.tree/etc/rc,v 1.3.2.2 2001/10/04 00:50:39 luigi Exp $
@


1.2
log
@$Id$ -> $FreeBSD$
@
text
@d2 1
a2 1
# $FreeBSD$
d56 3
d66 1
a66 14
echo ''
echo ''
echo '+----------- PicoBSD @@VER@@ (ISP) ---------------+'
echo '|                                              |'
echo '| Log in as "root" (password "setup").         |'
echo '|                                              |'
echo '| This version of PicoBSD is fully under       |'
echo '| BSD license. For more details see            |'
echo '| http://www.freebsd.org/~picobsd, or contact  |'
echo '| the author.                                  |'
echo '|                                              |'
echo '|                     abial@@freebsd.org        |'
echo '|                                              |'
echo '+----------------------------------------------+'
@


1.1
log
@Major PicoBSD update by luigi with some debugging help from myself.

. Now builds on -STABLE (-CURRENT is broken due to bugs)
. etc directory contents centralized instead of in each
  type directory (can exclude & override as desired)
. Removed extraneous language files (lang files for rc really necessary?)
. dialog-based build tool with support for custom floppy builds
. MFS image loads as a mfs_root module instead of compiled into kernel

THIS IS BROKEN ON CURRENT.  I'll MFC to -STABLE immediately following.
luigi tells me I have an OK from jkh on the MFC.

Submitted by:	luigi
@
text
@d2 1
a2 1
# $Id: rc.en,v 1.5 1999/01/19 23:11:50 abial Exp $
@


1.1.2.1
log
@MFC: PicoBSD mega-upgrade.  It actually works in -STABLE, let's hope I
didn't miss anything.  According to luigi, I have jkh's OK on this.

Submitted by:  luigi
@
text
@@


1.1.2.2
log
@$Id$ -> $FreeBSD$
@
text
@d2 1
a2 1
# $FreeBSD$
@


1.1.2.3
log
@MFC: sync Picobsd build structure with the one in -current.
This involves a cleanup of the build scripts, removing
common files from the individual trees and put them in a
common place, and remove unused stuff.
@
text
@d2 1
a2 1
# $FreeBSD: src/release/picobsd/floppy.tree/etc/rc,v 1.1.2.2 1999/08/29 15:52:49 peter Exp $
a55 3
[ "X${sshd_enable}" = "XYES" ] && [ -f /stand/sshd ] && \
	sshd -f /etc/sshd_config

d63 14
a76 1
cat /etc/motd
@


1.1.2.4
log
@Add hooks for pccardd and syslogd
@
text
@d2 1
a2 1
# $FreeBSD: src/release/picobsd/floppy.tree/etc/rc,v 1.1.2.3 2000/02/12 19:04:17 luigi Exp $
a57 14

if [ "X${syslogd_enable}" = X"YES" ]; then
	echo -n ' syslogd';             syslogd ${syslogd_flags}
fi

if [ "X$pccard_enable" = X"YES" ] ; then
        if [ "x$pccard_mem" != "xDEFAULT" ] ; then
                pccardc pccardmem $pccard_mem
        else
                pccardc pccardmem 0xd0000
        fi
        echo -n "Enable PC-card."
        pccardd $pccardd_flags 2>&1 > /var/log/pccardd.debug
fi
@


