summaryrefslogtreecommitdiffstats
path: root/meta/packages/initrdscripts/files
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@openedhand.com>2008-10-08 14:34:50 +0000
committerSamuel Ortiz <sameo@openedhand.com>2008-10-08 14:34:50 +0000
commit62ece10eb171a341bba097a53fac1bb63a5ee4e4 (patch)
tree1e93d526fe497c6863e26d05389d256ead8dd3a9 /meta/packages/initrdscripts/files
parent460d93416d2f0dba887ffe83d781d7bf05da0017 (diff)
downloadpoky-62ece10eb171a341bba097a53fac1bb63a5ee4e4.tar.gz
initrdscripts: init can now launch the installation script
Depending on the boot label ("boot" or "install"), init will either chroot into the rootfs image (live boot path), or launch the installation script (installation path). git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5457 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/initrdscripts/files')
-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