create branch for 2.2

This commit is contained in:
Johannes Winkelmann 2006-02-23 15:26:10 +00:00
commit 38ada5cc3d
8 changed files with 284 additions and 0 deletions

30
inittab Normal file
View File

@ -0,0 +1,30 @@
#
# /etc/inittab: system runlevel description
#
# Runlevels:
# 0 Halt
# 1(S) Single-user
# 2 Multi-user
# 3-5 Not used
# 6 Reboot
id:2:initdefault:
rc::sysinit:/etc/rc
rs:S1:wait:/etc/rc.single
rm:2:wait:/etc/rc.multi
rd:06:wait:/etc/rc.shutdown
su:S:wait:/sbin/sulogin -p
c1:2:respawn:/sbin/agetty 38400 vc/1 linux
c2:2:respawn:/sbin/agetty 38400 vc/2 linux
c3:2:respawn:/sbin/agetty 38400 vc/3 linux
c4:2:respawn:/sbin/agetty 38400 vc/4 linux
c5:2:respawn:/sbin/agetty 38400 vc/5 linux
c6:2:respawn:/sbin/agetty 38400 vc/6 linux
#s1:2:respawn:/sbin/agetty 38400 tts/0 vt100
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
# End of file

103
rc Executable file
View File

@ -0,0 +1,103 @@
#!/bin/bash
#
# /etc/rc: system boot script
#
echo "The system is coming up. Please wait."
# Load configuration
. /etc/rc.conf
# Start device management daemon
/sbin/devfsd /dev
# Activate swap
/sbin/swapon -a
# Mount root read-only
/bin/mount -n -o remount,ro /
# Check filesystems
/sbin/fsck -A -T -C -a
if [ $? -gt 1 ]; then
echo
echo "*************** FILESYSTEM CHECK FAILED ******************"
echo "* *"
echo "* Please repair manually and reboot. Note that the root *"
echo "* file system is currently mounted read-only. To remount *"
echo "* it read-write type: mount -n -o remount,rw / *"
echo "* When you exit the maintainance shell the system will *"
echo "* reboot automatically. *"
echo "* *"
echo "************************************************************"
echo
/sbin/sulogin -p
echo "Automatic reboot in progress..."
/bin/umount -a -r
/bin/mount -n -o remount,ro /
/sbin/reboot -f
exit 0
fi
# Mount local filesystems
/bin/mount -n -o remount,rw /
/bin/rm -f /etc/mtab*
/bin/mount -a -O no_netdev
# Clean up misc files
: > /var/run/utmp
/bin/rm -rf /forcefsck /fastboot /etc/nologin /etc/shutdownpid
(cd /var/run && /usr/bin/find . -name "*.pid" -delete)
(cd /var/lock && /usr/bin/find . ! -name . -delete)
(cd /tmp && /usr/bin/find . ! -name . -delete)
/bin/mkdir -m 1777 /tmp/.ICE-unix
# Set kernel variables
/sbin/sysctl -p > /dev/null
# Update shared library links
/sbin/ldconfig
# Configure host name
if [ "$HOSTNAME" ]; then
echo "hostname: $HOSTNAME"
/bin/hostname $HOSTNAME
fi
# Load random seed
/bin/cat /var/lib/urandom/seed > /dev/urandom
# Configure system clock
if [ "$TIMEZONE" ]; then
/bin/ln -sf /usr/share/zoneinfo/$TIMEZONE /etc/localtime
fi
/sbin/hwclock --hctosys
# Start log daemons
/usr/sbin/syslogd
/usr/sbin/klogd -c 4
# Load console font
if [ "$FONT" ]; then
echo "font: $FONT"
/usr/bin/setfont $FONT
fi
# Load console keymap
if [ "$KEYMAP" ]; then
echo "keyboard: $KEYMAP"
/bin/loadkeys -q $KEYMAP
fi
# Screen blanks after 15 minutes idle time
/usr/bin/setterm -blank 15
# Run module initialization script
if [ -x /etc/rc.modules ]; then
/etc/rc.modules
fi
# Save boot messages
/bin/dmesg > /var/log/boot
# End of file

