initscripts: Drop outdated machine specific files

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2011-04-20 14:21:05 +01:00
parent cd5e586066
commit 211ae3b4df
6 changed files with 0 additions and 557 deletions

View File

@ -1,211 +0,0 @@
#
# checkroot.sh Check to root filesystem.
#
# Version: @(#)checkroot.sh 2.84 25-Jan-2002 miquels@cistron.nl
#
. /etc/default/rcS
#
# Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to be spawned
# from this script *before anything else* with a timeout, like SCO does.
#
test "$SULOGIN" = yes && sulogin -t 30 $CONSOLE
#
# Ensure that bdflush (update) is running before any major I/O is
# performed (the following fsck is a good example of such activity :).
#
test -x /sbin/update && update
#
# Read /etc/fstab.
#
exec 9>&0 </etc/fstab
rootmode=rw
rootopts=rw
test "$ENABLE_ROOTFS_FSCK" = yes && rootcheck="yes" || rootcheck="no"
swap_on_md=no
devfs=
while read fs mnt type opts dump pass junk
do
case "$fs" in
""|\#*)
continue;
;;
/dev/md*)
# Swap on md device.
test "$type" = swap && swap_on_md=yes
;;
/dev/*)
;;
*)
# Might be a swapfile.
test "$type" = swap && swap_on_md=yes
;;
esac
test "$type" = devfs && devfs="$fs"
# Currently we do not care about the other entries
if test "$mnt" = "/"
then
#echo "[$fs] [$mnt] [$type] [$opts] [$dump] [$pass] [$junk]"
rootopts="$opts"
roottype="$type"
#The "spinner" is broken on busybox sh
TERM=dumb
test "$pass" = 0 -o "$pass" = "" && rootcheck=no
# Enable fsck for ext2 and ext3 rootfs, disable for everything else
case "$type" in
ext3) rootcheck=yes;;
*) rootcheck=no;;
esac
if test "$rootcheck" = yes
then
if ! test -x "/sbin/fsck.${roottype}"
then
echo -e "\n * * * WARNING: /sbin/fsck.${roottype} is missing! * * *\n"
rootcheck=no
fi
fi
case "$opts" in
ro|ro,*|*,ro|*,ro,*)
rootmode=ro
;;
esac
fi
done
exec 0>&9 9>&-
#
# Activate the swap device(s) in /etc/fstab. This needs to be done
# before fsck, since fsck can be quite memory-hungry.
#
doswap=no
test -d /proc/1 || mount -n /proc
case "`uname -r`" in
2.[0123].*)
if test $swap_on_md = yes && grep -qs resync /proc/mdstat
then
test "$VERBOSE" != no && echo "Not activating swap - RAID array resyncing"
else
doswap=yes
fi
;;
*)
doswap=yes
;;
esac
if test $doswap = yes
then
test "$VERBOSE" != no && echo "Activating swap"
swapon -a 2> /dev/null
fi
#
# Check the root filesystem.
#
if test -f /fastboot || test $rootcheck = no
then
test $rootcheck = yes && echo "Fast boot, no filesystem check"
else
#
# Ensure that root is quiescent and read-only before fsck'ing.
#
mount -n -o remount,ro /
if test $? = 0
then
if test -f /forcefsck
then
force="-f"
else
force=""
fi
if test "$FSCKFIX" = yes
then
fix="-y"
else
fix="-a"
fi
spinner="-C"
case "$TERM" in
dumb|network|unknown|"") spinner="" ;;
esac
test `uname -m` = s390 && spinner="" # This should go away
test "$VERBOSE" != no && echo "Checking root filesystem..."
fsck $spinner $force $fix /
#
# 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 test "$?" -gt 1
then
# Since this script is run very early in the boot-process, it should be safe to assume that the
# output is printed to VT1. However, some distributions use a bootsplash to hide the "ugly" boot
# messages and having the bootsplash "hang" due to a waiting fsck prompt is less than ideal
chvt 1
# Surprise! Re-directing from a HERE document (as in
# "cat << EOF") won't work, because the root is read-only.
echo
echo "fsck failed. Please repair manually and reboot. Please note"
echo "that the root filesystem is currently mounted read-only. To"
echo "remount it read-write:"
echo
echo " # mount -n -o remount,rw /"
echo
echo "CONTROL-D will exit from this shell and REBOOT the system."
echo
# Start a single user shell on the console
/sbin/sulogin $CONSOLE
reboot -f
fi
else
echo "*** ERROR! Cannot fsck root fs because it is not mounted read-only!"
echo
fi
fi
#
# If the root filesystem was not marked as read-only in /etc/fstab,
# remount the rootfs rw 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.
# This part is only needed if the rootfs was mounted ro.
#
if [ $(grep rootfs /proc/mounts | awk '{print $4}') = rw ]; then
exit 0
fi
# Add a second check, which seems to be needed for some kernel versions
if [ $(grep "/dev/root" /proc/mounts | awk '{print $4}') = rw ]; then
exit 0
fi
echo "Remounting root file system..."
mount -n -o remount,$rootmode /
if test "$rootmode" = rw
then
if test ! -L /etc/mtab
then
rm -f /etc/mtab~ /etc/nologin
: > /etc/mtab
fi
mount -f -o remount /
mount -f /proc
test "$devfs" && grep -q '^devfs /dev' /proc/mounts && mount -f "$devfs"
fi
: exit 0

View File

@ -1,211 +0,0 @@
#
# checkroot.sh Check to root filesystem.
#
# Version: @(#)checkroot.sh 2.84 25-Jan-2002 miquels@cistron.nl
#
. /etc/default/rcS
#
# Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to be spawned
# from this script *before anything else* with a timeout, like SCO does.
#
test "$SULOGIN" = yes && sulogin -t 30 $CONSOLE
#
# Ensure that bdflush (update) is running before any major I/O is
# performed (the following fsck is a good example of such activity :).
#
test -x /sbin/update && update
#
# Read /etc/fstab.
#
exec 9>&0 </etc/fstab
rootmode=rw
rootopts=rw
test "$ENABLE_ROOTFS_FSCK" = yes && rootcheck="yes" || rootcheck="no"
swap_on_md=no
devfs=
while read fs mnt type opts dump pass junk
do
case "$fs" in
""|\#*)
continue;
;;
/dev/md*)
# Swap on md device.
test "$type" = swap && swap_on_md=yes
;;
/dev/*)
;;
*)
# Might be a swapfile.
test "$type" = swap && swap_on_md=yes
;;
esac
test "$type" = devfs && devfs="$fs"
# Currently we do not care about the other entries
if test "$mnt" = "/"
then
#echo "[$fs] [$mnt] [$type] [$opts] [$dump] [$pass] [$junk]"
rootopts="$opts"
roottype="$type"
#The "spinner" is broken on busybox sh
TERM=dumb
test "$pass" = 0 -o "$pass" = "" && rootcheck=no
# Enable fsck for ext2 and ext3 rootfs, disable for everything else
case "$type" in
ext3) rootcheck=yes;;
*) rootcheck=no;;
esac
if test "$rootcheck" = yes
then
if ! test -x "/sbin/fsck.${roottype}"
then
echo -e "\n * * * WARNING: /sbin/fsck.${roottype} is missing! * * *\n"
rootcheck=no
fi
fi
case "$opts" in
ro|ro,*|*,ro|*,ro,*)
rootmode=ro
;;
esac
fi
done
exec 0>&9 9>&-
#
# Activate the swap device(s) in /etc/fstab. This needs to be done
# before fsck, since fsck can be quite memory-hungry.
#
doswap=no
test -d /proc/1 || mount -n /proc
case "`uname -r`" in
2.[0123].*)
if test $swap_on_md = yes && grep -qs resync /proc/mdstat
then
test "$VERBOSE" != no && echo "Not activating swap - RAID array resyncing"
else
doswap=yes
fi
;;
*)
doswap=yes
;;
esac
if test $doswap = yes
then
test "$VERBOSE" != no && echo "Activating swap"
swapon -a 2> /dev/null
fi
#
# Check the root filesystem.
#
if test -f /fastboot || test $rootcheck = no
then
test $rootcheck = yes && echo "Fast boot, no filesystem check"
else
#
# Ensure that root is quiescent and read-only before fsck'ing.
#
mount -n -o remount,ro /
if test $? = 0
then
if test -f /forcefsck
then
force="-f"
else
force=""
fi
if test "$FSCKFIX" = yes
then
fix="-y"
else
fix="-a"
fi
spinner="-C"
case "$TERM" in
dumb|network|unknown|"") spinner="" ;;
esac
test `uname -m` = s390 && spinner="" # This should go away
test "$VERBOSE" != no && echo "Checking root filesystem..."
fsck $spinner $force $fix /
#
# 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 test "$?" -gt 1
then
# Since this script is run very early in the boot-process, it should be safe to assume that the
# output is printed to VT1. However, some distributions use a bootsplash to hide the "ugly" boot
# messages and having the bootsplash "hang" due to a waiting fsck prompt is less than ideal
chvt 1
# Surprise! Re-directing from a HERE document (as in
# "cat << EOF") won't work, because the root is read-only.
echo
echo "fsck failed. Please repair manually and reboot. Please note"
echo "that the root filesystem is currently mounted read-only. To"
echo "remount it read-write:"
echo
echo " # mount -n -o remount,rw /"
echo
echo "CONTROL-D will exit from this shell and REBOOT the system."
echo
# Start a single user shell on the console
/sbin/sulogin $CONSOLE
reboot -f
fi
else
echo "*** ERROR! Cannot fsck root fs because it is not mounted read-only!"
echo
fi
fi
#
# If the root filesystem was not marked as read-only in /etc/fstab,
# remount the rootfs rw 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.
# This part is only needed if the rootfs was mounted ro.
#
if [ $(grep rootfs /proc/mounts | awk '{print $4}') = rw ]; then
exit 0
fi
# Add a second check, which seems to be needed for some kernel versions
if [ $(grep "/dev/root" /proc/mounts | awk '{print $4}') = rw ]; then
exit 0
fi
echo "Remounting root file system..."
mount -n -o remount,$rootmode /
if test "$rootmode" = rw
then
if test ! -L /etc/mtab
then
rm -f /etc/mtab~ /etc/nologin
: > /etc/mtab
fi
mount -f -o remount /
mount -f /proc
test "$devfs" && grep -q '^devfs /dev' /proc/mounts && mount -f "$devfs"
fi
: exit 0

View File

@ -1,48 +0,0 @@
# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $
# The default runlevel.
id:5:initdefault:
# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS
# What to do in single-user mode.
~~:S:wait:/sbin/sulogin
# Shut down if kernel sends us SIGINT or SIGPWR
ca::ctrlaltdel:/sbin/halt -p
pf::powerfailnow:/sbin/halt -p
# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin
# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
# <id>:<runlevels>:<action>:<process>
# NOTE: FIC GTA01 has this odd multiplexer on ttySAC0 since
# GSM shares it with the serial output. We only allow
# the getty in runlevel 2 to cope with that. gsmd gets
# started in runlevel 3. -- mickey@openmoko.org
S:2:respawn:/sbin/getty 115200 ttySAC0

View File

@ -1,7 +0,0 @@
#!/bin/sh
if (grep -q 'tmpfs.*/var.*tmpfs' /proc/mounts)
then
test "$VERBOSE" != no && echo "Copying /var filesystem..."
cp -a /boot/var /
fi

