base-files: sanitize and unify $PATH
[openwrt/staging/mkresin.git] / package / base-files / files / etc / preinit
1 #!/bin/sh
2 # Copyright (C) 2006 OpenWrt.org
3 # Copyright (C) 2010 Vertical Communications
4
5 [ -z "$PREINIT" ] && exec /sbin/init
6
7 export PATH=/usr/sbin:/usr/bin:/sbin:/bin
8
9 pi_ifname=
10 pi_ip=192.168.1.1
11 pi_broadcast=192.168.1.255
12 pi_netmask=255.255.255.0
13
14 fs_failsafe_ifname=
15 fs_failsafe_ip=192.168.1.1
16 fs_failsafe_broadcast=192.168.1.255
17 fs_failsafe_netmask=255.255.255.0
18
19 fs_failsafe_wait_timeout=2
20
21 pi_suppress_stderr="y"
22 pi_init_suppress_stderr="y"
23 pi_init_path="/usr/sbin:/usr/bin:/sbin:/bin"
24 pi_init_cmd="/sbin/init"
25
26 . /lib/functions.sh
27 . /lib/functions/preinit.sh
28 . /lib/functions/system.sh
29
30 boot_hook_init preinit_essential
31 boot_hook_init preinit_main
32 boot_hook_init failsafe
33 boot_hook_init initramfs
34 boot_hook_init preinit_mount_root
35
36 for pi_source_file in /lib/preinit/*; do
37 . $pi_source_file
38 done
39
40 boot_run_hook preinit_essential
41
42 pi_mount_skip_next=false
43 pi_jffs2_mount_success=false
44 pi_failsafe_net_message=false
45
46 boot_run_hook preinit_main