summaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc/preinit
blob: b23508f552e3647f0d36580fd1bb378fea0036ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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