summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Robbins <drobbins@gentoo.org>2000-08-25 03:08:58 +0000
committerDaniel Robbins <drobbins@gentoo.org>2000-08-25 03:08:58 +0000
commit472a6a92bdadb128d28ec9fcf67837f4eb57008a (patch)
tree6d0d0005f960e3871cebf86fa8675da35241aa17 /sys-apps/baselayout
parentzapped old baselayout (diff)
downloadgentoo-2-472a6a92bdadb128d28ec9fcf67837f4eb57008a.tar.gz
gentoo-2-472a6a92bdadb128d28ec9fcf67837f4eb57008a.tar.bz2
gentoo-2-472a6a92bdadb128d28ec9fcf67837f4eb57008a.zip
changes to baselayout -- 00baselayout and 00initscripts have been merged
into the new baselayout package. All data is in FILESDIR rather than in separate archives. This should make things easier to fix.
Diffstat (limited to 'sys-apps/baselayout')
-rw-r--r--sys-apps/baselayout/baselayout-1.2.ebuild35
-rw-r--r--sys-apps/baselayout/files/README.newusers164
-rw-r--r--sys-apps/baselayout/files/blurb.txt6
-rwxr-xr-xsys-apps/baselayout/files/colors16
-rw-r--r--sys-apps/baselayout/files/inittab52
-rwxr-xr-xsys-apps/baselayout/files/rc-update204
-rw-r--r--sys-apps/baselayout/files/rc.d/config/OFF_inet.eth023
-rw-r--r--sys-apps/baselayout/files/rc.d/config/OFF_serial23
-rw-r--r--sys-apps/baselayout/files/rc.d/config/basic13
-rw-r--r--sys-apps/baselayout/files/rc.d/config/functions108
-rw-r--r--sys-apps/baselayout/files/rc.d/config/inet.lo7
-rw-r--r--sys-apps/baselayout/files/rc.d/config/modules9
-rw-r--r--sys-apps/baselayout/files/rc.d/config/runlevels15
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/bootmisc39
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/checkfs37
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/checkroot105
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/clock29
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/halt16
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/hostname10
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/inet114
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/initscripts-install17
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/isapnp18
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/keymaps18
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/local34
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/modules81
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/mountall10
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/mountall.test8
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/pretty21
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/rc167
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/reboot14
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/rmnologin12
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/sendsigs17
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/serial68
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/single10
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/sysklogd44
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/umountfs29
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/urandom40
-rwxr-xr-xsys-apps/baselayout/files/rc.d/init.d/vcron32
38 files changed, 1664 insertions, 1 deletions
diff --git a/sys-apps/baselayout/baselayout-1.2.ebuild b/sys-apps/baselayout/baselayout-1.2.ebuild
index f16da388e4b8..1eeb6eff17da 100644
--- a/sys-apps/baselayout/baselayout-1.2.ebuild
+++ b/sys-apps/baselayout/baselayout-1.2.ebuild
@@ -1,7 +1,7 @@
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Achim Gottinger <achim@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/baselayout-1.2.ebuild,v 1.1 2000/08/25 02:56:10 drobbins Exp $# Copyright 1999-2000 Gentoo Technologies, Inc.
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/baselayout-1.2.ebuild,v 1.2 2000/08/25 03:08:58 drobbins Exp $# Copyright 1999-2000 Gentoo Technologies, Inc.
A=""
S=${WORKDIR}/${P}
@@ -45,6 +45,39 @@ src_install()
dosym /usr/sbin/MAKEDEV /dev/MAKEDEV
dodir /dev/pts /lib /proc /mnt/floppy /mnt/cdrom
chmod go-rwx ${D}/mnt/floppy ${D}/mnt/cdrom
+
+ for x in boot halt 1 2 3 4 5
+ do
+ dodir /etc/rc.d/rc${x}.d
+ done
+ dosym rcboot.d /etc/rc.d/rc0.d
+ dosym rchalt.d /etc/rc.d/rc6.d
+
+ dodir /etc/rc.d/init.d
+ dodir /etc/rc.d/config
+ cd ${FILESDIR}/rc.d/init.d
+ insinto /etc/rc.d/init.d
+ doins *
+ chmod 0755 ${D}/etc/rc.d/init.d/*
+ insinto /etc/rc.d/init.d/extra_scripts
+ cd ${FILESDIR}/rc.d/config
+ insinto /etc/rc.d/config
+ doins *
+ doins runlevels
+ cd ${FILESDIR}
+ insinto /etc
+ doins inittab
+ into /usr
+ dosbin rc-update
+ exeinto /usr/bin
+ exeopts -m0755
+ doexe colors
+ dodoc README.newusers blurb.txt
+}
+
+
+
+
}
diff --git a/sys-apps/baselayout/files/README.newusers b/sys-apps/baselayout/files/README.newusers
new file mode 100644
index 000000000000..2356eac62426
--- /dev/null
+++ b/sys-apps/baselayout/files/README.newusers
@@ -0,0 +1,164 @@
+
+ The Enoch/Stampede Boot Concept
+ Daniel Robbins, November 3, 1998
+ Updated on December 7, 1998
+ Updated on May 10, 1999
+===============================================================================
+
+The Stampede boot scripts have been designed to be simple and flexible as well
+as very familiar to a large number of Linux/UNIX users. We thank the RedHat,
+Slackware, Debian and SuSE distributions for their startup-scripts. These try
+to incorporate the best of all of these distributions, although very little
+Debian/Slackware/SuSE code actually exists in this initscript distribution.
+(Probably the most borrowed code is in the part that mounts and checks the
+various file systems, which we borrowed from Debian)
+
+Structure:
+
+/etc/rc.d/ Main Directory
+/etc/rc.d/init.d/ Startup Script Repository
+/etc/rc.d/config/ Configuration Directory
+/etc/rc.d/rcboot.d/ Scripts to run when system first starts
+/etc/rc.d/rc1.d/ Scripts for runlevel 1
+/etc/rc.d/rc2.d/ Scripts for runlevel 2
+/etc/rc.d/rc3.d/ Scripts for runlevel 3
+/etc/rc.d/rc4.d/ Scripts for runlevel 4
+/etc/rc.d/rc5.d/ Scripts for runlevel 5
+/etc/rc.d/rchalt.d/ Scripts for halting and reboot (runlevels 0,6)
+/etc/rc.d/rc.local Symlink to /etc/rc.d/init.d/local;
+ This is an easy way for new users to configure
+ their startup-sequence. This script is always the
+ last one executed when entering runlevels 1-5.
+
+The Boot Process:
+
+ *rcboot.d*
+
+ The directory /etc/rc.d/rcboot.d contains symbolic links to files in
+ /etc/rc.d/init.d. These links have a special naming convention, which
+ is:
+ [0-9][0-9]myname
+
+ for example:
+
+ 05checkroot
+ or
+ 20mountall
+
+ On boot, these scripts are run in order, from 00 to 99. These scripts
+ perform functions such as mounting file systems and configuring the
+ system hardware. They are intended to be one-time setup scripts and
+ are not expected to parse any command-line arguments (although they are
+ all called with the "start" argument, it can be ignored)
+
+ *rc[1-5].d*
+
+ After all the scripts in rcboot.d have been executed, the system
+ switches to the default runlevel (listed in /etc/inittab), and executes
+ scripts in the appropriate directory, rc?.d, where ? is between 1 and 5
+ inclusive. As with rcboot.d, every script is a symbolic link to a file
+ in /etc/rc.d/init.d, and each symlink has a name in the format:
+
+ [0-9][0-9]myname (just like those in rcboot.d)
+
+ When the runlevel is entered, scripts are run in 00-99 order, with
+ "start" as the first and only command-line argument. For example,
+ my system executes the following scripts upon entering runlevel 3:
+
+ /etc/rc.d/rc3.d/20sysklogd start
+ /etc/rc.d/rc3.d/22kerneld start
+ /etc/rc.d/rc3.d/23modules start
+ /etc/rc.d/rc3.d/50urandom start
+ /etc/rc.d/rc3.d/99local start
+
+ When we leave a runlevel, the scripts will be run in the reverse 99-00
+ order with the "stop" argument. This will happen when switching to
+ any other runlevel, including before reboot or halt. So, when
+ switching out of runlevel 3, my system runs the following scripts:
+
+ /etc/rc.d/rc3.d/99local stop
+ /etc/rc.d/rc3.d/50urandom stop
+ /etc/rc.d/rc3.d/23modules stop
+ /etc/rc.d/rc3.d/22kerneld stop
+ /etc/rc.d/rc3.d/20sysklogd stop
+
+ Then, the appropriate startup scripts for the new runlevel are started.
+
+ This design decision was made to simplify the process of maintaining
+ the startup scripts, minimizing the number of links that need to be
+ created as compared to a more traditional SysV startup script approach.
+
+ Some important notes:
+
+ Scripts in the rc[1-5].d directories are expected to handle
+ the "start" and "stop" arguments properly. The "start"
+ argument should cause the script to start a particular service,
+ while the "stop" argument should stop a particular service.
+ If you put a script in rc[1-5].d that is only supposed to do
+ something on startup, and not execute on shutdown, then
+ simply base your script on /etc/rc.d/init.d/SAMPLE,
+ put your commands in the start() function, but put no
+ commands in the stop() function. This way, it will still
+ work properly with Stampede's special script accounting
+ functionality.
+
+ To see what scripts have been started, type:
+
+ 'ls /var/lib/rc.started'
+
+ or `rc-update list`
+
+ To see what network interfaces have been brought up, type:
+
+ 'ls /var/lib/rc.started/inet'
+
+ *rchalt.d*
+
+ Instead of having two separate directories for runlevel 0 (halt) and
+ runlevel 6 (reboot) containing a nearly identical configuration, they
+ were combined into one directory. This simplifies script maintenance.
+
+ all scripts in rchalt.d are run when switching to runlevel 0 or 6,
+ in 00-99 order. They can be simple scripts, and do not have to process
+ the "start" and "stop" arguments (Although they are called with the
+ "start" argument, it is perfectly if this is ignored). After all
+ scripts in the directory have been executed, the system either halts
+ or reboots the system, as appropriate.
+
+ *config*
+
+ The config directory contains various files that are imported by the
+ startup scripts. They provide an easy way to change boot options
+ without "messing" with the scripts themselves. Included here are
+ configuration files for kernel modules, serial ports, colorization
+ features, and many other miscellaneous settings. It's always better
+ (and faster) to change an option here, if possible.
+
+ *guidelines and hints*
+
+ Don't put any real scripts in the rc.* directories. Put them in init.d
+ and put only symbolic links in rc.*. Try out the rc-update tool
+ located in /sbin.
+
+ Any scripts you reference in rc[1-5].d need to behave properly when
+ called with the "start" and "stop" arguments. Scripts referenced from
+ the rcboot.d and rchalt.d directories will always be called with the
+ "start" argument, but this argument can be safely ignored.
+
+ If you don't want to have the rc.local capability, simply delete the
+ 99local file from the directories rc[1-5].d. It's there for new users
+ who want to make "quick and easy" late additions to the startup
+ process. Another option is to write your own script; base it on
+ /etc/rc.d/init.d/SAMPLE.
+
+ Best Regards,
+
+ Daniel Robbins (script designer)
+ drobbins@iolnm.net
+ drobbins@stampede.org
+
+ Special thanks to:
+ The Stampede Development Team & Friends
+ (for suggestions, bug fixes and support)
+
+===============================================================================
diff --git a/sys-apps/baselayout/files/blurb.txt b/sys-apps/baselayout/files/blurb.txt
new file mode 100644
index 000000000000..ce81dc0827d6
--- /dev/null
+++ b/sys-apps/baselayout/files/blurb.txt
@@ -0,0 +1,6 @@
+# Copyright 1999-2000 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# Author First Last <flast@gentoo.org>
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/files/blurb.txt,v 1.1 2000/08/25 03:08:58 drobbins Exp $
+
+
diff --git a/sys-apps/baselayout/files/colors b/sys-apps/baselayout/files/colors
new file mode 100755
index 000000000000..d2b78a1352f1
--- /dev/null
+++ b/sys-apps/baselayout/files/colors
@@ -0,0 +1,16 @@
+#!/bin/bash
+# Display ANSI colours.
+#
+esc="\033["
+echo -n " _ _ _ _ _40 _ _ _ 41_ _ _ _42 _ _ _ 43"
+echo "_ _ _ 44_ _ _ _45 _ _ _ 46_ _ _ _47 _"
+for fore in 30 31 32 33 34 35 36 37; do
+ line1="$fore "
+ line2=" "
+ for back in 40 41 42 43 44 45 46 47; do
+ line1="${line1}${esc}${back};${fore}m Normal ${esc}0m"
+ line2="${line2}${esc}${back};${fore};1m Bold ${esc}0m"
+ done
+ echo -e "$line1\n$line2"
+done
+echo
diff --git a/sys-apps/baselayout/files/inittab b/sys-apps/baselayout/files/inittab
new file mode 100644
index 000000000000..afbe386ebc08
--- /dev/null
+++ b/sys-apps/baselayout/files/inittab
@@ -0,0 +1,52 @@
+#
+# inittab This file describes how the INIT process should set up
+# the system in a certain run-level.
+#
+# Author: Miquel van Smoorenburg, <miquels@cistron.nl>
+# Modified by: Patrick J. Volkerding, <volkerdi@ftp.cdrom.com>
+# Modified by: Daniel Robbins, <drobbins@agapesystems.com>
+
+#
+# Default runlevel.
+
+id:3:initdefault:
+
+# System initialization (runs when system boots).
+si:S:sysinit:/etc/rc.d/init.d/rc S
+
+# Script to run when going single user (runlevel 1).
+~~:S:wait:/sbin/sulogin
+
+# RUNLEVELS
+# 0=halt
+# 1=single user
+# 2=multi-user, no net
+# 3=multi-user, network
+# 4=multi-user, xdm (graphical terminal)
+# 5=customize it to your own liking
+# 6=reboot
+
+l0:0:wait:/etc/rc.d/init.d/rc 0
+l1:1:wait:/etc/rc.d/init.d/rc 1
+l2:2:wait:/etc/rc.d/init.d/rc 2
+l3:3:wait:/etc/rc.d/init.d/rc 3
+l4:4:wait:/etc/rc.d/init.d/rc 4
+l5:5:wait:/etc/rc.d/init.d/rc 5
+l6:6:wait:/etc/rc.d/init.d/rc 6
+z6:6:respawn:/sbin/sulogin
+
+# If you use Login.app, this is how you get it working
+# x1:4:respawn:/usr/bin/Login.app >& /dev/null
+
+# TERMINALS
+c1:12345:respawn:/sbin/agetty 38400 tty1 linux
+c2:12345:respawn:/sbin/agetty 38400 tty2 linux
+c3:12345:respawn:/sbin/agetty 38400 tty3 linux
+c4:12345:respawn:/sbin/agetty 38400 tty4 linux
+c5:23:respawn:/sbin/agetty 38400 tty5 linux
+c6:23:respawn:/sbin/agetty 38400 tty6 linux
+
+# What to do at the "Three Finger Salute".
+ca:12345:ctrlaltdel:/sbin/shutdown -t1 -r now
+
+# End of /etc/inittab
diff --git a/sys-apps/baselayout/files/rc-update b/sys-apps/baselayout/files/rc-update
new file mode 100755
index 000000000000..e7246bf2c78b
--- /dev/null
+++ b/sys-apps/baselayout/files/rc-update
@@ -0,0 +1,204 @@
+#!/bin/bash
+
+. ${ROOT}/etc/rc.d/config/functions
+
+usage() {
+ einfo "Usage: ${0} add <script> [ \"1 2 3 4\" ]"
+ echo " Add script <script> to runlevels in quotes"
+ echo " No runlevels in quotes = add to default runlevels"
+ echo
+ einfo " ${0} del <script> [ \"1 2 3\" ]"
+ echo " Delete script <script> from runlevels in quotes"
+ echo " No runlevels in quotes = add to default runlevels"
+ echo
+ einfo " ${0} autogen {normal|boot|halt} [force]"
+ echo " Reset symlinks in runlevels 1-5, boot, or halt"
+ echo
+ einfo " ${0} list"
+ echo " List scripts available for management"
+ echo
+}
+
+
+doit() {
+ # debug mode
+ "$@"
+}
+
+# linkzap:
+#
+# zaps symlinks you specify, and only symlinks.
+
+linkzap() {
+ local j
+ for j in "$@"
+ do
+ if [ -L ${j} ]
+ then
+ doit rm 2>/dev/null ${j}
+ fi
+ done
+}
+
+# getinfo:
+#
+# will set variables mylevels and mypos to the runlevels and position that the
+# script should be in by default. Returns 0=ok, 1=no #RCUPDATE line, 2=file
+# not found.
+
+getinfo() {
+ if [ -e $1 ]
+ then
+ local myline
+ myline=`grep "^#RCUPDATE" ${1}`
+ if [ "$myline" ]
+ then
+ mylevels=`echo $myline | cut -f2 -d":"`
+ mypos=`echo $myline | cut -f3 -d":"`
+ return 0
+ else
+ return 1
+ fi
+ else
+ eerror "script ${1} not found."
+ return 2
+ fi
+}
+
+resetlevel() {
+ for x in `ls -dA ${ROOT}/etc/rc.d/init.d/*`
+ do
+ if [ ! -f $x ]
+ then
+ continue
+ fi
+ getinfo $x
+ if [ $? -ne 0 ]
+ then
+ continue
+ fi
+ local ok=no
+ for y in $mylevels
+ do
+ if [ "$y" = "$1" ]
+ then
+ local ok=yes
+ fi
+ done
+ if [ "$ok" = "yes" ]
+ then
+ ln -s ../init.d/${x##*/} ${ROOT}/etc/rc.d/rc${1}.d/${mypos}${x##*/}
+ fi
+ done
+}
+
+case $1 in
+autogen)
+ case "$2" in
+ normal|boot|halt)
+ if [ "$3" != "force" ]
+ then
+ einfo "You are asking me to reset symlinks."
+ einfon "Are you sure you want to continue? [y/N]> "
+ read foo
+ else
+ foo=y
+ fi
+ case "$foo" in
+ y|Y|Yes|yes)
+ FROMD=${ROOT}/etc/rc.d/init.d
+ case "$2" in
+ boot)
+ ebegin "Resetting all symlinks in runlevel boot..."
+ linkzap ${ROOT}/etc/rc.d/rcboot.d/*
+ eend 0
+ resetlevel boot
+ einfo "Reset all symlinks in runlevel boot."
+ ;;
+ halt)
+ ebegin "Resetting all symlinks in runlevel halt..."
+ linkzap ${ROOT}/etc/rc.d/rchalt.d/*
+ eend 0
+ resetlevel halt
+ einfo "Reset all symlinks in runlevel halt."
+ ;;
+ normal)
+ ebegin "Resetting all symlinks in runlevels 1-5..."
+ for x in 1 2 3 4 5
+ do
+ linkzap ${ROOT}/etc/rc.d/rc${x}.d/*
+ resetlevel $x
+ done
+ eend 0
+ einfo "Reset all symlinks in runlevels 1-5."
+ ;;
+ *)
+ usage
+ ;;
+ esac
+ ;;
+ n|N|no|No|*)
+ echo "Of course you don't!"
+ ;;
+ esac
+ ;;
+ *)
+ usage
+ ;;
+ esac
+ ;;
+list)
+
+ einfo "Services installed in directory ${ROOT}/etc/rc.d/init.d/"
+ einfo "======================================================================"
+
+ for i in ${ROOT}/etc/rc.d/init.d/*
+ do
+ if [ ! -f ${i} ]
+ then
+ continue
+ fi
+ myline=`grep "^#RCUPDATE" $i`
+ if [ "$myline" ]
+ then
+ echo ${i#${ROOT}/etc/rc.d/init.d/}
+ fi
+ done
+ ;;
+add|del)
+ getinfo ${ROOT}/etc/rc.d/init.d/${2}
+ if [ $? -ne 0 ]
+ then
+ exit 1
+ elif [ "$1" = "add" ]
+ then
+ einfon "Adding ${2} to runlevel "
+ else
+ mylevels="1 2 3 4 5 boot halt"
+ einfon "Removing ${2} from runlevel "
+ fi
+
+ if [ "$3" ]
+ then
+ mylevels="$3"
+ fi
+
+ for i in $mylevels
+ do
+ if [ -d ${ROOT}/etc/rc.d/rc${i}.d ]
+ then
+ linkzap ${ROOT}/etc/rc.d/rc${i}.d/[0-9][0-9]${2}
+ if [ "$1" = "add" ]
+ then
+ doit ln -sf /etc/rc.d/init.d/${2} ${ROOT}/etc/rc.d/rc${i}.d/${mypos}${2}
+ fi
+ einfon "${i} "
+ fi
+ done
+ echo
+ ;;
+*)
+ usage
+ ;;
+esac
+exit 0
diff --git a/sys-apps/baselayout/files/rc.d/config/OFF_inet.eth0 b/sys-apps/baselayout/files/rc.d/config/OFF_inet.eth0
new file mode 100644
index 000000000000..d1f1e5c5ef0c
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/config/OFF_inet.eth0
@@ -0,0 +1,23 @@
+IFACE=eth0
+IPNUM=192.168.1.1
+BCAST=192.168.1.255
+NMASK=255.255.255.0
+NETWK=192.168.1.0
+
+# Comment out the following line if you don't want to config a default gateway
+GTWAY=192.168.1.254
+
+netup() {
+ /sbin/ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK
+ [ $GTWAY ] && /sbin/route add -net default gw $GTWAY netmask 0.0.0.0 metric 1
+
+ ipchains -D input -j DENY -p all -l -s $IPNUM -i $IFACE -d 0.0.0.0/0 2>/dev/null || true
+ ipchains -I input -j DENY -p all -l -s $IPNUM -i $IFACE -d 0.0.0.0/0 >/dev/null
+ ipchains -D input -j DENY -p all -l -s 127.0.0.0/8 -i $IFACE -d 0.0.0.0/0 2>/dev/null || true
+ ipchains -I input -j DENY -p all -l -s 127.0.0.0/8 -i $IFACE -d 0.0.0.0/0 >/dev/null
+}
+
+netdown() {
+ /sbin/ifconfig $IFACE down
+}
+
diff --git a/sys-apps/baselayout/files/rc.d/config/OFF_serial b/sys-apps/baselayout/files/rc.d/config/OFF_serial
new file mode 100644
index 000000000000..c8925e6461cd
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/config/OFF_serial
@@ -0,0 +1,23 @@
+STD_FLAGS="skip_test autoconfig session_lockout"
+
+setports() {
+
+# ADD PORTS TO CONFIGURE HERE (for example, ISA PnP modems configured with isapnp)
+# DEVICE IRQ PORT FLAGS
+
+ setport ttyS0 4 0x3F8 "$STD_FLAGS";
+ setport ttyS1 3 0x2F8 "$STD_FLAGS";
+
+# The above two lines are typical settings for a PC, but may not be yours --
+# Best bet is to check your PC's BIOS, and use those settings above.
+
+# setport ttyS2 7 0x3E8 "$STD_FLAGS";
+
+# This is for my ISA PnP modem, which has been set to these values using
+# the isapnp package.
+# If you have serial support compiled as a module, the serial script
+# script loads your module manually, so that it doesn't ever unload.
+# Otherwise, the serial module will "forget" the settings for your modem
+# when it is dynamically removed from the kernel. (Called "autocleaning")
+
+}
diff --git a/sys-apps/baselayout/files/rc.d/config/basic b/sys-apps/baselayout/files/rc.d/config/basic
new file mode 100644
index 000000000000..6c13378dfcd2
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/config/basic
@@ -0,0 +1,13 @@
+SYSLOGD="" # For remote UDP logging use SYSLOGD="-r"
+KEYMAP="us" # your favorite keymap
+CONSOLEFONT="grfixed" # yout favourite console font
+KLOGD="" # Use KLOGD="-k /boot/System.map-$(uname -r)" to specify System.map
+SULOGIN=no # Set to yes if you want sulogin to be spawned on bootup
+DELAYLOGIN=yes # Set to no if you want to be able to login over telnet/rlogin
+ # before system startup is complete (as soon as inetd is started)
+GMT=no # Set GMT to "yes" if your system clock is set to GMT, and GMT to "no" if not.
+VERBOSE=yes # Set VERBOSE to "no" if you would like a more quiet bootup.
+FSCKFIX=no # Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup.
+
+ARCH=`uname -m` # Architecture
+
diff --git a/sys-apps/baselayout/files/rc.d/config/functions b/sys-apps/baselayout/files/rc.d/config/functions
new file mode 100644
index 000000000000..94c289bd36bf
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/config/functions
@@ -0,0 +1,108 @@
+CM="32;01"
+CE="31;01"
+NORMAL="\033[0m"
+ENOCH_GOOD=$'\e[32m'
+ENOCH_BAD=$'\e[34;01m'
+ENOCH_NORMAL=$'\e[0m'
+ENOCH_HILITE=$'\e[36;01m'
+ENOCH_ENDCOL=$'\e[A\e[73G'
+
+export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
+
+function eecho() {
+ echo "${*}"
+ if [ -n "$BOOTING" ]
+ then
+ echo "${*}" >&2
+ fi
+}
+
+function ebegin() {
+ eecho "${*}..."
+ }
+
+function eerror() {
+ eecho ">>$ENOCH_BAD ${*}$ENOCH_NORMAL"
+ }
+
+function eend() {
+ if [ $1 -eq 0 ]; then
+ eecho "$ENOCH_ENDCOL$ENOCH_NORMAL[$ENOCH_GOOD ok $ENOCH_NORMAL]"
+ else
+ if [ $# -ge 2 ]; then
+ shift
+ eerror $*
+ fi
+ eecho "$ENOCH_ENDCOL$ENOCH_NORMAL[$ENOCH_BAD oops $ENOCH_NORMAL]"
+ fi
+ }
+
+function doservice() {
+ WHOISME=`/usr/bin/whoami`
+ if [ -x "$WHOISME" ]
+ then
+ if [ "${WHOISME}" != "root" ]; then
+ eerror "You must be root to do this."
+ exit 2
+ fi
+ fi
+ if [ $# -ne 1 ]; then
+ doservice usage
+ exit 1
+ fi
+ for arf in $opts; do
+ eval do_${arf}=1
+ done
+
+ case $1 in
+ start)
+ if [ ! $do_start ]; then
+ doservice usage
+ else
+ start
+ fi
+ ;;
+ stop)
+ if [ ! $do_stop ]; then
+ doservice usage
+ else
+ stop
+ fi
+ ;;
+ reconfig)
+ if [ ! $do_reconfig ]; then
+ doservice usage
+ else
+ reconfig
+ fi
+ ;;
+ restart)
+ if ! (( $do_start && $do_stop )); then
+ doservice usage
+ else
+ stop
+ sleep 3
+ start
+ fi
+ ;;
+ *)
+ foof="Usage: ${SERVICE} {"
+ for moof in $opts; do
+ foof="${foof}${moof}|"
+ done
+ if (( $do_start && $do_stop )); then
+ foof="${foof}restart"
+ fi
+ eecho "${foof}"
+ ;;
+ esac
+ }
+
+function einfo() {
+ eecho "$ENOCH_HILITE$1$ENOCH_NORMAL"
+ }
+
+function einfon() {
+ eecho -n "$ENOCH_HILITE$1$ENOCH_NORMAL"
+ }
+
diff --git a/sys-apps/baselayout/files/rc.d/config/inet.lo b/sys-apps/baselayout/files/rc.d/config/inet.lo
new file mode 100644
index 000000000000..c4f1aeed8390
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/config/inet.lo
@@ -0,0 +1,7 @@
+netup() {
+ /sbin/ifconfig lo 127.0.0.1 up
+}
+
+netdown() {
+ /sbin/ifconfig lo down
+}
diff --git a/sys-apps/baselayout/files/rc.d/config/modules b/sys-apps/baselayout/files/rc.d/config/modules
new file mode 100644
index 000000000000..28d2f5c36b51
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/config/modules
@@ -0,0 +1,9 @@
+# Put modules to be loaded, with arguments, one per line
+# The following lines will be called with "modprobe"
+#eth0
+#isofs
+#msdos
+#snd-audiopci1370
+#snd-pcm1-oss
+#snd-mixer-oss
+
diff --git a/sys-apps/baselayout/files/rc.d/config/runlevels b/sys-apps/baselayout/files/rc.d/config/runlevels
new file mode 100644
index 000000000000..5ee5b614b18c
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/config/runlevels
@@ -0,0 +1,15 @@
+#Text names for runlevels
+
+desc0="##OSNAME##"
+desc1="##ARCH##"
+desc2="K"`uname -r`
+rlboot=" Boot "
+rlhalt="Shutdown Complete -- Ready to Power Down"
+rl[0]="Shutdown"
+rl[1]=" Single "
+rl[2]=" No Net "
+rl[3]="Standard"
+rl[4]="XWindows"
+rl[5]=" Custom "
+rl[6]=" Reboot "
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/bootmisc b/sys-apps/baselayout/files/rc.d/init.d/bootmisc
new file mode 100755
index 000000000000..e5478b11f78e
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/bootmisc
@@ -0,0 +1,39 @@
+#!/bin/sh
+#RCUPDATE:boot:40:This line is required for script management
+
+if [ "$1" != "start" ]
+then
+ exit 0
+fi
+
+. /etc/rc.d/config/basic
+. /etc/rc.d/config/functions
+
+# Put a nologin file in /etc to prevent people from logging in before
+# system startup is complete.
+if [ "$DELAYLOGIN" = "yes" ]
+then
+ echo "System bootup in progress - please wait" > /etc/nologin
+ cp /etc/nologin /etc/nologin.boot
+fi
+
+#
+# Clean up any stale locks.
+#
+ebegin "Cleaning /var/lock, /var/run"
+( cd /var/lock && find . -type f -exec rm -f -- {} \; 1>&2 )
+#
+# Clean up /var/run and create /var/run/utmp so that we can login.
+#
+( cd /var/run && \
+ find . ! -type d ! -name utmp ! -name innd.pid ! -name random-seed \
+ -exec rm -f -- {} \; 1>&2 )
+: > /var/run/utmp
+eend 0
+
+#
+# Set pseudo-terminal access permissions.
+#
+chmod 666 /dev/tty[p-za-e][0-9a-f]
+chown root:tty /dev/tty[p-za-e][0-9a-f]
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/checkfs b/sys-apps/baselayout/files/rc.d/init.d/checkfs
new file mode 100755
index 000000000000..455b69131cc8
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/checkfs
@@ -0,0 +1,37 @@
+#!/bin/sh
+#RCUPDATE:boot:10:This line is required for script management
+
+. /etc/rc.d/config/basic
+. /etc/rc.d/config/functions
+
+# Check the rest of the filesystems.
+if [ ! -f /fastboot ]
+then
+ if [ -f /forcefsck ]
+ then
+ force="-f"
+ else
+ force=""
+ fi
+ if [ "$FSCKFIX" = yes ]
+ then
+ fix="-y"
+ else
+ fix="-a"
+ fi
+ ebegin "Checking all filesystems"
+ fsck -R -A $fix $force 1>&2
+ if [ $? -eq 0 ]
+ then
+ eend 0
+ elif [ $? -eq 1 ]
+ then
+ eend 1 "Filesystem errors corrected."
+ else
+ eend 2 "Fsck could not correct all errors, manual repair needed"
+ /sbin/sulogin $CONSOLE
+ fi
+ touch /var/log/boot
+fi
+rm -f /fastboot /forcefsck
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/checkroot b/sys-apps/baselayout/files/rc.d/init.d/checkroot
new file mode 100755
index 000000000000..b2e4ba0da766
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/checkroot
@@ -0,0 +1,105 @@
+#!/bin/sh
+#RCUPDATE:boot:05:This line is required for script management
+
+
+. /etc/rc.d/config/basic
+. /etc/rc.d/config/functions
+
+#
+# Set SULOGIN to yes if you want a sulogin to be spawned from
+# this script *before anything else* with a timeout, like on SCO.
+#
+[ "$SULOGIN" = yes ] && sulogin -t 10 $CONSOLE
+
+# There may be Multiple Devices, so prepare MD
+# Don't need this anymore! -DR
+
+# Activate the swap device(s) in /etc/fstab. This needs to be done
+# before fsck, since fsck can be quite memory-hungry.
+#
+if [ -x /sbin/swapon ]
+then
+ ebegin "Activating swap"
+ swapon -a 1>&2
+ eend $? "Error activating swap."
+fi
+
+#
+# Ensure that bdflush (update) is running before any major I/O is
+# performed (the following fsck is a good example of such activity :).
+#
+[ -x /sbin/update ] && update 1>&2
+
+#
+# Check the root filesystem.
+#
+if [ -f /fastboot ]
+then
+ ebegin "Fast boot, no filesystem check."
+ eend 0
+else
+ #
+ # Ensure that root is quiescent and read-only before fsck'ing.
+ #
+ mount -n -o remount,ro / 1>&2
+ if [ $? = 0 ]
+ then
+ if [ -f /forcefsck ]
+ then
+ force="-f"
+ else
+ force=""
+ fi
+ if [ "$FSCKFIX" ]
+ then
+ fix="-y"
+ else
+ fix="-a"
+ fi
+ ebegin "Checking root filesystem"
+ fsck $force $fix / 1>&2
+ #
+ # If there was a failure, drop into single-user mode.
+ #
+ # NOTE: "failure" is defined as exiting with a return code of
+ # 2 or larger. A return code of 1 indicates that filesystem
+ # errors were corrected but that the boot may proceed.
+ #
+ if [ $? -eq 0 ]
+ then
+ eend 0
+ elif [ $? -eq 1 ]
+ then
+ eend 1 "Root filesystem errors corrected."
+ else
+ eend 2 "Fsck could not fix errors on root fs; reboot needed!"
+ /sbin/sulogin $CONSOLE
+ reboot -f
+ fi
+ else
+ eend 3 "Cannot fsck root fs because it is mounted read-write!"
+ einfo "You should have lilo or loadlin mount your root file"
+ einfo "system read-only (ro), not read-write (rw)."
+ sleep 1
+ fi
+fi
+
+#
+# Remount rootfs rw (default), but do not try to change mtab because it
+# is on a ro fs until the remount succeeded. Then clean up old mtabs and
+# finally write the new mtab.
+#
+ebegin "Remounting root filesystem"
+mount -n -o remount,rw / 1>&2
+myerror=$?
+rm -f /etc/mtab~ /etc/nologin 1>&2
+myerror=$(( $myerror + $? ))
+: > /etc/mtab
+myerror=$(( $myerror + $? ))
+mount -o remount,rw / 1>&2
+myerror=$(( $myerror + $? ))
+eend $myerror "Error mounting root fs!"
+ebegin "Mounting /proc"
+mount /proc 1>&2
+eend $? "Error mounting /proc!"
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/clock b/sys-apps/baselayout/files/rc.d/init.d/clock
new file mode 100755
index 000000000000..c067316caebc
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/clock
@@ -0,0 +1,29 @@
+#!/bin/sh
+#RCUPDATE:boot:20:This line is required for script management
+
+. /etc/rc.d/config/functions
+. /etc/rc.d/config/basic
+
+if [ ! -f /etc/adjtime ]
+then
+ echo "0.0 0 0.0" > /etc/adjtime
+fi
+
+if [ "$GMT" = "yes" ]
+then
+ GMT="-u"; GMTT="--utc"
+ TBLURB="[GMT]"
+else
+ GMT=""; GMTT=""
+ TBLURB="[Local Time]"
+fi
+
+if [ -x /sbin/hwclock ]
+then
+ ebegin "Setting system clock to hardware clock ${TBLURB}"
+ /sbin/hwclock --adjust ${GMTT} 1>&2
+ /sbin/hwclock --hctosys ${GMTT} 1>&2
+ eend 0
+else
+ eend 1 "hwclock executable not found"
+fi
diff --git a/sys-apps/baselayout/files/rc.d/init.d/halt b/sys-apps/baselayout/files/rc.d/init.d/halt
new file mode 100755
index 000000000000..ec280be610bc
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/halt
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# halt Execute the halt command.
+#
+# Version: @(#)halt 2.75 19-May-1998 miquels@cistron.nl
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# See if we need to cut the power.
+if [ -x /etc/rc.d/init.d/ups-monitor ]
+then
+ /etc/rc.d/init.d/ups-monitor poweroff
+fi
+
+/sbin/halt -nfip
diff --git a/sys-apps/baselayout/files/rc.d/init.d/hostname b/sys-apps/baselayout/files/rc.d/init.d/hostname
new file mode 100755
index 000000000000..10b119dfb8cb
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/hostname
@@ -0,0 +1,10 @@
+#!/bin/sh
+#RCUPDATE:boot:30:This line is required for script management
+
+. /etc/rc.d/config/functions
+
+myhost=`cat /etc/hostname` 1>&2
+ebegin "Setting hostname to $myhost"
+/sbin/hostname ${myhost}
+eend $?
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/inet b/sys-apps/baselayout/files/rc.d/init.d/inet
new file mode 100755
index 000000000000..8f071932918b
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/inet
@@ -0,0 +1,114 @@
+#! /bin/sh
+#RCUPDATE:3 4:70:This line is required for script management
+
+# inet start brings up all interfaces
+# inet stop brings down all interface
+# inet start <iface> brings up <iface>
+# inet stop <iface> brings down <iface>
+# configuration files are in /etc/rc.d/config/inet.<iface>
+
+. /etc/rc.d/config/functions
+
+opts="start stop restart"
+
+intstat() {
+ local ints=`/sbin/netstat -i | tail --lines +3 | cut -f1 -d" "`
+ for x in $ints
+ do
+ if [ "$1" = "$x" ]
+ then
+ echo "up"
+ return
+ fi
+ done
+ echo "down"
+}
+
+doint() {
+# bring an interface up or down
+# ${1} = interface
+# ${2} = "down" or "up"
+ if [ "`intstat ${1}`" != "${2}" ]
+ then
+ . /etc/rc.d/config/inet.${1}
+ net${2} 1>&2
+ ebegin "Bringing ${1} ${2}"
+ if [ "`intstat ${1}`" = "$2" ]
+ then
+ eend 0
+
+ else
+ eend 1 "Error bringing ${1} ${2}."
+ fi
+ else
+ eerror "Interface ${1} is already ${2}."
+ fi
+}
+
+doints() {
+
+ if [ "$1" = "up" ]
+ then
+ doint lo up
+ fi
+
+ for x in /etc/rc.d/config/inet.*
+ do
+ myint=${x##*.}
+ if [ "$myint" != "lo" ]
+ then
+ doint ${myint} ${1}
+ fi
+ done
+
+ if [ "$1" = "down" ]
+ then
+ doint lo down
+ fi
+
+}
+
+
+if [ "$#" = "1" ]
+then
+ ifaces="all"
+else
+ ifaces=$2
+fi
+
+start() {
+
+ if [ "$ifaces" = "all" ]
+ then
+ doints "up"
+ elif [ -e /etc/rc.d/config/inet.${ifaces} ]
+ then
+ doint ${ifaces} "up"
+ else
+ eerror "Interface config /etc/rc.d/config/inet.${2} not found."
+ fi
+}
+
+stop() {
+
+ if [ "$ifaces" = "all" ]
+ then
+ doints "down"
+ elif [ -e /etc/rc.d/config/inet.${ifaces} ]
+ then
+ doint ${ifaces} "down"
+ else
+ eerror "Interface config /etc/rc.d/config/inet.${2} not found."
+ fi
+
+}
+
+restart() {
+
+ stop
+ start
+
+}
+
+doservice ${@}
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/initscripts-install b/sys-apps/baselayout/files/rc.d/init.d/initscripts-install
new file mode 100755
index 000000000000..a373cafcabdb
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/initscripts-install
@@ -0,0 +1,17 @@
+#!/bin/sh
+. ${ROOT}/etc/rc.d/config/functions
+einfo "Setting up initscripts..."
+ln -sf init.d/local ${ROOT}/etc/rc.d/rc.local
+einfo "Setting up symlinks..."
+${ROOT}/usr/sbin/rc-update autogen boot force
+${ROOT}/usr/sbin/rc-update autogen halt force
+for i in bootmisc checkfs checkroot clock hostname \
+ inet isapnp keymaps local modules mountall \
+ pretty rmlogin sendsigs serial single \
+ sysklogd umountfs urandom vcron xinetd
+do
+ ${ROOT}/usr/sbin/rc-update add $i
+done
+
+
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/isapnp b/sys-apps/baselayout/files/rc.d/init.d/isapnp
new file mode 100755
index 000000000000..32fc970a651f
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/isapnp
@@ -0,0 +1,18 @@
+#!/bin/sh
+#RCUPDATE:boot:25:This line is required for script management
+#This will enumerate the ISA PnP Boards in the system, and configure them if
+#it finds the file $CONFFILE
+
+source /etc/rc.d/config/functions
+
+CONFFILE=/etc/isapnp.conf
+
+if [ -e $CONFFILE ]; then
+ if [ -e /sbin/isapnp ]
+ then
+ ebegin "Configuring ISA PnP devices"
+ /sbin/isapnp $CONFFILE 1>&2
+ eend $? "Error configuring ISA PnP"
+ fi
+fi
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/keymaps b/sys-apps/baselayout/files/rc.d/init.d/keymaps
new file mode 100755
index 000000000000..6e7fdc996f6a
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/keymaps
@@ -0,0 +1,18 @@
+#!/bin/sh
+#RCUPDATE:boot:30:This line is required for script management
+
+if [ "${1}" != "start" ]
+then
+ exit 0
+fi
+
+. /etc/rc.d/config/basic
+. /etc/rc.d/config/functions
+
+LOADKEY=/usr/bin/loadkeys
+
+ebegin "Loading keymap"
+${LOADKEY} ${KEYMAP} 1>&2
+eend $? "Error loading keymap!"
+
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/local b/sys-apps/baselayout/files/rc.d/init.d/local
new file mode 100755
index 000000000000..a38ff2175ede
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/local
@@ -0,0 +1,34 @@
+#!/bin/sh
+#RCUPDATE:1 2 3 4 5:99:This line is required for script management
+
+. /etc/rc.d/config/functions
+
+SERVICE=local
+opts="start stop restart"
+
+start() {
+ ebegin "Starting local"
+ # This is a good place to load any misc.
+ # programs on startup ( 1>&2 )
+ eend $? "Started local."
+}
+
+stop() {
+ ebegin "Stopping local"
+ # This is a good place to unload any misc.
+ # programs you started above.
+ # For example, if you are using OSS and have
+ # "/usr/local/bin/soundon" above, put
+ # "/usr/local/bin/soundoff" here.
+ eend $? "Stopped local."
+}
+
+restart() {
+
+ stop
+ start
+
+}
+
+doservice ${@}
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/modules b/sys-apps/baselayout/files/rc.d/init.d/modules
new file mode 100755
index 000000000000..7a8e2b459586
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/modules
@@ -0,0 +1,81 @@
+#!/bin/sh
+#RCUPDATE:boot:50:This line is required for script management
+#
+# rc.modules : specify modules to insert (they will stay inserted forever)
+# Included with Stampede Linux 0.90
+# Copyright 1998 Daniel Robbins
+# Distributed under the GPL
+#
+# Version History:
+# Oct 21 1998 -- v0.9 -- A simple little script; let's see how it works.
+#
+
+#This only gets run on
+if [ "$1" != "start" ]
+then
+ exit 0
+fi
+
+. /etc/rc.d/config/functions
+KERNVERS=`uname -r`
+
+if [ ! -e /lib/modules/${KERNVERS}/modules.dep ]
+then
+
+ ebegin "Calculating kernel module dependencies"
+ depmod -a 1>&2
+ eend $? "Error calculating module dependencies."
+fi
+
+if [ ! -d /etc/modules ]
+then
+ mkdir /etc/modules 1>&2
+fi
+
+if [ -e /etc/modules.conf ]
+then
+ mv /etc/modules.conf /etc/modules.conf.bak 1>&2
+fi
+
+if [ -e /etc/conf.modules ]
+then
+ mv /etc/conf.modules /etc/conf.modules.bak 1>&2
+fi
+
+if [ ! -e /etc/modules/${KERNVERS} ]
+then
+ ebegin "Auto-generating ${KERNVERS} modules.conf"
+ modprobe -c >/etc/modules/${KERNVERS}
+ if [ $? -eq 0 ]
+ then
+ eend 0
+ einfo "File /etc/modules/${KERNVERS} created."
+ einfo "Please customize this file as desired."
+ else
+ eend 1 "Error configuring module dependencies."
+ fi
+fi
+
+cp /etc/modules/${KERNVERS} /etc/modules.conf 1>&2
+touch /lib/modules/${KERNVERS}/modules.dep #Go away errors
+
+
+
+mod_load() {
+ if [ $# -gt 0 ]
+ then
+ ebegin "Inserting module ${1}"
+ /bin/sh -c "/sbin/modprobe ${1} >/dev/null 2>&1" >/dev/null 2>&1
+ eend $?
+ fi
+}
+
+if [ -e /etc/rc.d/config/modules ]
+then
+ cat /etc/rc.d/config/modules | grep -v ^# | sed s/^/"mod_load "/ >/tmp/domods
+ . /tmp/domods
+ if [ ! -L /tmp/domods ]
+ then
+ rm /tmp/domods
+ fi
+fi
diff --git a/sys-apps/baselayout/files/rc.d/init.d/mountall b/sys-apps/baselayout/files/rc.d/init.d/mountall
new file mode 100755
index 000000000000..0c51b767ba43
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/mountall
@@ -0,0 +1,10 @@
+#!/bin/sh
+#RCUPDATE:boot:15:This line is required for script management
+. /etc/rc.d/config/functions
+
+# Mount local filesystems in /etc/fstab.
+ebegin "Mounting local filesystems"
+mount -avt nonfs,noproc 1>&2
+eend $? "Problem mounting local filesystems."
+touch /var/log/.boot
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/mountall.test b/sys-apps/baselayout/files/rc.d/init.d/mountall.test
new file mode 100755
index 000000000000..9dcf6ee54b2e
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/mountall.test
@@ -0,0 +1,8 @@
+#!/bin/sh
+#RCUPDATE:boot:15:This line is required for script management
+. /tmp/initscripts-0.99/etc/rc.d/config/functions
+
+# Mount local filesystems in /etc/fstab.
+ebegin "Mounting local filesystems"
+echo mount -avt nonfs,noproc 1>&2
+eend $? "Problem mounting local filesystems."
diff --git a/sys-apps/baselayout/files/rc.d/init.d/pretty b/sys-apps/baselayout/files/rc.d/init.d/pretty
new file mode 100755
index 000000000000..1f1518edeeac
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/pretty
@@ -0,0 +1,21 @@
+#!/bin/sh
+#RCUPDATE:boot:01:This line is required for script management
+
+if [ "${1}" != "start" ]
+then
+ exit 0
+fi
+
+. /etc/rc.d/config/basic
+. /etc/rc.d/config/functions
+
+if [ -e /usr/bin/consolechars ]
+then
+ /usr/bin/consolechars -f ${CONSOLEFONT}
+fi
+einfo "Booting Enoch 0.75"
+einfo "(All boot info logged to /var/log/boot)"
+echo
+sleep 1
+
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/rc b/sys-apps/baselayout/files/rc.d/init.d/rc
new file mode 100755
index 000000000000..1b86bfd7802c
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/rc
@@ -0,0 +1,167 @@
+#!/bin/sh
+# rc This file is responsible for starting/stopping
+# services when the runlevel changes.
+
+. /etc/rc.d/config/runlevels
+. /etc/rc.d/config/basic
+. /etc/rc.d/config/functions
+
+bootbar() {
+ case "$1" in
+ on)
+ mysplit() {
+ LINES=$1
+ COLUMNS=$2
+ }
+ mysplit `stty size`
+ if [ "$3" = "S" ]
+ then
+ mode="[ "${rlboot}" ]"
+ hilite="\033[44;32;01m"
+ elif [ "$2" = "S" ]
+ then
+ mode="[ "${rl[${3}]}" ]"
+ hilite="\033[44;32;01m"
+ elif [ "$2" = "K" ]
+ then
+ mode="[ "${rl[${3}]}" ]"
+ hilite="\033[44;33;01m"
+ elif [ "$2" = "H" ]
+ then
+ mode=${rlhalt}
+ hilite="\033[40;32;01m"
+ else
+ echo "Error!"
+ exit 1
+ fi
+ blank=" "
+ header="\n\0337\033[01;$((${LINES}-1))r\033[${LINES};01f\033[01;44;32m ${desc0}-\033[44;37m${desc1} "
+ echo -ne "${header}\033[01;44;35m${desc2}${blank:0:${COLUMNS}-((5+${#desc1}+${#desc2}+${#mode}+${#desc0}))}${hilite} ${mode} \033[0m\0338\033[A"
+
+ ;;
+ off)
+ echo -ne "\0337\033[r\033[${LINES};01f\033[K\0338"
+ ;;
+ *)
+ ;;
+ esac
+}
+
+# Un-comment the following for debugging.
+#debug=echo
+
+#
+# Start script or program.
+#
+
+startup() {
+ if [ -e /var/log/.boot ]
+ then
+ sh "$@" 2>>/var/log/boot
+ else
+ sh "$@" 2>/dev/null
+ fi
+}
+
+ # Ignore CTRL-C only in this shell, so we can interrupt subprocesses.
+ trap ":" INT QUIT TSTP
+
+ # Set onlcr to avoid staircase effect.
+ stty onlcr 0>&1
+
+ # Now find out what the current and what the previous runlevel are.
+
+ runlevel=$RUNLEVEL
+ # Get first argument. Set new runlevel to this argument.
+ [ "$1" != "" ] && runlevel=$1
+
+ previous=$PREVLEVEL
+
+ case "$runlevel" in
+ S)
+ mypath="rcboot.d"
+ ;;
+ 6)
+ mypath="rchalt.d"
+ ;;
+ 0)
+ mypath="rchalt.d"
+ ;;
+ *)
+ mypath="rc${runlevel}.d"
+ ;;
+ esac
+
+bootbar on K ${previous}
+
+ export runlevel previous
+echo
+
+if [ "$previous" != "N" ]
+then
+ einfo "[ stopping runlevel ${previous} ]"
+ sleep 3
+else
+ export BOOTING="yes"
+fi
+
+
+#Kill scripts in reverse order from how they were started in prev. runlevel
+if [ "$previous" != "N" ] && [ -d /etc/rc.d/rc${previous}.d ]
+then
+
+ #Reversing directory list
+ rcs=""
+ for a in /etc/rc.d/rc${previous}.d/[0-9][0-9]*
+ do
+ rcs="${a} ${rcs}"
+ done
+ #Killing old scripts in reverse order
+ for i in ${rcs}
+ do
+ if [ "$previous" != "N" ]
+ then
+ [ -e $i ] && startup $i stop
+ fi
+ done
+fi
+
+if [ "$previous" != "N" ]
+then
+ einfo "[ sleeping for 3 seconds before starting runlevel ${runlevel} ]"
+ sleep 3
+ einfo "[ starting runlevel ${runlevel} ]"
+fi
+
+bootbar on S ${runlevel}
+
+if [ -d /etc/rc.d/${mypath} ]
+then
+ #Running new scripts in alphabetical order
+ for i in /etc/rc.d/${mypath}/[0-9][0-9]*
+ do
+ [ -e $i ] && startup $i start
+ done
+fi
+
+case "$runlevel" in
+ 6)
+ startup /etc/rc.d/init.d/reboot
+ ;;
+ 0)
+ startup /etc/rc.d/init.d/halt
+ ;;
+ *)
+ ;;
+esac
+
+if [ "$1" != "S" ]
+then
+ bootbar off
+fi
+if [ "$previous" != "N" ]
+then
+ einfo "Press <enter> to continue..."
+else
+ rm -f /var/log/.boot
+fi
diff --git a/sys-apps/baselayout/files/rc.d/init.d/reboot b/sys-apps/baselayout/files/rc.d/init.d/reboot
new file mode 100755
index 000000000000..34759e50a4c9
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/reboot
@@ -0,0 +1,14 @@
+#! /bin/sh
+#
+# reboot Execute the reboot command.
+#
+# Version: @(#)reboot 2.75 22-Jun-1998 miquels@cistron.nl
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+. /etc/rc.d/config/functions
+
+einfo "Rebooting... "
+
+/sbin/reboot -nfi
diff --git a/sys-apps/baselayout/files/rc.d/init.d/rmnologin b/sys-apps/baselayout/files/rc.d/init.d/rmnologin
new file mode 100755
index 000000000000..d069885fb797
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/rmnologin
@@ -0,0 +1,12 @@
+#!/bin/sh
+#RCUPDATE:1 2 3 4 5:99:This line is required for script management
+
+# This is an important file, and should be run at a point in the startup
+# sequence where you feel comfortable allowing users to log in. Normally
+# it's run at the very end, but it does *need* to be run at some point.
+
+if [ -f /etc/nologin.boot ]
+then
+ rm -f /etc/nologin /etc/nologin.boot
+fi
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/sendsigs b/sys-apps/baselayout/files/rc.d/init.d/sendsigs
new file mode 100755
index 000000000000..41a8cf9be90e
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/sendsigs
@@ -0,0 +1,17 @@
+#!/bin/sh
+#RCUPDATE:halt:20:This line is required for script management
+
+. /etc/rc.d/config/functions
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# Kill all processes.
+ebegin "Sending all processes the TERM signal"
+killall5 -15
+eend $?
+sleep 5
+ebegin "Sending all processes the KILL signal"
+killall5 -9
+eend $?
+halt -w
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/serial b/sys-apps/baselayout/files/rc.d/init.d/serial
new file mode 100755
index 000000000000..bf2ae955f756
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/serial
@@ -0,0 +1,68 @@
+#!/bin/sh
+#RCUPDATE:boot:27:This line is required for script management
+#
+# rc.serial : set the serial ports up on your machine
+# Included with Stampede Linux 0.90
+# Copyright 1998 Daniel Robbins
+# Distributed under the GPL
+#
+# Version History:
+# Oct 21 1998 -- v0.9 -- colorized, advanced module detection, kernel 2.0.x and 2.1.x
+# compatibility check. Right on!
+
+. /etc/rc.d/config/functions
+if [ -e /etc/rc.d/config/serial ]
+then
+ . /etc/rc.d/config/serial
+else
+ exit 0
+fi
+
+SETSERIAL="/sbin/setserial"
+
+# ===================================================================================
+# DO NOT CHANGE ANYTHING BELOW THIS LINE UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!!!
+# ===================================================================================
+
+no_errs=1
+done=""
+
+moduleinserted() {
+ local res=`cat /proc/modules | grep serial | cut -f1 -d" "`
+ if [ "$res" ]
+ then
+ if [ "$res" = "serial" ]
+ then
+ return 1
+ fi
+ fi
+ return 0
+}
+
+setport() {
+ # arguments: device, irq, port, args
+
+ #if serial module exists, and it's not inserted, insert it permanently
+ if [ -f /lib/modules/`uname -r`/misc/serial.o ]
+ then
+ moduleinserted;
+ if [ $? -eq 0 ]
+ then
+ insmod serial 1>&2
+ fi
+ fi
+
+ ebegin "Setting /dev/${1}"
+ ${SETSERIAL} -b /dev/${1} irq ${2} port ${3} ${4} 1>&2
+ if [ $? -gt 0 ]
+ then
+ eend 1 "Error setting serial port ${1} to irq ${2} port ${3} (args: ${4})"
+ no_errs=0
+ else
+ eend 0
+ done="${done} /dev/${1}"
+ fi
+}
+
+setports;
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/single b/sys-apps/baselayout/files/rc.d/init.d/single
new file mode 100755
index 000000000000..f15dcab46b20
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/single
@@ -0,0 +1,10 @@
+#!/bin/sh
+#RCUPDATE:1:99:This line is required for script management
+
+if [ "$1" != "start" ]
+then
+ exit 0
+fi
+
+. /etc/rc.d/config/functions
+einfo "Entered single-user mode."
diff --git a/sys-apps/baselayout/files/rc.d/init.d/sysklogd b/sys-apps/baselayout/files/rc.d/init.d/sysklogd
new file mode 100755
index 000000000000..ddf81b7b0546
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/sysklogd
@@ -0,0 +1,44 @@
+#!/bin/sh
+#RCUPDATE:1 2 3 4 5:20:This line is required for script management
+
+klog="/usr/sbin/klogd"
+slog="/usr/sbin/syslogd"
+
+. /etc/rc.d/config/functions
+
+SERVICE=sysklogd
+opts="start stop restart reconfig"
+
+start() {
+ ebegin "Starting syslogd, klogd"
+ start-stop-daemon --start --exec $slog -- $SYSLOGD 1>&2
+ retval=$?
+ start-stop-daemon --start --exec $klog -- $KLOGD 1>&2
+ retval=$(( $retval + $? ))
+ eend $retval
+}
+
+stop() {
+ ebegin "Stopping klogd, syslogd"
+ start-stop-daemon --stop --pidfile /var/run/klogd.pid 1>&2
+ retval=$?
+ start-stop-daemon --stop --pidfile /var/run/syslogd.pid 1>&2
+ retval=$(( $retval + $? ))
+ eend $retval
+}
+
+restart() {
+
+ stop
+ start
+
+}
+
+reconfig() {
+ ebegin "Reconfiguring syslogd"
+ start-stop-daemon --stop --signal 1 --pidfile /var/run/syslogd.pid 1>&2
+ eend $?
+}
+
+doservice ${@}
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/umountfs b/sys-apps/baselayout/files/rc.d/init.d/umountfs
new file mode 100755
index 000000000000..6dadfa8cb527
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/umountfs
@@ -0,0 +1,29 @@
+#!/bin/sh
+#RCUPDATE:halt:50:This line is required for script management
+# Version: @(#)umountfs 2.73 26-Nov-1997 miquels@cistron.nl
+
+. /etc/rc.d/config/functions
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# Write a reboot record to /var/log/wtmp before unmounting
+halt -w 1>&2
+ebegin "Deactivating swap"
+swapoff -a 1>&2
+eend $?
+ebegin "Unmounting filesystems"
+umount -a
+if [ "$?" = "1" ]
+then
+ eend 1 "hmmmm..."
+ ebegin "Trying to unmount again"
+ umount -a -r -f
+ eend $?
+else
+ eend 0
+fi
+ebegin "Remounting root fs read-only"
+mount -n -o remount,ro /
+eend $?
+sync; sync; sleep 3
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/urandom b/sys-apps/baselayout/files/rc.d/init.d/urandom
new file mode 100755
index 000000000000..ba3417bd6e18
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/urandom
@@ -0,0 +1,40 @@
+#!/bin/sh
+#RCUPDATE:1 2 3 4 5:50:This line is required for script management
+
+[ -c /dev/urandom ] || exit 0
+
+. /etc/rc.d/config/functions
+
+SERVICE=urandom
+opts="start stop restart"
+
+start() {
+ ebegin "Initializing random number generator"
+ if [ -f /var/run/random-seed ]
+ then
+ cat /var/run/random-seed >/dev/urandom
+ fi
+ rm -f /var/run/random-seed
+ umask 077
+ dd if=/dev/urandom of=/var/run/random-seed count=1 1>&2
+ eend $? "Error initializing random number generator"
+ umask 022
+}
+
+stop() {
+ ebegin "Saving random seed"
+ # Carry a random seed from shut-down to start-up;
+ # see documentation in linux/drivers/char/random.c
+ umask 077
+ dd if=/dev/urandom of=/var/run/random-seed count=1 1>&2
+ eend $? "Could not save random seed."
+}
+
+restart() {
+
+ stop
+ start
+}
+
+doservice ${@}
+
diff --git a/sys-apps/baselayout/files/rc.d/init.d/vcron b/sys-apps/baselayout/files/rc.d/init.d/vcron
new file mode 100755
index 000000000000..681c3de72a5f
--- /dev/null
+++ b/sys-apps/baselayout/files/rc.d/init.d/vcron
@@ -0,0 +1,32 @@
+#!/bin/sh
+#RCUPDATE:2 3 4:80:This line is required for script management
+
+. /etc/rc.d/config/functions
+
+SERVICE=cron
+DESC="vcron"
+EXE=/usr/bin/cron
+opts="start stop restart"
+
+start() {
+ ebegin "Starting ${DESC}"
+ start-stop-daemon --start --quiet --exec ${EXE} -- 1>&2
+ eend $? "Error starting ${DESC}."
+}
+
+stop() {
+ ebegin "Stopping ${DESC}"
+ start-stop-daemon --stop --quiet --exec ${EXE} -- 1>&2
+ eend $? "Error stopping ${DESC}."
+}
+
+restart() {
+
+ stop
+ start
+
+}
+
+
+doservice ${@}
+