2 # Copyright (C) 2006 OpenWrt.org
4 export PATH
=/bin
:/sbin
:/usr
/bin
:/usr
/sbin
5 mount none
/proc
-t proc
7 if grep devfs
/proc
/filesystems
> /dev
/null
; then
8 mount none
/dev
-t devfs
10 mount
-t sysfs none
/sys
11 mount
-t tmpfs tmpfs
/dev
-o size
=512K
12 mknod
/dev
/console c
5 1
15 /sbin
/hotplug2
--no-persistent --coldplug --max_children 1
18 mount none
/dev
/pts
-t devpts
20 # the root mount point can come from the kernel command line
21 # or it can be overridden in the preinit.arch file
22 [ -f /etc
/preinit.arch
] && .
/etc
/preinit.arch
24 # if we have no root parameter, just go to running from ramfs
26 export NOMOUNT
="No Root"
30 #if we have a failsafe boot selected, dont bother
31 #trying to find or wait for a root mount point
32 [ -z "$FAILSAFE" ] ||
{
33 exec /bin
/busybox init
36 # Load the modules we have in initramfs, this should
37 # make the media accessible, but, it may take some time
39 load_modules
/etc
/modules
/etc
/modules.d
/*
41 #wait 10 seconds for the disc to show up
42 #usb stick typically takes 4 to 6 seconds
44 #it's quite possible the disc never shows up
45 #if we netbooted this kernel
47 while [ $COUNTER -lt 10 ]; do
49 [ -e $rootfs ] && let COUNTER
=10;
53 export FAILSAFE
="NoDisc"
54 exec /bin
/busybox init
57 # now we'll try mount it, again with a timeout
58 # This will fail if the inserted stick is formatted
59 # in a manner we dont understand
61 while [ $COUNTER -lt 10 ]; do
64 [ $?
-eq "0" ] && let COUNTER
=100;
68 export FAILSAFE
="MountFail"
69 exec /bin
/busybox init
72 #It mounted, lets look for a postinit file, again, give it time
73 #I've seen this take 6 seconds to actually complete
75 while [ $COUNTER -lt 10 ]; do
77 [ -e /mnt
/etc
/banner ] && let COUNTER
=10;
80 [ -e /mnt
/etc
/banner ] ||
{
81 export FAILSAFE
="No Openwrt FS"
82 exec /bin
/busybox init
87 mount
-o move
/proc
/mnt
/proc
88 mount
-o move
/dev
/mnt
/dev
89 mount
-o move
/dev
/pts
/mnt
/dev
/pts
90 mount
-o move
/tmp
/mnt
/tmp
91 mount
-o move
/sys
/mnt
/sys
92 mount none
/tmp
-t tmpfs
93 exec switch_root
-c /dev
/console
/mnt
/sbin
/init
This page took 0.057654 seconds and 5 git commands to generate.