diff options
Diffstat (limited to 'meta/packages/initrdscripts/files/init-live.sh')
-rw-r--r-- | meta/packages/initrdscripts/files/init-live.sh | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/meta/packages/initrdscripts/files/init-live.sh b/meta/packages/initrdscripts/files/init-live.sh deleted file mode 100644 index c96b1f47c3..0000000000 --- a/meta/packages/initrdscripts/files/init-live.sh +++ /dev/null | |||
@@ -1,92 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ROOT_MOUNT="/rootfs/" | ||
4 | ROOT_IMAGE=rootfs.img | ||
5 | MOUNT="/bin/mount" | ||
6 | UMOUNT="/bin/umount" | ||
7 | |||
8 | early_setup() { | ||
9 | mkdir /proc | ||
10 | mkdir /sys | ||
11 | mount -t proc proc /proc | ||
12 | mount -t sysfs sysfs /sys | ||
13 | udevd --daemon | ||
14 | } | ||
15 | |||
16 | read_args() { | ||
17 | [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline` | ||
18 | for arg in $CMDLINE; do | ||
19 | optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'` | ||
20 | case $arg in | ||
21 | root=*) | ||
22 | ROOT_DEVICE=$optarg ;; | ||
23 | rootfstype=*) | ||
24 | ROOT_FSTYPE=$optarg ;; | ||
25 | rootdelay=*) | ||
26 | rootdelay=$optarg ;; | ||
27 | LABEL=*) | ||
28 | label=$optarg ;; | ||
29 | video=*) | ||
30 | video_mode=$arg ;; | ||
31 | vga=*) | ||
32 | vga_mode=$arg ;; | ||
33 | esac | ||
34 | done | ||
35 | } | ||
36 | |||
37 | boot_live_root() { | ||
38 | killall udevd | ||
39 | cd $ROOT_MOUNT | ||
40 | exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init | ||
41 | } | ||
42 | |||
43 | fatal() { | ||
44 | echo $1 >$CONSOLE | ||
45 | echo >$CONSOLE | ||
46 | exec sh | ||
47 | } | ||
48 | |||
49 | early_setup | ||
50 | |||
51 | [ -z "$CONSOLE" ] && CONSOLE="/dev/console" | ||
52 | |||
53 | read_args | ||
54 | |||
55 | echo "Waiting for removable media..." | ||
56 | while true | ||
57 | do | ||
58 | for i in `ls /media 2>/dev/null`; do | ||
59 | if [ -f /media/$i/$ROOT_IMAGE ] ; then | ||
60 | found="yes" | ||
61 | break | ||
62 | fi | ||
63 | done | ||
64 | if [ "$found" = "yes" ]; then | ||
65 | break; | ||
66 | fi | ||
67 | sleep 1 | ||
68 | done | ||
69 | |||
70 | case $label in | ||
71 | boot) | ||
72 | mkdir $ROOT_MOUNT | ||
73 | mknod /dev/loop0 b 7 0 | ||
74 | |||
75 | if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ROOT_IMAGE $ROOT_MOUNT ; then | ||
76 | fatal "Couldnt mount rootfs image" | ||
77 | else | ||
78 | boot_live_root | ||
79 | fi | ||
80 | ;; | ||
81 | install) | ||
82 | if [ -f /media/$i/$ROOT_IMAGE ] ; then | ||
83 | ./install.sh $i $ROOT_IMAGE $video_mode $vga_mode | ||
84 | else | ||
85 | fatal "Couldnt find install script" | ||
86 | fi | ||
87 | |||
88 | # If we're getting here, we failed... | ||
89 | fatal "Installation image failed" | ||
90 | ;; | ||
91 | esac | ||
92 | |||