@ -0,0 +1,48 @@ |
|||||
|
#!/bin/sh |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# Please add additional copyright information _after_ the line containing |
||||
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
# |
||||
|
# ROCK Linux: rock-src/package/base/sysfiles/system.init |
||||
|
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf |
||||
|
# |
||||
|
# This program is free software; you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU General Public License as published by |
||||
|
# the Free Software Foundation; either version 2 of the License, or |
||||
|
# (at your option) any later version. A copy of the GNU General Public |
||||
|
# License can be found at Documentation/COPYING. |
||||
|
# |
||||
|
# Many people helped and are helping developing ROCK Linux. Please |
||||
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
# file for details. |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
# |
||||
|
# Desc: Custom keyboard settings |
||||
|
# Runlevel: 07 rcX rc1 rc2 rc3 rc4 rc5 |
||||
|
# |
||||
|
|
||||
|
[ "$1" = stop ] && exit 0 |
||||
|
|
||||
|
main_begin |
||||
|
|
||||
|
block_begin(start, `Setting keyboard repeat rate and delay time.') |
||||
|
[ -f /etc/conf/kbd ] && . /etc/conf/kbd |
||||
|
check(`D_prefix/bin/kbdrate ${kbd_rate:+-r $kbd_rate} \ |
||||
|
{kbd_delay:+-d $kbd_delay} < /dev/console') |
||||
|
block_split(`Setting keyboard keymappings.') |
||||
|
if [ -L /etc/default.keymap ] ; then |
||||
|
mapfile=$(ls -l /etc/default.keymap | sed 's,.* -> ,,') |
||||
|
check(`loadkeys $mapfile') |
||||
|
elif [ -f /etc/default.keymap ] ; then |
||||
|
check(`loadkeys /etc/default.keymap') |
||||
|
else |
||||
|
echo "No /etc/default.keymap found." |
||||
|
fi |
||||
|
block_end |
||||
|
|
||||
|
main_end |
@ -0,0 +1,46 @@ |
|||||
|
#!/bin/sh |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# Please add additional copyright information _after_ the line containing |
||||
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
# |
||||
|
# ROCK Linux: rock-src/package/base/sysfiles/system.init |
||||
|
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf |
||||
|
# |
||||
|
# This program is free software; you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU General Public License as published by |
||||
|
# the Free Software Foundation; either version 2 of the License, or |
||||
|
# (at your option) any later version. A copy of the GNU General Public |
||||
|
# License can be found at Documentation/COPYING. |
||||
|
# |
||||
|
# Many people helped and are helping developing ROCK Linux. Please |
||||
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
# file for details. |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
# |
||||
|
# Desc: Console settings |
||||
|
# Runlevel: 07 rcX rc1 rc2 rc3 rc4 rc5 |
||||
|
# |
||||
|
|
||||
|
[ "$1" = stop ] && exit 0 |
||||
|
|
||||
|
main_begin |
||||
|
|
||||
|
block_begin(start, `Setting console screen font.') |
||||
|
if [ -f /etc/default.vcfont ] ; then |
||||
|
check(`setfont "$(readlink /etc/default.vcfont)"') |
||||
|
else |
||||
|
echo "No /etc/default.vcfont found." |
||||
|
fi |
||||
|
dnl |
||||
|
block_split(`Setting console terminal type and blank interval.') |
||||
|
con_term=linux; con_blank=0 |
||||
|
[ -f /etc/conf/console ] && . /etc/conf/console |
||||
|
check(`D_prefix/bin/setterm -term $con_term -blank $con_blank > /dev/console') |
||||
|
block_end |
||||
|
|
||||
|
main_end |
@ -0,0 +1,48 @@ |
|||||
|
#!/bin/sh |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# Please add additional copyright information _after_ the line containing |
||||
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
# |
||||
|
# ROCK Linux: rock-src/package/base/devfsd/devfsd.init |
||||
|
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf |
||||
|
# |
||||
|
# This program is free software; you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU General Public License as published by |
||||
|
# the Free Software Foundation; either version 2 of the License, or |
||||
|
# (at your option) any later version. A copy of the GNU General Public |
||||
|
# License can be found at Documentation/COPYING. |
||||
|
# |
||||
|
# Many people helped and are helping developing ROCK Linux. Please |
||||
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
# file for details. |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
# |
||||
|
# Desc: devfs /dev setup |
||||
|
# Runlevel: 02 rcX rc1 rc2 rc3 rc4 rc5 |
||||
|
# |
||||
|
|
||||
|
[[ "$(uname -r)" != 2.4.* ]] && exit 0 |
||||
|
|
||||
|
main_begin |
||||
|
|
||||
|
block_begin(start, `Setting up a devfs based /dev directory.') |
||||
|
if [ ! -e /dev/.devfsd ] ; then |
||||
|
mount -n -t devfs devfs /dev || exit $? |
||||
|
exec > /dev/console 2>&1 < /dev/console |
||||
|
echo "Mounted /dev (devfs) from devfs init script." |
||||
|
fi |
||||
|
block_end |
||||
|
|
||||
|
block_begin(stop, `Unmounting /dev (devfs).') |
||||
|
if [ -e /dev/.devfsd ] ; then |
||||
|
umount -l -n /dev |
||||
|
exec > /dev/console 2>&1 < /dev/console |
||||
|
fi |
||||
|
block_end |
||||
|
|
||||
|
main_end |
@ -0,0 +1,35 @@ |
|||||
|
#!/bin/sh |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# Please add additional copyright information _after_ the line containing |
||||
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
# |
||||
|
# ROCK Linux: rock-src/package/base/sysfiles/system.init |
||||
|
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf |
||||
|
# |
||||
|
# This program is free software; you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU General Public License as published by |
||||
|
# the Free Software Foundation; either version 2 of the License, or |
||||
|
# (at your option) any later version. A copy of the GNU General Public |
||||
|
# License can be found at Documentation/COPYING. |
||||
|
# |
||||
|
# Many people helped and are helping developing ROCK Linux. Please |
||||
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
# file for details. |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
# |
||||
|
# One time system initialization, |
||||
|
# executed before boot and bootwait /etc/inittab entries. |
||||
|
# |
||||
|
# Only the root filesystem may be mounted, and it may be read-only. |
||||
|
|
||||
|
# Environment variables passed by init. |
||||
|
echo CONSOLE=$CONSOLE |
||||
|
echo INIT_VERSION=$INIT_VERSION |
||||
|
echo PATH=$PATH |
||||
|
echo RUNLEVEL=$RUNLEVEL |
||||
|
echo PREVLEVEL=$PREVLEVEL |
@ -0,0 +1,90 @@ |
|||||
|
#!/bin/sh |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# Please add additional copyright information _after_ the line containing |
||||
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
# |
||||
|
# ROCK Linux: rock-src/package/base/sysfiles/system.init |
||||
|
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf |
||||
|
# |
||||
|
# This program is free software; you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU General Public License as published by |
||||
|
# the Free Software Foundation; either version 2 of the License, or |
||||
|
# (at your option) any later version. A copy of the GNU General Public |
||||
|
# License can be found at Documentation/COPYING. |
||||
|
# |
||||
|
# Many people helped and are helping developing ROCK Linux. Please |
||||
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
# file for details. |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
# |
||||
|
# Desc: Mounting local filesystems |
||||
|
# Runlevel: 05 rcX rc1 rc2 rc3 rc4 rc5 |
||||
|
# |
||||
|
|
||||
|
main_begin |
||||
|
block_begin(start, `Checking file systems.') |
||||
|
fsck -A -C -a ; fsckrc=$? |
||||
|
if [ $(( $fsckrc & ~3 )) != 0 ] ; then |
||||
|
echo " **" |
||||
|
echo " ** Filesystem check failed (returncode=$fsckrc)." |
||||
|
echo " ** Please repair the broken disk(s) manually." |
||||
|
echo " **" |
||||
|
sulogin -t 600 /dev/console |
||||
|
umount -adrv ; /sbin/reboot -d -f |
||||
|
while true ; do sleep 1 ; done |
||||
|
elif [ $(( $fsckrc & 2 )) != 0 ] ; then |
||||
|
for x in 10 9 8 7 6 5 4 3 2 ; do |
||||
|
echo -en "\rSystem reboot in $x seconds ... " |
||||
|
sleep 1 |
||||
|
done ; echo -e "\rSystem reboot now! " |
||||
|
umount -adrv ; /sbin/reboot -d -f |
||||
|
while true ; do sleep 1 ; done |
||||
|
fi |
||||
|
dnl |
||||
|
if [ -s /etc/lvmtab ]; then |
||||
|
block_split(`Activating volume groups.') |
||||
|
check(`/sbin/vgchange -ay') |
||||
|
fi |
||||
|
dnl |
||||
|
block_split(`Mounting local file systems.') |
||||
|
check(`mount -n -o remount,rw /') |
||||
|
rootdev="/dev/$(ls -l /dev/root 2> /dev/null | sed 's,.* -> ,,')" |
||||
|
if [ "$rootdev" = "/dev/" ]; then |
||||
|
rootdev="$( sed 's, ,\n,g' < /proc/cmdline | \ |
||||
|
grep ^root= | cut -f2- -d= )" |
||||
|
[ -z "$rootdev" ] && rootdev="/dev/root" |
||||
|
fi |
||||
|
check(`grep -v "^rootfs " /proc/mounts | \ |
||||
|
sed "s,^/dev/root ,$rootdev ," > /etc/mtab') |
||||
|
check(`mount -a -t nocoda,nfs,devfs,proc,sysfs') |
||||
|
block_end |
||||
|
|
||||
|
block_begin(stop, `Remounting sync/ro and unmounting filesystems.') |
||||
|
cut -d' ' -f-3 /etc/mtab /proc/mounts | sort -k2 -u -r | \ |
||||
|
while read dev dir fs ; do |
||||
|
[ "$dir" = "/" ] && continue |
||||
|
[ "$dir" = "/dev" ] && continue |
||||
|
[ "$dir" = "/dev/shm" ] && continue |
||||
|
[ "$dir" = "/proc" ] && continue |
||||
|
[ "$dir" = "/sys" ] && continue |
||||
|
[ "$dir" = "/tmp" ] && continue |
||||
|
echo "Unmounting $dev on $dir ($fs)." |
||||
|
mount -o remount,sync $dir |
||||
|
mount -o remount,ro $dir |
||||
|
umount -d $dir |
||||
|
done |
||||
|
dnl |
||||
|
block_split(`Unmounting remaining file systems.') |
||||
|
grep -E -v '^none (/|[a-z]+:) ' /proc/mounts > /etc/mtab |
||||
|
sync ; sleep 1 ; sync |
||||
|
umount -vdnra -t nodevfs,proc,sysfs,shm |
||||
|
mount -vn -o remount,sync / |
||||
|
mount -vn -o remount,ro / |
||||
|
sleep 1 ; sync ; sleep 1 |
||||
|
block_end |
||||
|
main_end |
@ -0,0 +1,38 @@ |
|||||
|
#!/bin/sh |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# Please add additional copyright information _after_ the line containing |
||||
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
# |
||||
|
# ROCK Linux: rock-src/package/base/sysfiles/system.init |
||||
|
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf |
||||
|
# |
||||
|
# This program is free software; you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU General Public License as published by |
||||
|
# the Free Software Foundation; either version 2 of the License, or |
||||
|
# (at your option) any later version. A copy of the GNU General Public |
||||
|
# License can be found at Documentation/COPYING. |
||||
|
# |
||||
|
# Many people helped and are helping developing ROCK Linux. Please |
||||
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
# file for details. |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
# |
||||
|
# Desc: Swap activation/deactivation |
||||
|
# Runlevel: 04 rcX rc1 rc2 rc3 rc4 rc5 |
||||
|
# |
||||
|
|
||||
|
main_begin |
||||
|
block_begin(start, `Activating swap devices.') |
||||
|
check(`swapon -a') |
||||
|
block_end |
||||
|
|
||||
|
block_begin(stop, `Turning off swap devices.') |
||||
|
check(`swapoff -a') |
||||
|
sync ; sleep 1 |
||||
|
block_end |
||||
|
main_end |
@ -0,0 +1,60 @@ |
|||||
|
#!/bin/sh |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# Please add additional copyright information _after_ the line containing |
||||
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
# |
||||
|
# ROCK Linux: rock-src/package/base/sysfiles/system.init |
||||
|
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf |
||||
|
# |
||||
|
# This program is free software; you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU General Public License as published by |
||||
|
# the Free Software Foundation; either version 2 of the License, or |
||||
|
# (at your option) any later version. A copy of the GNU General Public |
||||
|
# License can be found at Documentation/COPYING. |
||||
|
# |
||||
|
# Many people helped and are helping developing ROCK Linux. Please |
||||
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
# file for details. |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
# |
||||
|
# Desc: System state save and restore |
||||
|
# Runlevel: 07 rcX rc1 rc2 rc3 rc4 rc5 |
||||
|
# |
||||
|
|
||||
|
main_begin |
||||
|
block_begin(start, `Refresh utmp, delete lock and tmp files and other stuff.') |
||||
|
find /var/lock /var/run /tmp -mindepth 1 -print0 2> /dev/null | xargs --null rm -rf |
||||
|
rm -f /etc/nologin /nologin /fastboot ; echo -n >> /var/run/utmp |
||||
|
chmod 664 /var/run/utmp ; chown root:tty /var/run/utmp |
||||
|
mkdir /tmp/.ICE-unix /var/lock/subsys |
||||
|
chmod 1777 /tmp/.ICE-unix |
||||
|
dnl |
||||
|
block_split(`Writing /var/log/boot.msg.') |
||||
|
check(`dmesg > /var/log/boot.msg') |
||||
|
dnl |
||||
|
block_split(`Initializing kernel random number generator.') |
||||
|
if [ -e /var/state/random-seed ] ; then |
||||
|
check(`cat /var/state/random-seed >/dev/urandom') |
||||
|
fi |
||||
|
block_end |
||||
|
|
||||
|
block_begin(stop, `Saving /var/log/init.msg and /var/log/boot.msg.') |
||||
|
check(`echo -n >> /var/log/init.msg') |
||||
|
check(`echo -n >> /var/log/boot.msg') |
||||
|
check(`mv /var/log/init.msg /var/log/init.old') |
||||
|
check(`mv /var/log/boot.msg /var/log/boot.old') |
||||
|
block_split(`Writing a wtmp record.') |
||||
|
if [ "$RUNLEVEL" = 0 ] ; then |
||||
|
check(`halt -w') |
||||
|
else |
||||
|
check(`reboot -w') |
||||
|
fi |
||||
|
block_split(`Saving kernel random seed.') |
||||
|
check(`dd if=/dev/urandom of=/var/state/random-seed count=1 2>/dev/null') |
||||
|
block_end |
||||
|
main_end |
@ -0,0 +1,61 @@ |
|||||
|
#!/bin/sh |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# Please add additional copyright information _after_ the line containing |
||||
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
# |
||||
|
# ROCK Linux: rock-src/package/base/sysfiles/system.init |
||||
|
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf |
||||
|
# |
||||
|
# This program is free software; you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU General Public License as published by |
||||
|
# the Free Software Foundation; either version 2 of the License, or |
||||
|
# (at your option) any later version. A copy of the GNU General Public |
||||
|
# License can be found at Documentation/COPYING. |
||||
|
# |
||||
|
# Many people helped and are helping developing ROCK Linux. Please |
||||
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
# file for details. |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
# |
||||
|
# Desc: udev /dev setup |
||||
|
# Runlevel: 02 rcX rc1 rc2 rc3 rc4 rc5 |
||||
|
# |
||||
|
|
||||
|
[[ "$(uname -r)" != 2.6.* ]] && exit 0 |
||||
|
|
||||
|
main_begin |
||||
|
|
||||
|
block_begin(start, `Setting up a udev based /dev directory.') |
||||
|
if [ ! -e /dev/.udev ] ; then |
||||
|
mount -n -t ramfs ramfs /dev || exit $? |
||||
|
|
||||
|
cp -r /lib/udev/devices/* /dev |
||||
|
|
||||
|
echo "" > /proc/sys/kernel/hotplug |
||||
|
check(`/sbin/udevd --daemon') |
||||
|
|
||||
|
# create nodes for devices already in kernel |
||||
|
/sbin/udevtrigger |
||||
|
/sbin/udevsettle |
||||
|
|
||||
|
exec > /dev/console 2>&1 < /dev/console |
||||
|
echo "Mounted /dev (udev) from udev init script." |
||||
|
fi |
||||
|
block_end |
||||
|
|
||||
|
block_begin(stop, `Stopping udevd.') |
||||
|
check(`killall -15 /sbin/udevd') |
||||
|
dnl |
||||
|
block_split(`Unmounting /dev (udev).') |
||||
|
if [ -e /dev/.udev ] ; then |
||||
|
umount -l -n /dev |
||||
|
exec > /dev/console 2>&1 < /dev/console |
||||
|
fi |
||||
|
block_end |
||||
|
|
||||
|
main_end |