aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc/preinit
diff options
context:
space:
mode:
authorMike Baker <mbm@openwrt.org>2007-05-10 14:37:47 +0000
committerMike Baker <mbm@openwrt.org>2007-05-10 14:37:47 +0000
commit4a41439c46022840555c3c16c30324b5760c07e2 (patch)
tree4724b34dc713936c9d20d3d93dc5778a4e849db3 /package/base-files/files/etc/preinit
parent862103b0398c9cf0b5ba1d1a58d8a81bbe3d4452 (diff)
downloadupstream-4a41439c46022840555c3c16c30324b5760c07e2.tar.gz
upstream-4a41439c46022840555c3c16c30324b5760c07e2.tar.bz2
upstream-4a41439c46022840555c3c16c30324b5760c07e2.zip
unified preinit environment
SVN-Revision: 7173
Diffstat (limited to 'package/base-files/files/etc/preinit')
-rwxr-xr-xpackage/base-files/files/etc/preinit14
1 files changed, 14 insertions, 0 deletions
diff --git a/package/base-files/files/etc/preinit b/package/base-files/files/etc/preinit
index c60a0f850f..b23508f552 100755
--- a/package/base-files/files/etc/preinit
+++ b/package/base-files/files/etc/preinit
@@ -1,6 +1,20 @@
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+. /etc/diag.sh
+
+failsafe() {
+ lock /tmp/.failsafe
+ ash --login
+}
+
[ -e /etc/preinit.arch ] && . /etc/preinit.arch
+
+set_state preinit
+
mount_root ${FAILSAFE:+failsafe}
+
+eval ${FAILSAFE:+failsafe}
+lock -w /tmp/.failsafe
+
exec /sbin/init