summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/packages/initrdscripts/files/init-live.sh41
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
8early_setup() { 8early_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
41echo "Starting initramfs boot..."
42early_setup 49early_setup
43 50
44[ -z "$CONSOLE" ] && CONSOLE="/dev/console" 51[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
45 52
46read_args 53read_args
47 54
48echo "Waiting for Live image to show up..." 55echo "Waiting for removable media..."
49while true 56while true
50do 57do
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
60done 67done
61 68
62mkdir $ROOT_MOUNT 69case $label in
63mknod /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 ;;
90esac
64 91
65if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ROOT_IMAGE $ROOT_MOUNT
66then
67 fatal "Couldnt mount rootfs image"
68else
69 boot_live_root
70fi