Removed pogo-connector, /core/initscripts updated to 2010.1

This commit is contained in:
Mike Staszel 2010-04-04 20:16:29 -05:00
parent 78ab8a0570
commit d1ea302071
15 changed files with 224 additions and 207 deletions

14
README
View file

@ -5,15 +5,5 @@ Marvell Sheevaplug platform (ARM-based).
The packages are meant to be built on PlugBox Linux, found at The packages are meant to be built on PlugBox Linux, found at
http://plugapps.com/ http://plugapps.com/
============================================================= Also included is the Pogoplug/Dockstar "Advanced" u-Boot
bootloader with USB drive support.
This repository also hosts tools necessary to run the
my.pogoplug.com (XCE) and other files. This is not piracy
for 2 reasons:
1. XCE and TUN are GPL-licensed.
2. You cannot run the XCE module on regular u-Boot on other devices,
and need a unique, verified ID and serial number written in the
bootloader. Also, MAC addresses are checked by my.pogoplug.com to
match the Cloud Engines family of plugs.

73
core/initscripts/PKGBUILD Normal file → Executable file
View file

@ -1,50 +1,51 @@
# Maintainer: Mike Staszel <mikestaszel@plugapps.com> # Maintainer: Mike Staszel <mikestaszel@plugboxlinux.org>
pkgname=initscripts pkgname=initscripts
pkgver=2009.12 pkgver=2010.01
pkgrel=1 pkgrel=1
pkgdesc="System initialization/bootup scripts" pkgdesc="System initialization/bootup scripts"
arch=('arm') arch=(arm)
url="http://www.archlinux.org" url="http://www.plugboxlinux.org"
license=('GPL') license=('GPL')
groups=('base' 'small-base') groups=('base')
backup=(etc/inittab etc/rc.conf etc/rc.local etc/rc.local.shutdown) backup=(etc/inittab etc/rc.conf etc/rc.local etc/rc.local.shutdown)
depends=('glibc' 'bash' 'grep' 'coreutils' 'udev>=139-1' 'sysvinit' 'net-tools') depends=('glibc' 'bash' 'awk' 'grep' 'coreutils' 'sed' 'udev>=139-1'
'net-tools' 'ncurses' 'kbd' 'findutils' 'sysvinit')
optdepends=('bridge-utils: Network bridging support' optdepends=('bridge-utils: Network bridging support'
'dhcpcd: DHCP network configuration' 'dhcpcd: DHCP network configuration'
'wireless_tools: Wireless networking') 'wireless_tools: Wireless networking')
source=('adjtime.cron' install=initscripts.install
'inittab' source=(adjtime.cron
'minilogd.c' functions
'network' inittab
'rc.local' install.sh
'rc.multi' minilogd.c
'rc.single' netfs
'functions' network
'install.sh' rc.conf
'netfs' rc.local
'rc.conf' rc.local.shutdown
'rc.local.shutdown' rc.multi
'rc.shutdown' rc.shutdown
'rc.sysinit') rc.single
rc.sysinit)
md5sums=('c03a4a5be5e2579b59e0dcd6a21d310b' md5sums=('c03a4a5be5e2579b59e0dcd6a21d310b'
'b5872d7ed0f129ebd883b9d26033d4fe' 'd68d3c1a9abe773439fa5fa0000ab6c9'
'ae343387b55279b8aa872c54b2ac0e50' '5bd94c5ea67521b6b3e94b45ddec808a'
'e3637ea43f2dbabba7b1b44f94b0277d' '3fb0b6e945065ba1d283f136d17d612e'
'bd236a57bc00aa4727b98c5ae401c457' 'ae343387b55279b8aa872c54b2ac0e50'
'b53d6b27bd460edf577f83bb2c968b93' '96fdb70f95844d95a9941ee319601e8d'
'827c100136a6a1441c83d9877e36747b' 'fe1a494a0b6f269ce1bcafae85a60a7b'
'6f17f71f8e7f1e06a571669a58534b13' 'dccf83de27c0884b021219e19291731c'
'3fb0b6e945065ba1d283f136d17d612e' 'bd236a57bc00aa4727b98c5ae401c457'
'96fdb70f95844d95a9941ee319601e8d' '669ce6d766dd9deb86686219f3763fe4'
'bc6439c7165f2cee3b57a9a2dffc40b9' '8c94c7faaa17f0f4971cff19da047e44'
'669ce6d766dd9deb86686219f3763fe4' 'e3eb057da4d46477d1e03925c1c12c03'
'd907663acca54bb7d01ca1d8cf21d191' '2c4ef098e6ee45cb86272cb3cb28bb47'
'bd2e5ac2054854a8bd88df01d1be39af') '7fb7e4402911a31555041228d03772e0')
build() { build() {
cd ${startdir}/src/ cd ${srcdir}/
chmod u+x install.sh DESTDIR=${pkgdir} ./install.sh
DESTDIR=$startdir/pkg ./install.sh
} }