View File

@ -1,63 +0,0 @@
#!/bin/sh
# Original author: ???
#
# Additions by Steph Meslin-Weber:
# x Percentage display
# x Dot display of dependency installations
# - removed both of above
# - display is now X of Y packages and current package name being installed
#. /etc/default/rcS
reconfigure () {
pkg=$1
path=$2
isdependent=$3
test -e "$path/info/$pkg.control" || return 1
depends="`cat $path/info/$pkg.control|grep Depends|cut -d: -f2`"
# make sure we haven't already installed this package
isthere=`cat /tmp/.configured.list|grep $pkg`
if test "$isthere" != ""; then
return 1
fi
if test "$depends" != ""; then
for dep in $depends; do
(echo $log|grep $dep >/dev/null 2>&1) || ( reconfigure $dep $path "$max" "$pkg" && log="$log $dep"; )
done
fi
echo -ne " ${pkg}"
test -e "$path/info/$pkg.prerm" && $path/info/$pkg.prerm unconfigure >/dev/null 2>&1
test -e "$path/info/$pkg.postinst" && $path/info/$pkg.postinst configure >/dev/null 2>&1
log="$log $pkg"
# append the installed package name to the list
echo -ne "$pkg\n" >> /tmp/.configured.list
echo
return 0
}
if test ! -e /etc/.configured; then
echo "Reconfiguring all packages installed to root:"
# create unique packages list file
rm -f /tmp/.configured.list
touch /tmp/.configured.list
log=""
for control in /usr/lib/ipkg/info/*.control; do
package=`echo $control|sed -e 's,.*/,,g; s,\.control,,g;'`
(echo $log|grep $package >/dev/null 2>&1) || reconfigure $package /usr/lib/ipkg
done
# cleanup unique packages list file
rm -f /tmp/.configured.list
fi
test -f /usr/lib/ipkg/info/task-ramses || ipkg install task-ramses

View File

@ -1,17 +0,0 @@
#! /bin/sh
#
# umountfs Turn off swap and unmount all local filesystems.
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
echo "Deactivating swap..."
swapoff -a
# We leave /proc mounted.
echo "Unmounting local filesystems..."
umount -f -a -r
mount -o remount,ro /
: exit 0