11
rc.conf Normal file
View File

@ -0,0 +1,11 @@
#
# /etc/rc.conf: system configuration
#
FONT=default
KEYMAP=us
TIMEZONE=UTC
HOSTNAME=host
SERVICES=(net crond)
# End of file

6
rc.local Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
#
# /etc/rc.local: local multi-user startup script
#
# End of file

8
rc.modules Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
#
# /etc/rc.modules: module initialization script
#
/sbin/depmod -a
# End of file

26
rc.multi Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
#
# /etc/rc.multi: multi-user startup script
#
# Load configuration
. /etc/rc.conf
# Start services
if [ "${SERVICES[*]}" ]; then
echo -n "starting services:"
for service in ${SERVICES[@]}; do
echo -n " $service"
/etc/rc.d/$service start &> /tmp/rc.$$ || echo -n "[ERROR]"
/usr/bin/logger -t $service -f /tmp/rc.$$
/bin/rm -f /tmp/rc.$$
done
echo
fi
# Run local startup script
if [ -x /etc/rc.local ]; then
/etc/rc.local
fi
# End of file

58
rc.shutdown Executable file
View File

@ -0,0 +1,58 @@
#!/bin/bash
#
# /etc/rc.shutdown: system shutdown script
#
# Load configuration
. /etc/rc.conf
# Set linefeed mode to avoid staircase effect
/bin/stty onlcr
echo "The system is coming down. Please wait."
if [ "$PREVLEVEL" = "2" ]; then
# Shutdown services
if [ "${SERVICES[*]}" ]; then
for service in "${SERVICES[@]}"; do
R_SERVICES=($service ${R_SERVICES[@]})
done
for service in "${R_SERVICES[@]}"; do
/etc/rc.d/$service stop &> /tmp/rc.$$
/usr/bin/logger -t $service -f /tmp/rc.$$
/bin/rm -f /tmp/rc.$$
done
fi
fi
# Terminate all processes
/sbin/killall5 -15
/usr/bin/sleep 5
/sbin/killall5 -9
# Save random seed
/bin/dd if=/dev/urandom of=/var/lib/urandom/seed count=1 2> /dev/null
# Save system clock
/sbin/hwclock --systohc
# Write to wtmp file before unmounting
/sbin/halt -w
# Turn off swap
/sbin/swapoff -a
# Unmount file systems
/bin/umount -a -r
# Remount root filesystem read-only
/bin/mount -n -o remount,ro /
# Power off or reboot
if [ "$RUNLEVEL" = "0" ]; then
/sbin/poweroff -d -f -i
else
/sbin/reboot -d -f -i
fi
# End of file

42
rc.single Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
#
# /etc/rc.single: single-user startup script
#
# Load configuration
. /etc/rc.conf
if [ "$PREVLEVEL" = "2" ]; then
# Shutdown services
if [ "${SERVICES[*]}" ]; then
for service in "${SERVICES[@]}"; do
R_SERVICES=($service ${R_SERVICES[@]})
done
for service in "${R_SERVICES[@]}"; do
/etc/rc.d/$service stop &> /tmp/rc.$$
/usr/bin/logger -t $service -f /tmp/rc.$$
/bin/rm -f /tmp/rc.$$
done
fi
fi
if [ "$PREVLEVEL" != "N" ]; then
# Terminate all processes
/sbin/killall5 -15
/usr/bin/sleep 5
/sbin/killall5 -9
# Start device management daemon
/sbin/devfsd /dev
# Start log daemons
/usr/sbin/syslogd
/usr/sbin/klogd -c 4
fi
if [ "$RUNLEVEL" = "1" ]; then
# Enter single-user mode
exec /sbin/init -t1 S
fi
# End of file