summaryrefslogtreecommitdiff
path: root/source/a/sysvinit-scripts/scripts
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2016-06-30 20:26:57 +0000
committerEric Hameleers <alien@slackware.com>2018-05-31 23:31:18 +0200
commitd31c50870d0bee042ce660e445c9294a59a3a65b (patch)
tree6bfc0de3c95267b401b620c2c67859557dc60f97 /source/a/sysvinit-scripts/scripts
parent76fc4757ac91ac7947a01fb7b53dddf9a78a01d1 (diff)
downloadcurrent-d31c50870d0bee042ce660e445c9294a59a3a65b.tar.gz
Slackware 14.2slackware-14.2
Thu Jun 30 20:26:57 UTC 2016 Slackware 14.2 x86_64 stable is released! The long development cycle (the Linux community has lately been living in "interesting times", as they say) is finally behind us, and we're proud to announce the release of Slackware 14.2. The new release brings many updates and modern tools, has switched from udev to eudev (no systemd), and adds well over a hundred new packages to the system. Thanks to the team, the upstream developers, the dedicated Slackware community, and everyone else who pitched in to help make this release a reality. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. Have fun! :-)
Diffstat (limited to 'source/a/sysvinit-scripts/scripts')
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.45
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.655
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.K13
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.M77
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.S193
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.cpufreq48
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.modules28
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.modules.local17
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.sysvinit14
9 files changed, 304 insertions, 146 deletions
diff --git a/source/a/sysvinit-scripts/scripts/rc.4 b/source/a/sysvinit-scripts/scripts/rc.4
index be8a9c74..3c65040d 100644
--- a/source/a/sysvinit-scripts/scripts/rc.4
+++ b/source/a/sysvinit-scripts/scripts/rc.4
@@ -32,6 +32,11 @@ elif [ -x /usr/bin/kdm ]; then
exec /usr/bin/kdm -nodaemon
fi
+# Look for SDDM as well:
+if [ -x /usr/bin/sddm ]; then
+ exec /usr/bin/sddm
+fi
+
# If all you have is XDM, I guess it will have to do:
if [ -x /usr/bin/xdm ]; then
exec /usr/bin/xdm -nodaemon
diff --git a/source/a/sysvinit-scripts/scripts/rc.6 b/source/a/sysvinit-scripts/scripts/rc.6
index 8288128c..76895aca 100644
--- a/source/a/sysvinit-scripts/scripts/rc.6
+++ b/source/a/sysvinit-scripts/scripts/rc.6
@@ -26,10 +26,10 @@ echo "Running shutdown script $0:"
# Find out how we were called.
case "$0" in
*0)
- command="halt"
+ shutdown_command="halt"
;;
*6)
- command=reboot
+ shutdown_command=reboot
;;
*)
echo "$0: call me as \"rc.0\" or \"rc.6\" please!"
@@ -38,18 +38,32 @@ case "$0" in
esac
# Save the system time to the hardware clock using hwclock --systohc.
+# This will also create or update the timestamps in /etc/adjtime.
if [ -x /sbin/hwclock ]; then
# Check for a broken motherboard RTC clock (where ioports for rtc are
# unknown) to prevent hwclock causing a hang:
- if ! grep -q -w rtc /proc/ioports ; then
+ if ! grep -q " : rtc" /proc/ioports ; then
CLOCK_OPT="--directisa"
fi
- if grep -q "^UTC" /etc/hardwareclock 2> /dev/null ; then
+ if [ /etc/adjtime -nt /etc/hardwareclock ]; then
+ if grep -q "^LOCAL" /etc/adjtime ; then
+ echo "Saving system time to the hardware clock (localtime)."
+ else
+ echo "Saving system time to the hardware clock (UTC)."
+ fi
+ /sbin/hwclock $CLOCK_OPT --systohc
+ elif grep -q "^UTC" /etc/hardwareclock 2> /dev/null ; then
echo "Saving system time to the hardware clock (UTC)."
+ if [ ! -r /etc/adjtime ]; then
+ echo "Creating system time correction file /etc/adjtime."
+ fi
/sbin/hwclock $CLOCK_OPT --utc --systohc
else
echo "Saving system time to the hardware clock (localtime)."
- /sbin/hwclock $CLOCK_OPT --localtime --systohc
+ if [ ! -r /etc/adjtime ]; then
+ echo "Creating system time correction file /etc/adjtime."
+ fi
+ /sbin/hwclock $CLOCK_OPT --localtime --systohc
fi
fi
@@ -101,7 +115,7 @@ fi
# Kill any processes (typically gam) that would otherwise prevent
# unmounting NFS volumes:
unset FUSER_DELAY
-for dir in $(/bin/mount | grep 'type nfs' | cut -d ' ' -f 3 ) ; do
+for dir in $(/bin/mount | grep 'type nfs ' | cut -d ' ' -f 3 ) ; do
echo "Killing processes holding NFS mount $dir open..."
# Background this to prevent fuser from also blocking shutdown:
/usr/bin/fuser -k -m $dir &
@@ -113,8 +127,8 @@ if [ ! -z "$FUSER_DELAY" ]; then
fi
# Unmount any NFS, SMB, or CIFS filesystems:
-echo "Unmounting remote filesystems."
-/bin/umount -v -a -l -f -r -t nfs,smbfs,cifs
+echo "Unmounting remote filesystems:"
+/bin/umount -v -a -l -f -r -t nfs,smbfs,cifs | tr -d ' ' | grep successfully | sed "s/:successfullyunmounted/ has been successfully unmounted./g"
# Try to shut down pppd:
PS="$(ps ax)"
@@ -171,12 +185,13 @@ if [ -x /etc/rc.d/rc.udev ]; then
fi
# Kill all remaining processes.
+OMITPIDS="$(for p in $(pgrep mdmon); do echo -o $p; done)" # Don't kill mdmon
if [ ! "$1" = "fast" ]; then
echo "Sending all processes the SIGTERM signal."
- /sbin/killall5 -15
+ /sbin/killall5 -15 $OMITPIDS
/bin/sleep 5
echo "Sending all processes the SIGKILL signal."
- /sbin/killall5 -9
+ /sbin/killall5 -9 $OMITPIDS
fi
# Try to turn off quota.
@@ -198,22 +213,22 @@ fi
/bin/chmod 600 /etc/random-seed
# Before unmounting file systems write a reboot or halt record to wtmp.
-$command -w
-
-# Clear /var/lock/subsys.
-if [ -d /var/lock/subsys ]; then
- rm -f /var/lock/subsys/*
-fi
+$shutdown_command -w
# Turn off swap:
echo "Turning off swap."
/sbin/swapoff -a
/bin/sync
-echo "Unmounting local file systems."
-/bin/umount -v -a -t no,proc,sysfs
+# Stop cgmanager and cgproxy:
+if [ -x /etc/rc.d/rc.cgmanager ]; then
+ sh /etc/rc.d/rc.cgmanager stop
+fi
+
+echo "Unmounting local file systems:"
+/bin/umount -v -a -t no,proc,sysfs | tr -d ' ' | grep successfully | sed "s/:successfullyunmounted/ has been successfully unmounted./g" 2> /dev/null
-echo "Remounting root filesystem read-only."
+echo "Remounting root filesystem read-only:"
/bin/mount -v -n -o remount,ro /
# This never hurts:
@@ -275,7 +290,7 @@ if [ -x /sbin/genpowerd ]; then
fi
# Now halt (poweroff with APM or ACPI enabled kernels) or reboot.
-if [ "$command" = "reboot" ]; then
+if [ "$shutdown_command" = "reboot" ]; then
echo "Rebooting."
/sbin/reboot
else
diff --git a/source/a/sysvinit-scripts/scripts/rc.K b/source/a/sysvinit-scripts/scripts/rc.K
index 8fc63fdf..794c82ac 100644
--- a/source/a/sysvinit-scripts/scripts/rc.K
+++ b/source/a/sysvinit-scripts/scripts/rc.K
@@ -60,7 +60,7 @@ fi
# Kill any processes (typically gam) that would otherwise prevent
# unmounting NFS volumes:
unset FUSER_DELAY
-for dir in $(/bin/mount | grep 'type nfs' | cut -d ' ' -f 3 ) ; do
+for dir in $(/bin/mount | grep 'type nfs ' | cut -d ' ' -f 3 ) ; do
echo "Killing processes holding NFS mount $dir open..."
# Background this to prevent fuser from also blocking shutdown:
/usr/bin/fuser -k -m $dir &
@@ -72,8 +72,8 @@ if [ ! -z "$FUSER_DELAY" ]; then
fi
# Unmount any NFS, SMB, or CIFS filesystems:
-echo "Unmounting remote filesystems."
-/bin/umount -v -a -l -f -r -t nfs,smbfs,cifs
+echo "Unmounting remote filesystems:"
+/bin/umount -v -a -l -f -r -t nfs,smbfs,cifs | tr -d ' ' | grep successfully | sed "s/:successfullyunmounted/ has been successfully unmounted./g"
# Shut down PCMCIA devices:
if [ -x /etc/rc.d/rc.pcmcia ] ; then
@@ -88,9 +88,10 @@ if [ -x /etc/rc.d/rc.acpid -a -r /var/run/acpid.pid ]; then # quit
fi
# Kill all processes.
+OMITPIDS="$(for p in $(pgrep mdmon); do echo -o $p; done)" # Don't kill mdmon
echo
echo "Sending all processes the SIGHUP signal."
-killall5 -1
+killall5 -1 $OMITPIDS
echo -n "Waiting for processes to hang up"
for loop in 0 1 2 3 4 5 ; do
sleep 1
@@ -98,7 +99,7 @@ for loop in 0 1 2 3 4 5 ; do
done
echo
echo "Sending all processes the SIGTERM signal."
-killall5 -15
+killall5 -15 $OMITPIDS
echo -n "Waiting for processes to terminate"
for loop in 0 1 2 3 4 5 ; do
sleep 1
@@ -106,7 +107,7 @@ for loop in 0 1 2 3 4 5 ; do
done
echo
echo "Sending all processes the SIGKILL signal."
-killall5 -9
+killall5 -9 $OMITPIDS
echo -n "Waiting for processes to exit"
for loop in 0 1 2 3 4 5 ; do
sleep 1
diff --git a/source/a/sysvinit-scripts/scripts/rc.M b/source/a/sysvinit-scripts/scripts/rc.M
index d9b3fed3..1d480cac 100644
--- a/source/a/sysvinit-scripts/scripts/rc.M
+++ b/source/a/sysvinit-scripts/scripts/rc.M
@@ -99,9 +99,21 @@ if [ -x /etc/rc.d/rc.inet1 ]; then
. /etc/rc.d/rc.inet1
fi
-# Look for additional USB/SCSI/IEEE1394/etc devices on multiple LUNs:
-if [ -x /etc/rc.d/rc.scanluns ]; then
- . /etc/rc.d/rc.scanluns
+# Start D-Bus:
+if [ -x /etc/rc.d/rc.messagebus ]; then
+ sh /etc/rc.d/rc.messagebus start
+fi
+
+# Start Bluetooth:
+if [ -x /etc/rc.d/rc.bluetooth ]; then
+ sh /etc/rc.d/rc.bluetooth start
+fi
+
+# Start wicd or networkmanager:
+if [ -x /etc/rc.d/rc.wicd -a -x /usr/sbin/wicd ]; then
+ sh /etc/rc.d/rc.wicd start
+elif [ -x /etc/rc.d/rc.networkmanager ]; then
+ sh /etc/rc.d/rc.networkmanager start
fi
# Start networking daemons:
@@ -109,8 +121,13 @@ if [ -x /etc/rc.d/rc.inet2 ]; then
. /etc/rc.d/rc.inet2
fi
+# Look for additional USB/SCSI/IEEE1394/etc devices on multiple LUNs:
+if [ -x /etc/rc.d/rc.scanluns ]; then
+ . /etc/rc.d/rc.scanluns
+fi
+
# Mount any additional filesystem types that haven't already been mounted:
-mount -a -v 2> /dev/null | grep -v "already mounted"
+mount -a -v 2> /dev/null | grep -v -e "already mounted" -e "ignored" | cut -f 1 -d : | tr -d ' ' | while read dev ; do mount | grep "${dev} " ; done
# Start the Control Script for automounter:
if [ -x /etc/rc.d/rc.autofs ]; then
@@ -136,19 +153,18 @@ fi
chmod 755 / 2> /dev/null
chmod 1777 /tmp /var/tmp
-# Start APM or ACPI daemon.
-# If APM is enabled in the kernel, start apmd:
-if [ -e /proc/apm ]; then
- if [ -x /usr/sbin/apmd ]; then
- echo "Starting APM daemon: /usr/sbin/apmd"
- /usr/sbin/apmd
- fi
-elif [ -x /etc/rc.d/rc.acpid ]; then # otherwise, start acpid:
+# Start ACPI daemon.
+if [ -x /etc/rc.d/rc.acpid ]; then
. /etc/rc.d/rc.acpid start
fi
+# Enable CPU frequency scaling:
+if [ -x /etc/rc.d/rc.cpufreq ]; then
+ . /etc/rc.d/rc.cpufreq start
+fi
+
# Update any existing icon cache files:
-if find /usr/share/icons 2> /dev/null | grep -q icon-theme.cache ; then
+if find /usr/share/icons -maxdepth 2 2> /dev/null | grep -q icon-theme.cache ; then
for theme_dir in /usr/share/icons/* ; do
if [ -r ${theme_dir}/icon-theme.cache ]; then
echo "Updating icon-theme.cache in ${theme_dir}..."
@@ -169,11 +185,6 @@ if [ -x /usr/bin/update-mime-database -a -d /usr/share/mime ]; then
/usr/bin/update-mime-database /usr/share/mime 1> /dev/null 2> /dev/null &
fi
-# Start D-Bus:
-if [ -x /etc/rc.d/rc.messagebus ]; then
- sh /etc/rc.d/rc.messagebus start
-fi
-
# Start console-kit-daemon:
if [ -x /etc/rc.d/rc.consolekit ]; then
sh /etc/rc.d/rc.consolekit start
@@ -184,31 +195,33 @@ if [ -x /etc/rc.d/rc.hald ]; then
sh /etc/rc.d/rc.hald start
fi
-# Start Bluetooth:
-if [ -x /etc/rc.d/rc.bluetooth ]; then
- sh /etc/rc.d/rc.bluetooth start
-fi
-
-# Start wicd or networkmanager:
-if [ -x /etc/rc.d/rc.wicd -a -x /usr/sbin/wicd ]; then
- sh /etc/rc.d/rc.wicd start
-elif [ -x /etc/rc.d/rc.networkmanager ]; then
- sh /etc/rc.d/rc.networkmanager start
+# Start system-wide PulseAudio daemon (not recommended, nor required in
+# order to use PulseAudio -- see the script for details):
+if [ -x /etc/rc.d/rc.pulseaudio ]; then
+ . /etc/rc.d/rc.pulseaudio start
fi
# These GTK+/pango files need to be kept up to date for
# proper input method, pixbuf loaders, and font support.
if [ -x /usr/bin/update-gtk-immodules ]; then
- /usr/bin/update-gtk-immodules --verbose
+ echo "Updating gtk.immodules:"
+ echo " /usr/bin/update-gtk-immodules &"
+ /usr/bin/update-gtk-immodules > /dev/null 2>&1 &
fi
if [ -x /usr/bin/update-gdk-pixbuf-loaders ]; then
- /usr/bin/update-gdk-pixbuf-loaders --verbose
+ echo "Updating gdk-pixbuf.loaders:"
+ echo " /usr/bin/update-gdk-pixbuf-loaders &"
+ /usr/bin/update-gdk-pixbuf-loaders > /dev/null 2>&1 &
fi
if [ -x /usr/bin/update-pango-querymodules ]; then
- /usr/bin/update-pango-querymodules --verbose
+ echo "Updating pango.modules:"
+ echo " /usr/bin/update-pango-querymodules &"
+ /usr/bin/update-pango-querymodules > /dev/null 2>&1 &
fi
if [ -x /usr/bin/glib-compile-schemas ]; then
- /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas >/dev/null 2>&1
+ echo "Compiling GSettings XML schema files:"
+ echo " /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas &"
+ /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas >/dev/null 2>&1 &
fi
# Start dnsmasq, a simple DHCP/DNS server:
diff --git a/source/a/sysvinit-scripts/scripts/rc.S b/source/a/sysvinit-scripts/scripts/rc.S
index 7b152e90..20064e55 100644
--- a/source/a/sysvinit-scripts/scripts/rc.S
+++ b/source/a/sysvinit-scripts/scripts/rc.S
@@ -32,14 +32,14 @@ if [ -x /etc/rc.d/rc.loop ]; then
. /etc/rc.d/rc.loop start
fi
-# Initialize udev to manage /dev entries and hotplugging for 3.x kernels.
+# Initialize udev to manage /dev entries and hotplugging.
# You may turn off udev by making the /etc/rc.d/rc.udev file non-executable
# or giving the "nohotplug" option at boot, but realize that if you turn off
# udev that you will have to load all the kernel modules that you need
-# yourself (possibly in /etc/rc.d/rc.modules, which does not promise to list
-# all of them), and make any additional device nodes that you need in the
-# /dev directory. Even USB and IEEE1394 devices will need to have the
-# modules loaded by hand if udev is not used. So use it. :-)
+# yourself (possibly in /etc/rc.d/rc.modules.local), and make any additional
+# device nodes that you need in the /dev directory. Even USB and IEEE1394
+# devices will need to have the modules loaded by hand if udev is not used.
+# So use it. :-)
if grep -wq sysfs /proc/mounts && grep -q devtmpfs /proc/filesystems ; then
if ! grep -wq nohotplug /proc/cmdline ; then
if [ -x /etc/rc.d/rc.udev ]; then
@@ -53,11 +53,11 @@ if grep -wq cgroup /proc/filesystems ; then
if [ -d /sys/fs/cgroup ]; then
# See linux-*/Documentation/cgroups/cgroups.txt (section 1.6)
# Check if we have some tools to autodetect the available cgroup controllers
- if [ -x /usr/bin/lssubsys -a -x /usr/bin/tr -a -x /usr/bin/sed ]; then
+ if [ -x /bin/cut -a -x /bin/tail ]; then
# Mount a tmpfs as the cgroup filesystem root
mount -t tmpfs -o mode=0755 cgroup_root /sys/fs/cgroup
# Autodetect available controllers and mount them in subfolders
- controllers="$(lssubsys -a 2>/dev/null | tr '\n' ' ' | sed s/.$//)"
+ controllers="$(/bin/cut -f 1 /proc/cgroups | /bin/tail -n +2)"
for i in $controllers; do
mkdir /sys/fs/cgroup/$i
mount -t cgroup -o $i $i /sys/fs/cgroup/$i
@@ -73,6 +73,7 @@ if grep -wq cgroup /proc/filesystems ; then
fi
fi
+
# Initialize the Logical Volume Manager.
# This won't start unless we find /etc/lvmtab (LVM1) or
# /etc/lvm/backup/ (LVM2). This is created by /sbin/vgscan, so to
@@ -96,7 +97,36 @@ if [ -r /etc/lvmtab -o -d /etc/lvm/backup ]; then
fi
fi
-# Open any volumes created by cryptsetup:
+# Open any volumes created by cryptsetup.
+#
+# Some notes on /etc/crypttab in Slackware:
+# Only LUKS formatted volumes are supported (except for swap)
+# crypttab follows the following format:
+# <luks_name> <device> <password> <options>
+#
+# <luks_name>: This is the name of your LUKS volume.
+# For example: crypt-home
+#
+# <device>: This is the device containing your LUKS volume.
+# For example: /dev/sda2
+#
+# <password>: This is either the volume password in plain text, or the name of
+# a key file. Use 'none' to interactively enter password on boot.
+#
+# <options>: Comma-separated list of options. Note that there must be a
+# password field for any options to be picked up (use a password of 'none' to
+# get a password prompt at boot). The following options are supported:
+#
+# discard -- this will cause --allow-discards to be passed to the cryptsetup
+# program while opening the LUKS volume.
+#
+# ro -- this will cause --readonly to be passed to the cryptsetup program while
+# opening the LUKS volume.
+#
+# swap -- this option cannot be used with other options. The device given will
+# be formatted as a new encrypted volume with a random key on boot, and used as
+# swap.
+#
if [ -f /etc/crypttab -a -x /sbin/cryptsetup ]; then
# First, check for device-mapper support.
if ! grep -wq device-mapper /proc/devices ; then
@@ -113,25 +143,31 @@ if [ -f /etc/crypttab -a -x /sbin/cryptsetup ]; then
OPTS="${LUKSARRAY[3]}"
LUKSOPTS=""
if echo $OPTS | grep -wq ro ; then LUKSOPTS="${LUKSOPTS} --readonly" ; fi
-
+ if echo $OPTS | grep -wq discard ; then LUKSOPTS="${LUKSOPTS} --allow-discards" ; fi
# Skip LUKS volumes that were already unlocked (in the initrd):
/sbin/cryptsetup status $LUKS 2>/dev/null | head -n 1 | grep -q "is active" && continue
if /sbin/cryptsetup isLuks $DEV 2>/dev/null ; then
- echo "Unlocking LUKS crypt volume '${LUKS}' on device '$DEV':"
- if [ -n "${PASS}" ]; then
- if [ -f ${PASS} ]; then
+ if [ -z "${LUKSOPTS}" ]; then
+ echo "Unlocking LUKS encrypted volume '${LUKS}' on device '$DEV':"
+ else
+ echo "Unlocking LUKS encrypted volume '${LUKS}' on device '$DEV' with options '${LUKSOPTS}':"
+ fi
+ if [ -n "${PASS}" -a "${PASS}" != "none" ]; then
+ if [ -f "${PASS}" ]; then
+ # A password was given a key-file filename
/sbin/cryptsetup ${LUKSOPTS} --key-file=${PASS} luksOpen $DEV $LUKS
- elif [ "${PASS}" != "none" ]; then
- # A password field of 'none' indicates a line for swap:
+ else
+ # A password was provided in plain text
echo "${PASS}" | /sbin/cryptsetup ${LUKSOPTS} luksOpen $DEV $LUKS
fi
else
+ # No password was given, or a password of 'none' was given
/sbin/cryptsetup ${LUKSOPTS} luksOpen $DEV $LUKS </dev/tty0 >/dev/tty0 2>&1
fi
elif echo $OPTS | grep -wq swap ; then
# If any of the volumes is to be used as encrypted swap,
# then encrypt it using a random key and run mkswap:
- echo "Creating encrypted swap on device '$DEV' mapped to '${LUKS}':"
+ echo "Creating encrypted swap volume '${LUKS}' on device '$DEV':"
/sbin/cryptsetup --cipher=aes --key-file=/dev/urandom --key-size=256 create $LUKS $DEV
mkswap /dev/mapper/$LUKS
fi
@@ -146,19 +182,41 @@ if [ -x /etc/rc.d/rc.fuse ]; then
sh /etc/rc.d/rc.fuse start
fi
+# Set the tick and frequency for the system clock.
+# Default values are: TICK=10000 and FREQ=0
+TICK=10000
+FREQ=0
+# If there's a /etc/default/adjtimex config file, source it to override
+# the default TICK and FREQ:
+if [ -r /etc/default/adjtimex ]; then
+ . /etc/default/adjtimex
+fi
+if /sbin/adjtimex --tick $TICK --frequency $FREQ; then
+ echo "Setting the system clock rate: /sbin/adjtimex --tick $TICK --frequency $FREQ"
+else
+ echo "Failed to set system clock with adjtimex, possibly invalid parameters? (TICK=$TICK FREQ=$FREQ)"
+fi
+
# Set the system time from the hardware clock using hwclock --hctosys.
if [ -x /sbin/hwclock ]; then
# Check for a broken motherboard RTC clock (where ioports for rtc are
# unknown) to prevent hwclock causing a hang:
- if ! grep -q -w rtc /proc/ioports ; then
+ if ! grep -q " : rtc" /proc/ioports ; then
CLOCK_OPT="--directisa"
fi
- if grep -wq "^UTC" /etc/hardwareclock ; then
- echo -n "Setting system time from the hardware clock (UTC): "
- /sbin/hwclock $CLOCK_OPT --utc --hctosys
- else
- echo -n "Setting system time from the hardware clock (localtime): "
+ if [ /etc/adjtime -nt /etc/hardwareclock ]; then
+ if grep -q "^LOCAL" /etc/adjtime ; then
+ echo -n "Setting system time from the hardware clock (localtime): "
+ else
+ echo -n "Setting system time from the hardware clock (UTC): "
+ fi
+ /sbin/hwclock $CLOCK_OPT --hctosys
+ elif grep -wq "^localtime" /etc/hardwareclock 2> /dev/null ; then
+ echo -n "Setting system time from the hardware clock (localtime): "
/sbin/hwclock $CLOCK_OPT --localtime --hctosys
+ else
+ echo -n "Setting system time from the hardware clock (UTC): "
+ /sbin/hwclock $CLOCK_OPT --utc --hctosys
fi
date
fi
@@ -224,51 +282,20 @@ if [ ! $READWRITE = yes ]; then
echo "Remounting root device with read-write enabled."
/sbin/mount -w -v -n -o remount /
if [ $? -gt 0 ] ; then
- echo
- echo "Attempt to remount root device as read-write failed! This is going to"
+ echo "FATAL: Attempt to remount root device as read-write failed! This is going to"
echo "cause serious problems."
- echo
- echo "If you're using the UMSDOS filesystem, you **MUST** mount the root partition"
- echo "read-write! You can make sure the root filesystem is getting mounted "
- echo "read-write with the 'rw' flag to Loadlin:"
- echo
- echo "loadlin vmlinuz root=/dev/hda1 rw (replace /dev/hda1 with your root device)"
- echo
- echo "Normal bootdisks can be made to mount a system read-write with the rdev command:"
- echo
- echo "rdev -R /dev/fd0 0"
- echo
- echo "You can also get into your system by using a boot disk with a command like this"
- echo "on the LILO prompt line: (change the root partition name as needed)"
- echo
- echo "LILO: mount root=/dev/hda1 rw"
- echo
- echo "Please press ENTER to continue, then reboot and use one of the above methods to"
- echo -n "get into your machine and start looking for the problem. "
- read junk;
fi
else
echo "Testing root filesystem status: read-write filesystem"
echo
- echo "*** ERROR: Root partition has already been mounted read-write. Cannot check!"
+ echo "ERROR: Root partition has already been mounted read-write. Cannot check!"
echo
echo "For filesystem checking to work properly, your system must initially mount"
- echo "the root partition as read only. Please modify your kernel with 'rdev' so that"
- echo "it does this. If you're booting with LILO, add a line:"
+ echo "the root partition as read only. If you're booting with LILO, add a line:"
echo
echo " read-only"
echo
echo "to the Linux section in your /etc/lilo.conf and type 'lilo' to reinstall it."
- echo
- echo "If you boot from a kernel on a floppy disk, put it in the drive and type:"
- echo " rdev -R /dev/fd0 1"
- echo
- echo "If you boot from a bootdisk, or with Loadlin, you can add the 'ro' flag."
- echo
- echo "This will fix the problem *AND* eliminate this annoying message. :^)"
- echo
- echo -n "Press ENTER to continue. "
- read junk;
fi # Done checking root filesystem
@@ -278,12 +305,15 @@ fi # Done checking root filesystem
# Add entry for / to /etc/mtab:
/sbin/mount -f -w /
-# Add /proc and /sys mounts to /etc/mtab:
+# Add /proc, /sys, and /dev/shm mounts to /etc/mtab:
if [ -d /proc/sys ]; then
- /sbin/mount -f proc /proc -t proc
+ /sbin/mount -f -t proc proc /proc
fi
if [ -d /sys/bus ]; then
- /sbin/mount -f sysfs /sys -t sysfs
+ /sbin/mount -f -t sysfs sysfs /sys
+fi
+if grep -q '^[^ ]\+ /dev/shm ' /proc/mounts 2> /dev/null ; then
+ /sbin/mount -f -t tmpfs tmpfs /dev/shm
fi
# Configure ISA Plug-and-Play devices:
@@ -293,30 +323,20 @@ if [ -r /etc/isapnp.conf ]; then
fi
fi
-# This loads any kernel modules that are needed. These might be required to
-# use your ethernet card, sound card, or other optional hardware.
-# Priority is given first to a script named "rc.modules.local", then
-# to "rc.modules-$FULL_KERNEL_VERSION", and finally to the plain "rc.modules".
-# Note that if /etc/rc.d/rc.modules.local is found, then that will be the ONLY
-# rc.modules script the machine will run, so make sure it has everything in
-# it that you need.
-if [ -x /etc/rc.d/rc.modules.local -a -r /proc/modules ]; then
- echo "Running /etc/rc.d/rc.modules.local:"
- /bin/sh /etc/rc.d/rc.modules.local
-elif [ -x /etc/rc.d/rc.modules-$(uname -r) -a -r /proc/modules ]; then
- echo "Running /etc/rc.d/rc.modules-$(uname -r):"
- . /etc/rc.d/rc.modules-$(uname -r)
-elif [ -x /etc/rc.d/rc.modules -a -r /proc/modules -a -L /etc/rc.d/rc.modules ]; then
- echo "Running /etc/rc.d/rc.modules -> $(readlink /etc/rc.d/rc.modules):"
- . /etc/rc.d/rc.modules
-elif [ -x /etc/rc.d/rc.modules -a -r /proc/modules ]; then
- echo "Running /etc/rc.d/rc.modules:"
+# Run the kernel module script. This updates the module dependencies and
+# also supports manually loading kernel modules through rc.modules.local.
+if [ -x /etc/rc.d/rc.modules ]; then
. /etc/rc.d/rc.modules
fi
-# Configure runtime kernel parameters:
+# Configure kernel parameters:
if [ -x /sbin/sysctl -a -r /etc/sysctl.conf ]; then
- /sbin/sysctl -e -p /etc/sysctl.conf
+ echo "Configuring kernel parameters: /sbin/sysctl -e --system"
+ /sbin/sysctl -e --system
+elif [ -x /sbin/sysctl ]; then
+ echo "Configuring kernel parameters: /sbin/sysctl -e --system"
+ # Don't say "Applying /etc/sysctl.conf" or complain if the file doesn't exist
+ /sbin/sysctl -e --system 2> /dev/null | grep -v "Applying /etc/sysctl.conf"
fi
# Check all the non-root filesystems:
@@ -344,9 +364,12 @@ fi
echo "Mounting non-root local filesystems:"
sleep 3
if /bin/grep -wq devpts /proc/mounts ; then
- /sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs,nodevpts
+ # This pipe after the mount command is just to convert the new
+ # mount verbose output back to the old format that contained
+ # more useful information:
+ /sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs,nodevpts | grep successfully | cut -f 1 -d : | tr -d ' ' | while read dev ; do mount | grep "${dev} " ; done
else
- /sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs
+ /sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs | grep successfully | cut -f 1 -d : | tr -d ' ' | while read dev ; do mount | grep "${dev} " ; done
fi
# Enable swapping again. This is needed in case a swapfile is used,
@@ -354,6 +377,11 @@ fi
# mounted read-write.
/sbin/swapon -a 2> /dev/null
+# Start cgmanager (or cgproxy in a container):
+if [ -x /etc/rc.d/rc.cgmanager -a -d /sys/fs/cgroup ]; then
+ sh /etc/rc.d/rc.cgmanager start
+fi
+
# Clean up some temporary files:
rm -f /var/run/* /var/run/*/* /var/run/*/*/* /etc/nologin \
/etc/dhcpc/*.pid /etc/forcefsck /etc/fastboot \
@@ -362,6 +390,11 @@ rm -f /var/run/* /var/run/*/* /var/run/*/*/* /etc/nologin \
( cd /var/log/setup/tmp && rm -rf * )
( cd /tmp && rm -rf kde-[a-zA-Z]* ksocket-[a-zA-Z]* hsperfdata_[a-zA-Z]* plugtmp* )
+# Clear /var/lock/subsys:
+if [ -d /var/lock/subsys ]; then
+ rm -f /var/lock/subsys/*
+fi
+
# Create /tmp/{.ICE-unix,.X11-unix} if they are not present:
if [ ! -e /tmp/.ICE-unix ]; then
mkdir -p /tmp/.ICE-unix
diff --git a/source/a/sysvinit-scripts/scripts/rc.cpufreq b/source/a/sysvinit-scripts/scripts/rc.cpufreq
new file mode 100644
index 00000000..571ce41c
--- /dev/null
+++ b/source/a/sysvinit-scripts/scripts/rc.cpufreq
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# rc.cpufreq: Settings for CPU frequency and voltage scaling in the kernel.
+# For more information, see the kernel documentation in
+# /usr/src/linux/Documentation/cpu-freq/
+
+
+# Default CPU scaling governor to try. Some possible choices are:
+# performance: The CPUfreq governor "performance" sets the CPU statically
+# to the highest frequency within the borders of scaling_min_freq
+# and scaling_max_freq.
+# powersave: The CPUfreq governor "powersave" sets the CPU statically to the
+# lowest frequency within the borders of scaling_min_freq and
+# scaling_max_freq.
+# userspace: The CPUfreq governor "userspace" allows the user, or any
+# userspace program running with UID "root", to set the CPU to a
+# specific frequency by making a sysfs file "scaling_setspeed"
+# available in the CPU-device directory.
+# ondemand: The CPUfreq governor "ondemand" sets the CPU depending on the
+# current usage.
+# conservative: The CPUfreq governor "conservative", much like the "ondemand"
+# governor, sets the CPU depending on the current usage. It
+# differs in behaviour in that it gracefully increases and
+# decreases the CPU speed rather than jumping to max speed the
+# moment there is any load on the CPU.
+SCALING_GOVERNOR=ondemand
+
+# If rc.cpufreq is given an option, use it for the CPU scaling governor instead:
+if [ ! -z "$1" -a "$1" != "start" ]; then
+ SCALING_GOVERNOR=$1
+fi
+
+# If you need to load a specific CPUFreq driver, load it here. Most likely you don't.
+#/sbin/modprobe acpi-cpufreq
+
+# Attempt to apply the CPU scaling governor setting. This may or may not
+# actually override the default value depending on if the choice is supported
+# by the architecture, processor, or underlying CPUFreq driver. For example,
+# processors that use the Intel P-state driver will only be able to set
+# performance or powersave here.
+echo $SCALING_GOVERNOR | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 1> /dev/null 2> /dev/null
+
+# Report what CPU scaling governor is in use after applying the setting:
+if [ -r /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ]; then
+ echo "Enabled CPU frequency scaling governor: $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)"
+fi
+
+unset SCALING_GOVERNOR
diff --git a/source/a/sysvinit-scripts/scripts/rc.modules b/source/a/sysvinit-scripts/scripts/rc.modules
new file mode 100644
index 00000000..650c0ef8
--- /dev/null
+++ b/source/a/sysvinit-scripts/scripts/rc.modules
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# /etc/rc.d/rc.modules
+
+# Determine the version of the running kernel:
+RELEASE=$(uname -r)
+
+# Update kernel module dependencies:
+if [ -e "/lib/modules/$RELEASE/modules.dep" ]; then
+ echo "Updating module dependency list for $RELEASE: /sbin/depmod --quick"
+ /sbin/depmod --quick
+else
+ echo "Creating module dependency list for $RELEASE: /sbin/depmod --all"
+ /sbin/depmod --all
+fi
+
+# Run any rc.modules-$(uname -r) file that exists (this is used
+# if you have specific modules which should only be loaded for
+# specific kernel versions):
+if [ -x "/etc/rc.d/rc.modules-$RELEASE" ]; then
+ /etc/rc.d/rc.modules-$RELEASE
+fi
+
+# Run a local (sysadmin-version) of rc.modules if it exists:
+if [ -x "/etc/rc.d/rc.modules.local" ]; then
+ /etc/rc.d/rc.modules.local
+fi
+
diff --git a/source/a/sysvinit-scripts/scripts/rc.modules.local b/source/a/sysvinit-scripts/scripts/rc.modules.local
new file mode 100644
index 00000000..6bd1f339
--- /dev/null
+++ b/source/a/sysvinit-scripts/scripts/rc.modules.local
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# /etc/rc.d/rc.modules.local
+
+# The Linux kernel source is the best place to look for documentation
+# for the many available kernel modules. This can be found under
+# /usr/src/linux-$VERSION/Documentation/.
+
+# Almost all necessary modules are automatically loaded when needed,
+# but there are a few exceptions. Here's a (not all-inclusive) list,
+# so uncomment any of the below entries or add others as needed:
+# Note that you could also create/edit rc.modules-$version if you
+# only wanted specific modules loaded for particular kernels.
+
+#/sbin/modprobe tun # Universal TUN/TAP device driver
+#/sbin/modprobe sg # Generic SCSI support for SATA DVD-RW
+
diff --git a/source/a/sysvinit-scripts/scripts/rc.sysvinit b/source/a/sysvinit-scripts/scripts/rc.sysvinit
index 916e59ee..057c3f1e 100644
--- a/source/a/sysvinit-scripts/scripts/rc.sysvinit
+++ b/source/a/sysvinit-scripts/scripts/rc.sysvinit
@@ -40,14 +40,12 @@ if [ "$runlevel" = "" ]; then
export prevlevel
fi
-# Run kill scripts in the previous runlevel if not "none"
-if [ ! "$prevlevel" = "N" ]; then
- for script in /etc/rc.d/rc$prevlevel.d/K* ; do
- if [ -x $script ]; then
- startup $script stop
- fi
- done
-fi
+# Run kill scripts:
+for script in /etc/rc.d/rc$runlevel.d/K* ; do
+ if [ -x $script ]; then
+ startup $script stop
+ fi
+done
# Now do the startup scripts:
for script in /etc/rc.d/rc$runlevel.d/S* ; do