0
core/initscripts/adjtime.cron Normal file → Executable file
View file

View file

@ -2,43 +2,27 @@
# initscripts functions # initscripts functions
# #
# width:
STAT_COL=80 STAT_COL=80
if [ -t 1 ]; then if [ ! -t 1 ]; then
# stty will fail when stdin isn't a terminal (but we're in this block, so stdout is)
if [ -t 0 ]; then
STAT_COL="$(/bin/stty size)"
# stty gives "rows cols"; strip the rows number, we just want columns
STAT_COL="${STAT_COL##* }"
else
# tput will fail at boot time if /usr/share/terminfo isn't yet mounted
# or TERM is otherwise unrecognized
STAT_COL="$(/bin/tput cols 2>/dev/null)"
fi
if [ "0$STAT_COL" -eq 0 ]; then
# if output was 0 (serial console), set default width to 80
USECOLOR=""
STAT_COL=80
fi
else
USECOLOR="" USECOLOR=""
elif [ -t 0 ]; then
STAT_COL="$(/bin/stty size)"
STAT_COL="${STAT_COL##* }"
else
/bin/tput cols &>/dev/null
if [ $? -eq 0 ]; then
STAT_COL=$(/bin/tput cols)
fi
fi
if [ "0$STAT_COL" -eq 0 ]; then
STAT_COL=80 STAT_COL=80
USECOLOR=""
fi fi
if [ -t 1 ]; then
STAT_COL=$(/bin/stty size)
# strip the rows number, we just want columns
STAT_COL=${STAT_COL##* }
if [ "$STAT_COL" = "0" ]; then
# if output was 0 (serial console), set default width to 80
STAT_COL=80
fi
fi
# we use 13 characters for our own stuff
STAT_COL=$(($STAT_COL - 13)) STAT_COL=$(($STAT_COL - 13))
# disable colors on broken terminals
TERM_COLORS="$(/bin/tput colors 2>/dev/null)" TERM_COLORS="$(/bin/tput colors 2>/dev/null)"
if [ $? = 3 ]; then if [ $? = 3 ]; then
TERM_COLORS=8 TERM_COLORS=8
@ -56,10 +40,8 @@ else
fi fi
unset TERM_COLORS unset TERM_COLORS
# clear the TZ envvar, so daemons always respect /etc/localtime
unset TZ unset TZ
# colors:
if [ "$USECOLOR" = "YES" -o "$USECOLOR" = "yes" ]; then if [ "$USECOLOR" = "YES" -o "$USECOLOR" = "yes" ]; then
C_MAIN="\033[1;37;40m" # main text C_MAIN="\033[1;37;40m" # main text
C_OTHER="\033[1;34;40m" # prefix & brackets C_OTHER="\033[1;34;40m" # prefix & brackets
@ -86,13 +68,9 @@ else
DEL_TEXT="" DEL_TEXT=""
fi fi
# prefixes:
PREFIX_REG="::" PREFIX_REG="::"
PREFIX_HL=" >" PREFIX_HL=" >"
# functions:
deltext() { deltext() {
printf "${DEL_TEXT}" printf "${DEL_TEXT}"
} }
@ -154,10 +132,6 @@ status() {
fi fi
} }
# usage : in_array( $needle, $haystack )
# return : 0 - found
# 1 - not found
# Copied from makepkg
in_array() { in_array() {
local needle=$1; shift local needle=$1; shift
[ -z "$1" ] && return 1 # Not Found [ -z "$1" ] && return 1 # Not Found
@ -172,8 +146,6 @@ in_array() {
return 1 # Not Found return 1 # Not Found
} }
# daemons:
add_daemon() { add_daemon() {
[ -d /var/run/daemons ] || /bin/mkdir -p /var/run/daemons [ -d /var/run/daemons ] || /bin/mkdir -p /var/run/daemons
/bin/touch /var/run/daemons/$1 /bin/touch /var/run/daemons/$1
@ -209,7 +181,6 @@ stop_daemon() {
/etc/rc.d/$1 stop /etc/rc.d/$1 stop
} }
# Status functions
status_started() { status_started() {
deltext deltext
echo -ne "$C_OTHER[${C_STRT}STARTED$C_OTHER]$C_CLEAR " echo -ne "$C_OTHER[${C_STRT}STARTED$C_OTHER]$C_CLEAR "
@ -229,8 +200,22 @@ ck_status() {
fi fi
} }
declare -A hook_funcs
add_hook() {
[ -z "$1" -o -z "$2" ] && return 1
hook_funcs["$1"]="${hook_funcs["$1"]} $2"
}
run_hook() {
local func
[ -z "$1" ] && return 1
for func in ${hook_funcs["$1"]}; do
${func}
done
}
#Source additional functions at the end to allow overrides
for f in /etc/rc.d/functions.d/*; do for f in /etc/rc.d/functions.d/*; do
if [ -e $f ]; then if [ -e $f ]; then
. $f . $f
@ -238,4 +223,3 @@ for f in /etc/rc.d/functions.d/*; do
done done
# End of file # End of file

0
core/initscripts/initscripts.install Normal file → Executable file
View file

View file

@ -24,13 +24,16 @@ rh:06:wait:/etc/rc.shutdown
su:S:wait:/sbin/sulogin -p su:S:wait:/sbin/sulogin -p
# -8 options fixes umlauts problem on login # -8 options fixes umlauts problem on login
s0:12345:respawn:/sbin/agetty -8 115200 ttyS0 vt100 s0:12345:respawn:/sbin/agetty -8 115200 ttyS0 linux
#c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux # c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux
#c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux # c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux
#c3:2345:respawn:/sbin/agetty -8 38400 tty3 linux # c3:2345:respawn:/sbin/agetty -8 38400 tty3 linux
#c4:2345:respawn:/sbin/agetty -8 38400 tty4 linux # c4:2345:respawn:/sbin/agetty -8 38400 tty4 linux
#c5:2345:respawn:/sbin/agetty -8 38400 tty5 linux # c5:2345:respawn:/sbin/agetty -8 38400 tty5 linux
#c6:2345:respawn:/sbin/agetty -8 38400 tty6 linux c6:2345:respawn:/sbin/agetty -8 38400 tty6 linux
# Hypervisor Virtual Console for Xen and KVM
#h0:2345:respawn:/sbin/agetty -8 38400 hvc0 linux
ca::ctrlaltdel:/sbin/shutdown -t3 -r now ca::ctrlaltdel:/sbin/shutdown -t3 -r now

0
core/initscripts/netfs Normal file → Executable file
View file

13
core/initscripts/network Normal file → Executable file
View file

@ -19,11 +19,20 @@ ifup()
return 1 return 1
fi fi
/sbin/ifconfig $1 up eval ifcfg="\$${1}"
# Get the name of the interface from the first token in the string
if [ "$ifcfg" = "dhcp" ]; then
ifname="$1"
else
ifname=${ifcfg%% *}
fi
/sbin/ifconfig $ifname up
wi_up $1 || return 1 wi_up $1 || return 1
eval ifcfg="\$${1}"
if [ "$ifcfg" = "dhcp" ]; then if [ "$ifcfg" = "dhcp" ]; then
# remove the .pid file if it exists # remove the .pid file if it exists
/bin/rm -f /var/run/dhcpcd-${1}.pid >/dev/null 2>&1 /bin/rm -f /var/run/dhcpcd-${1}.pid >/dev/null 2>&1

View file

@ -33,7 +33,7 @@ USELVM="no"
# #
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts # HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
# #
HOSTNAME="plugbox" HOSTNAME="Plugbox"
# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces. # Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
# #
@ -46,6 +46,8 @@ HOSTNAME="plugbox"
# Wireless: See network profiles below # Wireless: See network profiles below
# #
#Static IP example
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
eth0="dhcp" eth0="dhcp"
INTERFACES=(eth0) INTERFACES=(eth0)
@ -54,7 +56,7 @@ INTERFACES=(eth0)
# - prefix an entry in ROUTES with a ! to disable it # - prefix an entry in ROUTES with a ! to disable it
# #
gateway="default gw 192.168.0.1" gateway="default gw 192.168.0.1"
ROUTES=(gateway) ROUTES=(!gateway)
# Enable these network profiles at boot-up. These are only useful # Enable these network profiles at boot-up. These are only useful
# if you happen to need multiple network configurations (ie, laptop users) # if you happen to need multiple network configurations (ie, laptop users)
@ -75,4 +77,4 @@ ROUTES=(gateway)
# - prefix a daemon with a ! to disable it # - prefix a daemon with a ! to disable it
# - prefix a daemon with a @ to start it up in the background # - prefix a daemon with a @ to start it up in the background
# #
DAEMONS=(network sshd) DAEMONS=(syslog-ng network netfs crond sshd)

0
core/initscripts/rc.local Normal file → Executable file
View file

0
core/initscripts/rc.local.shutdown Normal file → Executable file
View file

4
core/initscripts/rc.multi Normal file → Executable file
View file

@ -6,6 +6,8 @@
. /etc/rc.conf . /etc/rc.conf
. /etc/rc.d/functions . /etc/rc.d/functions
run_hook multi_start
# Load sysctl variables if sysctl.conf is present # Load sysctl variables if sysctl.conf is present
[ -r /etc/sysctl.conf ] && /sbin/sysctl -q -p &>/dev/null [ -r /etc/sysctl.conf ] && /sbin/sysctl -q -p &>/dev/null
@ -24,4 +26,6 @@ if [ -x /etc/rc.local ]; then
/etc/rc.local /etc/rc.local
fi fi
run_hook multi_end
# End of file # End of file

53
core/initscripts/rc.shutdown Normal file → Executable file
View file

@ -6,6 +6,8 @@
. /etc/rc.conf . /etc/rc.conf
. /etc/rc.d/functions . /etc/rc.d/functions
run_hook shutdown_start
# avoid staircase effect # avoid staircase effect
/bin/stty onlcr /bin/stty onlcr
@ -22,36 +24,37 @@ if [ -x /etc/rc.local.shutdown ]; then
/etc/rc.local.shutdown /etc/rc.local.shutdown
fi fi
if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then # Find daemons NOT in the DAEMONS array. Shut these down first
# Find daemons NOT in the DAEMONS array. Shut these down first if [ -d /var/run/daemons ]; then
if [ -d /var/run/daemons ]; then for daemon in $(/bin/ls -1t /var/run/daemons); do
for daemon in $(/bin/ls -1t /var/run/daemons); do if ! in_array $daemon ${DAEMONS[@]}; then
if ! in_array $daemon ${DAEMONS[@]}; then stop_daemon $daemon
stop_daemon $daemon
fi
done
fi
# Shutdown daemons in reverse order
let i=${#DAEMONS[@]}-1
while [ $i -ge 0 ]; do
if [ "${DAEMONS[$i]:0:1}" != '!' ]; then
ck_daemon ${DAEMONS[$i]#@} || stop_daemon ${DAEMONS[$i]#@}
fi fi
let i=i-1
done done
fi fi
# Shutdown daemons in reverse order
let i=${#DAEMONS[@]}-1
while [ $i -ge 0 ]; do
if [ "${DAEMONS[$i]:0:1}" != '!' ]; then
ck_daemon ${DAEMONS[$i]#@} || stop_daemon ${DAEMONS[$i]#@}
fi
let i=i-1
done
# Terminate all processes # Terminate all processes
stat_busy "Terminating Processes" stat_busy "Sending SIGTERM To Processes"
run_hook shutdown_prekillall
/sbin/killall5 -15 &> /dev/null /sbin/killall5 -15 &> /dev/null
/bin/sleep 5 /bin/sleep 5
stat_done stat_done
stat_busy "Killing Processes" stat_busy "Sending SIGKILL To Processes"
/sbin/killall5 -9 &> /dev/null /sbin/killall5 -9 &> /dev/null
/bin/sleep 1 /bin/sleep 1
stat_done stat_done
run_hook shutdown_postkillall
stat_busy "Saving Random Seed" stat_busy "Saving Random Seed"
RANDOM_SEED=/var/lib/misc/random-seed RANDOM_SEED=/var/lib/misc/random-seed
[ -d $(dirname $RANDOM_SEED) ] || mkdir -p $(dirname $RANDOM_SEED) [ -d $(dirname $RANDOM_SEED) ] || mkdir -p $(dirname $RANDOM_SEED)
@ -105,12 +108,14 @@ if [ -f /etc/crypttab -a -n "$(/bin/grep -v ^# /etc/crypttab | /bin/grep -v ^$)"
CS=/sbin/cryptsetup.static CS=/sbin/cryptsetup.static
do_uncrypt() { do_uncrypt() {
if [ $# -ge 3 ]; then if [ $# -ge 3 ]; then
stat_append "${1}.." if [ -b /dev/mapper/$1 ] ;then
$CS remove $1 >/dev/null 2>&1 stat_append "${1}.."
if [ $? -ne 0 ]; then $CS remove $1 >/dev/null 2>&1
stat_append "failed " if [ $? -ne 0 ]; then
else stat_append "failed "
stat_append "ok " else
stat_append "ok "
fi
fi fi
fi fi
} }
@ -132,6 +137,8 @@ stat_busy "Remounting Root Filesystem Read-only"
/bin/mount -n -o remount,ro / /bin/mount -n -o remount,ro /
stat_done stat_done
run_hook shutdown_poweroff
# Power off or reboot # Power off or reboot
if [ "$RUNLEVEL" = "0" ]; then if [ "$RUNLEVEL" = "0" ]; then
printsep printsep

44
core/initscripts/rc.single Normal file → Executable file
View file

@ -6,6 +6,8 @@
. /etc/rc.conf . /etc/rc.conf
. /etc/rc.d/functions . /etc/rc.d/functions
run_hook single_start
if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then
# Find daemons NOT in the DAEMONS array. Shut these down first # Find daemons NOT in the DAEMONS array. Shut these down first
if [ -d /var/run/daemons ]; then if [ -d /var/run/daemons ]; then
@ -26,29 +28,45 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then
fi fi
if [ "$PREVLEVEL" != "N" ]; then if [ "$PREVLEVEL" != "N" ]; then
run_hook single_prekillall
# Terminate all processes
stat_busy "Sending SIGTERM To Processes" stat_busy "Sending SIGTERM To Processes"
/sbin/killall5 -15 &> /dev/null /sbin/killall5 -15 &> /dev/null
/bin/sleep 5 /bin/sleep 5
stat_done stat_done
stat_busy "Sending SIGKILL To Processes" stat_busy "Sending SIGKILL To Processes"
/sbin/killall5 -9 /sbin/killall5 -9 &> /dev/null
/bin/sleep 1 /bin/sleep 1
stat_done stat_done
if [ -x /sbin/udevadm ]; then run_hook single_postkillall
stat_busy "Starting UDev Daemon"
/sbin/udevd --daemon stat_busy "Starting UDev Daemon"
stat_done /sbin/udevd --daemon
stat_busy "Loading UDev uevents" stat_done
/sbin/udevadm trigger
/sbin/udevadm settle run_hook single_udevlaunched
stat_done
else # Trigger udev uevents
# Static /dev, our last resort if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then
status "Using static /dev filesystem" /bin/true stat_busy "Triggering UDev uevents"
/sbin/udevadm control --property=STARTUP=1
/sbin/udevadm trigger
stat_done
fi fi
# Wait for udev uevents
if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then
stat_busy "Waiting for UDev uevents to be processed"
/sbin/udevadm settle
/sbin/udevadm control --property=STARTUP=
stat_done
fi
run_hook single_udevsettled
# try syslog-NG first, then fall back to good ol' syslogd # try syslog-NG first, then fall back to good ol' syslogd
if [ -x /etc/rc.d/syslog-ng ]; then if [ -x /etc/rc.d/syslog-ng ]; then
/etc/rc.d/syslog-ng start /etc/rc.d/syslog-ng start
@ -58,6 +76,8 @@ if [ "$PREVLEVEL" != "N" ]; then
fi fi
fi fi
run_hook single_end
if [ "$RUNLEVEL" = "1" ]; then if [ "$RUNLEVEL" = "1" ]; then
printsep printsep
printhl "Entering single-user mode..." printhl "Entering single-user mode..."

131
core/initscripts/rc.sysinit Normal file → Executable file
View file

@ -12,8 +12,10 @@ printhl "${C_H2}http://www.plugapps.com"
printhl "Copyright 2009-2010 Mike Staszel" printhl "Copyright 2009-2010 Mike Staszel"
printsep printsep
run_hook sysinit_start
# mount /proc, /sys and our RAM /dev # mount /proc, /sys and our RAM /dev
/bin/mount -n -t tmpfs none /dev -o mode=0755 /bin/mount -n -t tmpfs udev /dev -o mode=0755,size=10M,nosuid
/bin/mount -n -t proc none /proc /bin/mount -n -t proc none /proc
/bin/mount -n -t sysfs none /sys /bin/mount -n -t sysfs none /sys
@ -31,15 +33,6 @@ else
/bin/dmesg -n 3 /bin/dmesg -n 3
fi fi
# enable rtc access
/sbin/modprobe rtc-cmos >/dev/null 2>&1
RTC_MAJOR=$(/bin/grep -w rtc /proc/devices 2>/dev/null)
RTC_MAJOR="${RTC_MAJOR%% *}"
if [ -n "$RTC_MAJOR" ]; then
/bin/mknod /dev/rtc0 c $RTC_MAJOR 0
/bin/ln -s /dev/rtc0 /dev/rtc
fi
HWCLOCK_PARAMS="--hctosys" HWCLOCK_PARAMS="--hctosys"
if [ "$HARDWARECLOCK" = "UTC" ]; then if [ "$HARDWARECLOCK" = "UTC" ]; then
HWCLOCK_PARAMS="$HWCLOCK_PARAMS --utc" HWCLOCK_PARAMS="$HWCLOCK_PARAMS --utc"
@ -49,26 +42,41 @@ else
HWCLOCK_PARAMS="" HWCLOCK_PARAMS=""
fi fi
# Set clock early to fix some bugs with filesystem checks if [ -n "$HWCLOCK_PARAMS" ]; then
# Clock is set again later to match rc.conf # enable rtc access
if [ -n "$HWCLOCK_PARAMS" -a -f /etc/localtime ]; then /sbin/modprobe rtc-cmos >/dev/null 2>&1
/sbin/hwclock $HWCLOCK_PARAMS --noadjfile RTC_MAJOR=$(/bin/grep -w rtc /proc/devices 2>/dev/null)
RTC_MAJOR="${RTC_MAJOR%% *}"
if [ -n "$RTC_MAJOR" ]; then
/bin/mknod /dev/rtc0 c $RTC_MAJOR 0
/bin/ln -s /dev/rtc0 /dev/rtc
fi
# Do a clock set here for a few reasons:
# 1. Make creation time on udev nodes sane (FS#8665)
# 2. Filesystem checks can depend on system time
# 3. This will set the clock, if using non-UTC, off the last known
# configured timezone. Any new timezone put in rc.conf is copied over at
# a later time.
# This does *NOT* take into account a time adjustment file as /var may not be
# mounted yet. A second set occurs later to match rc.conf.
if [ -f /etc/localtime ]; then
/sbin/hwclock $HWCLOCK_PARAMS --noadjfile
fi
fi fi
echo > /proc/sys/kernel/hotplug echo > /proc/sys/kernel/hotplug
if [ -x /sbin/udevadm ]; then stat_busy "Starting UDev Daemon"
stat_busy "Starting UDev" /sbin/udevd --daemon
/sbin/udevd --daemon stat_done
stat_done
else run_hook sysinit_udevlaunched
# Static /dev, our last resort
status "Using static /dev filesystem" true
fi
# Trigger udev uevents # Trigger udev uevents
if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then
stat_busy "Triggering UDev uevents" stat_busy "Triggering UDev uevents"
/sbin/udevadm control --property=STARTUP=1
/sbin/udevadm trigger /sbin/udevadm trigger
stat_done stat_done
fi fi
@ -84,36 +92,18 @@ if ! [ "$load_modules" = "off" ]; then
done done
stat_done stat_done
fi fi
if [ -d /proc/acpi ]; then
stat_busy "Loading standard ACPI modules"
ACPI_MODULES="ac battery button fan processor thermal"
k="$(echo $BLACKLIST ${MOD_BLACKLIST[@]} | /bin/sed 's|-|_|g')"
j="$(echo ${MODULES[@]} | /bin/sed 's|-|_|g')"
#add disabled MODULES (!) to blacklist - much requested feature
for m in ${j}; do
[ "$m" != "${m#!}" ] && k="${k} ${m#!}"
done
# add disablemodules= from commandline to blacklist
k="${k} $(echo ${disablemodules} | /bin/sed 's|-|_|g' | /bin/sed 's|,| |g')"
for n in ${ACPI_MODULES}; do
if ! echo ${k} | /bin/grep "\<$n\>" 2>&1 >/dev/null; then
/sbin/modprobe $n > /dev/null 2>&1
fi
done
stat_done
fi
fi fi
# Wait for udev uevents # Wait for udev uevents
if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then
stat_busy "Waiting for UDev uevents to be processed" stat_busy "Waiting for UDev uevents to be processed"
udevstart="$(/bin/date +%s%0N)"
/sbin/udevadm settle /sbin/udevadm settle
/sbin/udevadm control --property=STARTUP=
stat_done stat_done
udevend="$(/bin/date +%s%0N)"
printhl " UDev uevent processing time: $((($udevend-$udevstart)/1000000))ms"
fi fi
run_hook sysinit_udevsettled
# bring up the loopback interface # bring up the loopback interface
if [ -d /sys/class/net/lo ]; then if [ -d /sys/class/net/lo ]; then
stat_busy "Bringing up loopback interface" stat_busy "Bringing up loopback interface"
@ -127,13 +117,6 @@ fi
# If necessary, find md devices and manually assemble RAID arrays # If necessary, find md devices and manually assemble RAID arrays
if [ -f /etc/mdadm.conf -a "$(/bin/grep ^ARRAY /etc/mdadm.conf 2>/dev/null)" ]; then if [ -f /etc/mdadm.conf -a "$(/bin/grep ^ARRAY /etc/mdadm.conf 2>/dev/null)" ]; then
# udev won't create these md nodes, so we do it ourselves
for dev in $(/bin/grep ^ARRAY /etc/mdadm.conf | /bin/awk '{print $2}'); do
path=$(echo $dev | /bin/sed 's|/[^/]*$||')
node=$(echo $dev | /bin/sed "s|^$path/||")
minor=$(echo $node | /bin/sed 's|^[^0-9]*||')
[ ! -e $path/$node ] && /bin/mknod $path/$node b 9 $minor
done
status "Activating RAID arrays" /sbin/mdadm --assemble --scan status "Activating RAID arrays" /sbin/mdadm --assemble --scan
fi fi
@ -142,7 +125,6 @@ if [ "$USELVM" = "yes" -o "$USELVM" = "YES" ]; then
# Kernel 2.6.x, LVM2 groups # Kernel 2.6.x, LVM2 groups
/sbin/modprobe -q dm-mod 2>/dev/null /sbin/modprobe -q dm-mod 2>/dev/null
stat_busy "Activating LVM2 groups" stat_busy "Activating LVM2 groups"
/sbin/lvm vgscan --ignorelockingfailure --mknodes >/dev/null
/sbin/lvm vgchange --ignorelockingfailure -a y >/dev/null /sbin/lvm vgchange --ignorelockingfailure -a y >/dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
stat_fail stat_fail
@ -221,7 +203,6 @@ if [ -f /etc/crypttab -a -n "$(/bin/grep -v ^# /etc/crypttab | /bin/grep -v ^$)"
# Maybe someone has LVM on an encrypted block device # Maybe someone has LVM on an encrypted block device
if [ "$USELVM" = "yes" -o "$USELVM" = "YES" ]; then if [ "$USELVM" = "yes" -o "$USELVM" = "YES" ]; then
if [ -x /sbin/lvm -a -d /sys/block ]; then if [ -x /sbin/lvm -a -d /sys/block ]; then
/sbin/lvm vgscan --ignorelockingfailure --mknodes >/dev/null
/sbin/lvm vgchange --ignorelockingfailure -a y >/dev/null /sbin/lvm vgchange --ignorelockingfailure -a y >/dev/null
fi fi
fi fi
@ -254,11 +235,11 @@ if [ -x /sbin/fsck ]; then
echo echo
echo "********************** REBOOT REQUIRED *********************" echo "********************** REBOOT REQUIRED *********************"
echo "* *" echo "* *"
echo "* The system will be rebooted automatically in 10 seconds. *" echo "* The system will be rebooted automatically in 15 seconds. *"
echo "* *" echo "* *"
echo "************************************************************" echo "************************************************************"
echo echo
/bin/sleep 10 /bin/sleep 15
fsck_reboot fsck_reboot
fi fi
if [ ${fsckret} -gt 1 -a ${fsckret} -ne 32 ]; then if [ ${fsckret} -gt 1 -a ${fsckret} -ne 32 ]; then
@ -281,13 +262,14 @@ fi
stat_busy "Mounting Local Filesystems" stat_busy "Mounting Local Filesystems"
/bin/mount -n -o remount,rw / /bin/mount -n -o remount,rw /
/bin/rm -f /etc/mtab* : >| /etc/mtab
# make sure / gets written to /etc/mtab # make sure / gets written to /etc/mtab
/bin/mount -o remount,rw / /bin/mount -o remount,rw /
# Write /proc, /sys and /dev to /etc/mtab # Write /proc, /sys and /dev to /etc/mtab
if [ -e /proc/mounts ]; then if [ -e /proc/mounts ]; then
/bin/grep -e "/proc " -e "/sys " -e "/dev " /proc/mounts >> /etc/mtab /bin/grep -e "/proc " -e "/sys " -e "/dev " /proc/mounts >> /etc/mtab
fi fi
run_hook sysinit_premount
# now mount all the local filesystems # now mount all the local filesystems
/bin/mount -a -t $NETFS -O no_netdev /bin/mount -a -t $NETFS -O no_netdev
stat_done stat_done
@ -295,17 +277,24 @@ stat_done
status "Activating Swap" /sbin/swapon -a status "Activating Swap" /sbin/swapon -a
stat_busy "Configuring System Clock" stat_busy "Configuring System Clock"
if [ ! -f /var/lib/hwclock/adjtime ]; then
echo "0.0 0 0.0" > /var/lib/hwclock/adjtime
fi
if [ "$TIMEZONE" != "" -a -e "/usr/share/zoneinfo/$TIMEZONE" ]; then if [ "$TIMEZONE" != "" -a -e "/usr/share/zoneinfo/$TIMEZONE" ]; then
/bin/rm -f /etc/localtime /bin/rm -f /etc/localtime
/bin/cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime /bin/cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime
fi fi
clock_pid=""
if [ -n "$HWCLOCK_PARAMS" ]; then if [ -n "$HWCLOCK_PARAMS" ]; then
/sbin/hwclock --adjust #Adjust for system drift # This time, we set the clock for real. Use the adjustment file now that
# /var will definitely be available, and then set the system clock once
# the hardware clock has been adjusted accordingly. The backgrounding magic
# is due to the fact that the second call to hwclock will almost always
# take ~1 second because of the clock granularity, and we might as well
# stay busy.
(
/sbin/hwclock --adjust
/sbin/hwclock $HWCLOCK_PARAMS /sbin/hwclock $HWCLOCK_PARAMS
) &
clock_pid=$!
fi fi
stat_done stat_done
@ -323,7 +312,7 @@ stat_busy "Removing Leftover Files"
/bin/rm -rf /tmp/* /tmp/.* &>/dev/null /bin/rm -rf /tmp/* /tmp/.* &>/dev/null
/bin/rm -f /forcefsck &>/dev/null /bin/rm -f /forcefsck &>/dev/null
(cd /var/run && /usr/bin/find . ! -type d -exec /bin/rm -f -- {} \; ) (cd /var/run && /usr/bin/find . ! -type d -exec /bin/rm -f -- {} \; )
: > /var/run/utmp : >| /var/run/utmp
/bin/chmod 0664 /var/run/utmp /bin/chmod 0664 /var/run/utmp
# Keep {x,k,g}dm happy with xorg # Keep {x,k,g}dm happy with xorg
/bin/mkdir /tmp/.ICE-unix && /bin/chmod 1777 /tmp/.ICE-unix /bin/mkdir /tmp/.ICE-unix && /bin/chmod 1777 /tmp/.ICE-unix
@ -345,7 +334,7 @@ fi
status "Updating Module Dependencies" /sbin/depmod -A status "Updating Module Dependencies" /sbin/depmod -A
# Flush old locale settings # Flush old locale settings
: >/etc/profile.d/locale.sh : >| /etc/profile.d/locale.sh
/bin/chmod 755 /etc/profile.d/locale.sh /bin/chmod 755 /etc/profile.d/locale.sh
# Set user defined locale # Set user defined locale
[ -z "$LOCALE" ] && LOCALE="en_US" [ -z "$LOCALE" ] && LOCALE="en_US"
@ -360,10 +349,10 @@ if echo "$LOCALE" | /bin/grep -qi utf ; then
# but also when user has set vt.default_utf8=0 but LOCALE is *.UTF-8. # but also when user has set vt.default_utf8=0 but LOCALE is *.UTF-8.
for i in /dev/tty[0-9]*; do for i in /dev/tty[0-9]*; do
/usr/bin/kbd_mode -u < ${i} /usr/bin/kbd_mode -u < ${i}
printf "\e%%G" > ${i} printf "\033%%G" > ${i}
done done
# the $CONSOLE check helps us avoid this when running scripts from cron # the $CONSOLE check helps us avoid this when running scripts from cron
echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\e%%G"; fi' >>/etc/profile.d/locale.sh echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\033%%G"; fi' >>/etc/profile.d/locale.sh
stat_done stat_done
[ -n "$KEYMAP" ] && status "Loading Keyboard Map: $KEYMAP" /bin/loadkeys -q -u $KEYMAP [ -n "$KEYMAP" ] && status "Loading Keyboard Map: $KEYMAP" /bin/loadkeys -q -u $KEYMAP
else else
@ -371,10 +360,10 @@ else
# make non-UTF-8 consoles work on 2.6.24 and newer kernels # make non-UTF-8 consoles work on 2.6.24 and newer kernels
for i in /dev/tty[0-9]*; do for i in /dev/tty[0-9]*; do
/usr/bin/kbd_mode -a < ${i} /usr/bin/kbd_mode -a < ${i}
printf "\e%%@" > ${i} printf "\033%%@" > ${i}
done done
# the $CONSOLE check helps us avoid this when running scripts from cron # the $CONSOLE check helps us avoid this when running scripts from cron
echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\e%%@"; fi' >>/etc/profile.d/locale.sh echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\033%%@"; fi' >>/etc/profile.d/locale.sh
stat_done stat_done
[ -n "$KEYMAP" ] && status "Loading Keyboard Map: $KEYMAP" /bin/loadkeys -q $KEYMAP [ -n "$KEYMAP" ] && status "Loading Keyboard Map: $KEYMAP" /bin/loadkeys -q $KEYMAP
fi fi
@ -396,10 +385,10 @@ if [ -n "$CONSOLEFONT" ]; then
stat_fail stat_fail
else else
for i in /dev/tty[0-9]*; do for i in /dev/tty[0-9]*; do
printf "\e(K" > ${i} printf "\033(K" > ${i}
done done
# the $CONSOLE check helps us avoid this when running scripts from cron # the $CONSOLE check helps us avoid this when running scripts from cron
echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\e(K"; fi' >>/etc/profile.d/locale.sh echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\033(K"; fi' >>/etc/profile.d/locale.sh
stat_done stat_done
fi fi
fi fi
@ -418,4 +407,12 @@ fi
/bin/dmesg >| /var/log/dmesg.log /bin/dmesg >| /var/log/dmesg.log
# final hwclock setting needs to be done at this point
if [ -n "$clock_pid" ]; then
wait $clock_pid
fi
run_hook sysinit_end
# End of file # End of file