diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2010-02-15 22:30:13 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2010-02-15 22:30:13 +0100 |
commit | c57d0300bd42fabd8eeda2a95b6c3960d6e7ce07 (patch) | |
tree | b53bc538246b5a900300b5c6b5ea740f978196f4 /package/base-files/src/etc/init.d | |
parent | cf4b3959527339206254b8c8fc44deb391beeb10 (diff) | |
parent | 023560ac69a2ecf5659c668c26c0af6b5612a46b (diff) |
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Conflicts:
package/nspr/Makefile
Diffstat (limited to 'package/base-files/src/etc/init.d')
-rw-r--r-- | package/base-files/src/etc/init.d/boot | 29 | ||||
-rw-r--r-- | package/base-files/src/etc/init.d/done | 4 | ||||
-rwxr-xr-x | package/base-files/src/etc/init.d/rcK | 21 | ||||
-rwxr-xr-x | package/base-files/src/etc/init.d/rcS | 10 |
4 files changed, 64 insertions, 0 deletions
diff --git a/package/base-files/src/etc/init.d/boot b/package/base-files/src/etc/init.d/boot new file mode 100644 index 000000000..2ef6538e0 --- /dev/null +++ b/package/base-files/src/etc/init.d/boot @@ -0,0 +1,29 @@ +#!/bin/sh +#INIT 10 +[[ $1 = autostart ]] || exit 0 + +. /etc/functions.sh + +mkdir -p /var/log +mkdir -p /var/run +touch /var/log/lastlog +touch /var/log/wtmp +ln -s /var/tmp /tmp + +echo 0 > /proc/sys/kernel/printk + +HOSTNAME= +[[ -s /etc/hostname ]] && HOSTNAME=$(cat /etc/hostname) +HOSTNAME=${HOSTNAME%%.*} +echo ${HOSTNAME:=linux} >/proc/sys/kernel/hostname + +chown 0:0 /tmp; chmod 1777 /tmp + +load_modules /etc/modules +for f in /etc/modules.d/*; do + [[ -e $f ]] && load_modules /etc/modules.d/* + break +done +# settle down, after module load +sleep 2 +exit 0 diff --git a/package/base-files/src/etc/init.d/done b/package/base-files/src/etc/init.d/done new file mode 100644 index 000000000..e5b655bb6 --- /dev/null +++ b/package/base-files/src/etc/init.d/done @@ -0,0 +1,4 @@ +#!/bin/sh +#INIT 98 +[[ $1 = autostart ]] && sysctl -p >&- +exit 0 diff --git a/package/base-files/src/etc/init.d/rcK b/package/base-files/src/etc/init.d/rcK new file mode 100755 index 000000000..e94d1a296 --- /dev/null +++ b/package/base-files/src/etc/init.d/rcK @@ -0,0 +1,21 @@ +#!/bin/sh +export PATH=/bin:/sbin:/usr/bin:/usr/sbin +busybox reboot -d 60 -f & # just in caseā¦ +{ + [[ -f /proc/diag/led/power ]] && echo f >/proc/diag/led/power + test -e /etc/rc.shutdown && (/bin/sh /etc/rc.shutdown) 2>&1 + grep '^#INIT ' /etc/init.d/* | \ + sort -rnk2 | \ + while read line; do + shebang=$(sed -n '1s/^#![ ]*//p' ${line%%:*}) + case $shebang in + *[\ \ ]*) shebang=\'$(echo X"$shebang" | sed \ + -e 's/^X//' -e "s/'/'\\\\''/g" \ + -e 's/^\([^ ][^ ]*\)[ ]*$/\1/' \ + -e 's/^\([^ ][^ ]*\)[ ][ ]*\(..*\)$/\1 \2/' \ + -e 's/^\([^ ][^ ]*\) /\1'\'' '\''/')\' ;; + esac + ${shebang:-/bin/sh} ${line%%:*} autostop 2>&1 + done + [[ -f /proc/diag/led/power ]] && echo 0 >/proc/diag/led/power +} | logger -s -p 6 -t '' diff --git a/package/base-files/src/etc/init.d/rcS b/package/base-files/src/etc/init.d/rcS new file mode 100755 index 000000000..fd56feebf --- /dev/null +++ b/package/base-files/src/etc/init.d/rcS @@ -0,0 +1,10 @@ +#!/bin/sh +export PATH=/bin:/sbin:/usr/bin:/usr/sbin +{ + grep '^#INIT ' /etc/init.d/* | \ + sort -nk2 | \ + while read line; do + /bin/sh ${line%%:*} autostart 2>&1 + done + test -e /etc/init.d/boot.local && (/bin/sh /etc/init.d/boot.local) 2>&1 +} | logger -s -p 6 -t '' & |