diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2014-05-15 17:36:17 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-05-20 14:53:12 +0100 |
commit | 8293f564685d0f587ab63a107285625dc4f98f1c (patch) | |
tree | c66fce8fe0427cf08bf08cacf6ed422cddf6e19f /meta | |
parent | 77b4b25c360aaa311a481786ae32e06a2b29feb1 (diff) | |
download | poky-8293f564685d0f587ab63a107285625dc4f98f1c.tar.gz |
initrdscripts: fix for /run/media
mount.sh in udev-extraconf was modified to use /run/media instead
of /media. Unfortunately, our scripts in initrdscripts have some
dependency on the auto-mounting mechanism proviced by udev-extraconf.
So these scripts should also be fixed to use /run/media instead /media,
otherwise, our live image cannot work correctly.
(From OE-Core rev: be0327b6a900be5434b6b1f08277faf2f65d5da8)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
5 files changed, 27 insertions, 27 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh b/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh index 2fea7610f9..7a0b4d4406 100644 --- a/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh +++ b/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh | |||
@@ -128,7 +128,7 @@ mkdir /rootmnt | |||
128 | mkdir /bootmnt | 128 | mkdir /bootmnt |
129 | 129 | ||
130 | mount $rootfs /ssd | 130 | mount $rootfs /ssd |
131 | mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt | 131 | mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /rootmnt |
132 | 132 | ||
133 | echo "Copying rootfs files..." | 133 | echo "Copying rootfs files..." |
134 | cp -a /rootmnt/* /ssd | 134 | cp -a /rootmnt/* /ssd |
@@ -150,13 +150,13 @@ mount $bootfs /ssd | |||
150 | 150 | ||
151 | EFIDIR="/ssd/EFI/BOOT" | 151 | EFIDIR="/ssd/EFI/BOOT" |
152 | mkdir -p $EFIDIR | 152 | mkdir -p $EFIDIR |
153 | cp /media/$1/vmlinuz /ssd | 153 | cp /run/media/$1/vmlinuz /ssd |
154 | # Copy the efi loader | 154 | # Copy the efi loader |
155 | cp /media/$1/EFI/BOOT/*.efi $EFIDIR | 155 | cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR |
156 | 156 | ||
157 | if [ -f /media/$1/EFI/BOOT/grub.cfg ]; then | 157 | if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then |
158 | GRUBCFG="$EFIDIR/grub.cfg" | 158 | GRUBCFG="$EFIDIR/grub.cfg" |
159 | cp /media/$1/EFI/BOOT/grub.cfg $GRUBCFG | 159 | cp /run/media/$1/EFI/BOOT/grub.cfg $GRUBCFG |
160 | # Update grub config for the installed image | 160 | # Update grub config for the installed image |
161 | # Delete the install entry | 161 | # Delete the install entry |
162 | sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG | 162 | sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG |
@@ -170,10 +170,10 @@ if [ -f /media/$1/EFI/BOOT/grub.cfg ]; then | |||
170 | sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG | 170 | sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG |
171 | fi | 171 | fi |
172 | 172 | ||
173 | if [ -d /media/$1/loader ]; then | 173 | if [ -d /run/media/$1/loader ]; then |
174 | GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf" | 174 | GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf" |
175 | # copy config files for gummiboot | 175 | # copy config files for gummiboot |
176 | cp -dr /media/$1/loader /ssd | 176 | cp -dr /run/media/$1/loader /ssd |
177 | # delete the install entry | 177 | # delete the install entry |
178 | rm -f /ssd/loader/entries/install.conf | 178 | rm -f /ssd/loader/entries/install.conf |
179 | # delete the initrd lines | 179 | # delete the initrd lines |
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh index ed3221b0a6..8bd70251cd 100644 --- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh +++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh | |||
@@ -128,7 +128,7 @@ mkdir /rootmnt | |||
128 | mkdir /bootmnt | 128 | mkdir /bootmnt |
129 | 129 | ||
130 | mount $rootfs /ssd | 130 | mount $rootfs /ssd |
131 | mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt | 131 | mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /rootmnt |
132 | 132 | ||
133 | echo "Copying rootfs files..." | 133 | echo "Copying rootfs files..." |
134 | cp -a /rootmnt/* /ssd | 134 | cp -a /rootmnt/* /ssd |
@@ -150,13 +150,13 @@ mount $bootfs /ssd | |||
150 | 150 | ||
151 | EFIDIR="/ssd/EFI/BOOT" | 151 | EFIDIR="/ssd/EFI/BOOT" |
152 | mkdir -p $EFIDIR | 152 | mkdir -p $EFIDIR |
153 | cp /media/$1/vmlinuz /ssd | 153 | cp /run/media/$1/vmlinuz /ssd |
154 | # Copy the efi loader | 154 | # Copy the efi loader |
155 | cp /media/$1/EFI/BOOT/*.efi $EFIDIR | 155 | cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR |
156 | 156 | ||
157 | if [ -f /media/$1/EFI/BOOT/grub.cfg ]; then | 157 | if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then |
158 | GRUBCFG="$EFIDIR/grub.cfg" | 158 | GRUBCFG="$EFIDIR/grub.cfg" |
159 | cp /media/$1/EFI/BOOT/grub.cfg $GRUBCFG | 159 | cp /run/media/$1/EFI/BOOT/grub.cfg $GRUBCFG |
160 | # Update grub config for the installed image | 160 | # Update grub config for the installed image |
161 | # Delete the install entry | 161 | # Delete the install entry |
162 | sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG | 162 | sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG |
@@ -170,10 +170,10 @@ if [ -f /media/$1/EFI/BOOT/grub.cfg ]; then | |||
170 | sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG | 170 | sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG |
171 | fi | 171 | fi |
172 | 172 | ||
173 | if [ -d /media/$1/loader ]; then | 173 | if [ -d /run/media/$1/loader ]; then |
174 | GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf" | 174 | GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf" |
175 | # copy config files for gummiboot | 175 | # copy config files for gummiboot |
176 | cp -dr /media/$1/loader /ssd | 176 | cp -dr /run/media/$1/loader /ssd |
177 | # delete the install entry | 177 | # delete the install entry |
178 | rm -f /ssd/loader/entries/install.conf | 178 | rm -f /ssd/loader/entries/install.conf |
179 | # delete the initrd lines | 179 | # delete the initrd lines |
diff --git a/meta/recipes-core/initrdscripts/files/init-install-testfs.sh b/meta/recipes-core/initrdscripts/files/init-install-testfs.sh index d2f2420498..26e1fb3dd2 100644 --- a/meta/recipes-core/initrdscripts/files/init-install-testfs.sh +++ b/meta/recipes-core/initrdscripts/files/init-install-testfs.sh | |||
@@ -151,7 +151,7 @@ mkdir -p /boot | |||
151 | 151 | ||
152 | # Handling of the target root partition | 152 | # Handling of the target root partition |
153 | mount $rootfs /tgt_root | 153 | mount $rootfs /tgt_root |
154 | mount -o rw,loop,noatime,nodiratime /media/$1/$2 /src_root | 154 | mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root |
155 | echo "Copying rootfs files..." | 155 | echo "Copying rootfs files..." |
156 | cp -a /src_root/* /tgt_root | 156 | cp -a /src_root/* /tgt_root |
157 | if [ -d /tgt_root/etc/ ] ; then | 157 | if [ -d /tgt_root/etc/ ] ; then |
@@ -197,7 +197,7 @@ if [ ! -f /boot/grub/grub.cfg ] ; then | |||
197 | echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst | 197 | echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst |
198 | fi | 198 | fi |
199 | 199 | ||
200 | cp /media/$1/vmlinuz /boot/ | 200 | cp /run/media/$1/vmlinuz /boot/ |
201 | 201 | ||
202 | umount /boot | 202 | umount /boot |
203 | 203 | ||
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh index 8e433d5eda..b1600030f5 100644 --- a/meta/recipes-core/initrdscripts/files/init-install.sh +++ b/meta/recipes-core/initrdscripts/files/init-install.sh | |||
@@ -151,7 +151,7 @@ mkdir -p /boot | |||
151 | 151 | ||
152 | # Handling of the target root partition | 152 | # Handling of the target root partition |
153 | mount $rootfs /tgt_root | 153 | mount $rootfs /tgt_root |
154 | mount -o rw,loop,noatime,nodiratime /media/$1/$2 /src_root | 154 | mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root |
155 | echo "Copying rootfs files..." | 155 | echo "Copying rootfs files..." |
156 | cp -a /src_root/* /tgt_root | 156 | cp -a /src_root/* /tgt_root |
157 | if [ -d /tgt_root/etc/ ] ; then | 157 | if [ -d /tgt_root/etc/ ] ; then |
@@ -194,7 +194,7 @@ if [ ! -f /boot/grub/grub.cfg ] ; then | |||
194 | echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst | 194 | echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst |
195 | fi | 195 | fi |
196 | 196 | ||
197 | cp /media/$1/vmlinuz /boot/ | 197 | cp /run/media/$1/vmlinuz /boot/ |
198 | 198 | ||
199 | umount /boot | 199 | umount /boot |
200 | 200 | ||
diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh index 0bc38b776e..0be9b6fb48 100644 --- a/meta/recipes-core/initrdscripts/files/init-live.sh +++ b/meta/recipes-core/initrdscripts/files/init-live.sh | |||
@@ -82,9 +82,9 @@ boot_live_root() { | |||
82 | 82 | ||
83 | # Move the mount points of some filesystems over to | 83 | # Move the mount points of some filesystems over to |
84 | # the corresponding directories under the real root filesystem. | 84 | # the corresponding directories under the real root filesystem. |
85 | for dir in `awk '/\/dev.* \/media/{print $2}' /proc/mounts`; do | 85 | for dir in `awk '/\/dev.* \/run\/media/{print $2}' /proc/mounts`; do |
86 | mkdir -p ${ROOT_MOUNT}/$dir | 86 | mkdir -p ${ROOT_MOUNT}/media/${dir##*/} |
87 | mount -n --move $dir ${ROOT_MOUNT}/$dir | 87 | mount -n --move $dir ${ROOT_MOUNT}/media/${dir##*/} |
88 | done | 88 | done |
89 | mount -n --move /proc ${ROOT_MOUNT}/proc | 89 | mount -n --move /proc ${ROOT_MOUNT}/proc |
90 | mount -n --move /sys ${ROOT_MOUNT}/sys | 90 | mount -n --move /sys ${ROOT_MOUNT}/sys |
@@ -113,11 +113,11 @@ echo "Waiting for removable media..." | |||
113 | C=0 | 113 | C=0 |
114 | while true | 114 | while true |
115 | do | 115 | do |
116 | for i in `ls /media 2>/dev/null`; do | 116 | for i in `ls /run/media 2>/dev/null`; do |
117 | if [ -f /media/$i/$ROOT_IMAGE ] ; then | 117 | if [ -f /run/media/$i/$ROOT_IMAGE ] ; then |
118 | found="yes" | 118 | found="yes" |
119 | break | 119 | break |
120 | elif [ -f /media/$i/isolinux/$ROOT_IMAGE ]; then | 120 | elif [ -f /run/media/$i/isolinux/$ROOT_IMAGE ]; then |
121 | found="yes" | 121 | found="yes" |
122 | ISOLINUX="isolinux" | 122 | ISOLINUX="isolinux" |
123 | break | 123 | break |
@@ -135,7 +135,7 @@ do | |||
135 | mount | grep media | 135 | mount | grep media |
136 | echo "Available block devices" | 136 | echo "Available block devices" |
137 | cat /proc/partitions | 137 | cat /proc/partitions |
138 | fatal "Cannot find $ROOT_IMAGE file in /media/* , dropping to a shell " | 138 | fatal "Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell " |
139 | fi | 139 | fi |
140 | C=$(( C + 1 )) | 140 | C=$(( C + 1 )) |
141 | fi | 141 | fi |
@@ -150,7 +150,7 @@ mount_and_boot() { | |||
150 | mkdir $ROOT_MOUNT | 150 | mkdir $ROOT_MOUNT |
151 | mknod /dev/loop0 b 7 0 2>/dev/null | 151 | mknod /dev/loop0 b 7 0 2>/dev/null |
152 | 152 | ||
153 | if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then | 153 | if ! mount -o rw,loop,noatime,nodiratime /run/media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then |
154 | fatal "Could not mount rootfs image" | 154 | fatal "Could not mount rootfs image" |
155 | fi | 155 | fi |
156 | 156 | ||
@@ -211,7 +211,7 @@ case $label in | |||
211 | mount_and_boot | 211 | mount_and_boot |
212 | ;; | 212 | ;; |
213 | install|install-efi) | 213 | install|install-efi) |
214 | if [ -f /media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then | 214 | if [ -f /run/media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then |
215 | ./$label.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params | 215 | ./$label.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params |
216 | else | 216 | else |
217 | fatal "Could not find $label script" | 217 | fatal "Could not find $label script" |