summaryrefslogtreecommitdiff
path: root/package/base-files/files
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-09-05 18:44:48 +0000
committerGabor Juhos <juhosg@openwrt.org>2009-09-05 18:44:48 +0000
commitf494bcc2228409eaa5efefca8f0bdad74c76153e (patch)
tree180416b1ca8c23cf0d8523e5a60145d19607314b /package/base-files/files
parent7d67818ab1be08afb0074c2065d57303f3295ad6 (diff)
downloadmtk-20170518-f494bcc2228409eaa5efefca8f0bdad74c76153e.zip
mtk-20170518-f494bcc2228409eaa5efefca8f0bdad74c76153e.tar.gz
mtk-20170518-f494bcc2228409eaa5efefca8f0bdad74c76153e.tar.bz2
package/base-files: set state to 'preinit' before preinit.arch is used, and set state to 'failsafe' when entering failsafe mode
SVN-Revision: 17517
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/etc/preinit5
1 files changed, 3 insertions, 2 deletions
diff --git a/package/base-files/files/etc/preinit b/package/base-files/files/etc/preinit
index cf042b4..688fca0 100755
--- a/package/base-files/files/etc/preinit
+++ b/package/base-files/files/etc/preinit
@@ -8,6 +8,7 @@ failsafe_ip() {
}
failsafe() {
+ set_state failsafe
[ -n "$ifname" ] && grep "$ifname" /proc/net/dev >/dev/null && {
failsafe_ip
netmsg 192.168.1.255 "Entering Failsafe!"
@@ -66,6 +67,7 @@ dd if=/dev/console of=/dev/null bs=1 count=0 >/dev/null 2>/dev/null && {
exec <$M0 >$M1 2>&0
echo "- preinit -"
+set_state preinit
echo "Press CTRL-C for failsafe"
trap 'FAILSAFE=true' INT
trap 'FAILSAFE=true' USR1
@@ -74,7 +76,6 @@ if [ -e /etc/preinit.arch ]; then
else
sleep 2
fi
-set_state preinit
echo "$HOTPLUG" > /proc/sys/kernel/hotplug
export FAILSAFE
eval ${FAILSAFE:+failsafe}
@@ -92,6 +93,6 @@ if [ -z "$INITRAMFS" ]; then
}
echo "- init -"
-
+
exec /sbin/init
fi