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