summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2013-06-06 14:31:17 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-11 15:38:00 +0100
commit66079795c9eaec1a7ae376b25d91eea14e6498b7 (patch)
tree4da223b33443248ec5d66ac3335c97344453d882 /meta
parent9682f1609c92dcefc96c12978ae2a059453feea9 (diff)
downloadpoky-66079795c9eaec1a7ae376b25d91eea14e6498b7.tar.gz
init-live.sh: fix media automount failed after booting from usb-drive
1, This issue happens to BSP only. After a BSP board is booted with Yocto linux from USB drive, "cat /proc/mounts" shows: ... /dev/sda3 /media/sda3 ext3 rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0 /dev/sda1 /media/sda1 ext3 rw,relatime,errors=continue,barrier=1,data=ordered 0 0 /dev/sda2 /media/sda2 ext3 rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0 ... but actually the directory /media/sda1 doesn't exist at all, "df" shows: ... df: /media/sda3: No such file or directory df: /media/sda1: No such file or directory df: /media/sda2: No such file or directory ... 2, This is because the mount data comes from proc setup during early boot before the change root, which then uses a different root filesystem, the media is not in the new root filesystem. 3, During early boot before switch_root, use `mount --move' to move all medias to the new root filesystem could also fix this issue. [YOCTO #2064] [YOCTO #3705] (From OE-Core rev: 79bd773cc5e8b8e873cabeb2b9a91f460501dad7) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/initrdscripts/files/init-live.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index 4bd1b52c11..804e16ec6f 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -79,11 +79,13 @@ boot_live_root() {
79 79
80 # Move the mount points of some filesystems over to 80 # Move the mount points of some filesystems over to
81 # the corresponding directories under the real root filesystem. 81 # the corresponding directories under the real root filesystem.
82 for dir in `awk '/\/dev.* \/media/{print $2}' /proc/mounts`; do
83 mkdir -p ${ROOT_MOUNT}/$dir
84 mount -n --move $dir ${ROOT_MOUNT}/$dir
85 done
82 mount -n --move /proc ${ROOT_MOUNT}/proc 86 mount -n --move /proc ${ROOT_MOUNT}/proc
83 mount -n --move /sys ${ROOT_MOUNT}/sys 87 mount -n --move /sys ${ROOT_MOUNT}/sys
84 mount -n --move /dev ${ROOT_MOUNT}/dev 88 mount -n --move /dev ${ROOT_MOUNT}/dev
85 # Move /media/$i over to the real root filesystem
86 mount -n --move /media/$i ${ROOT_MOUNT}/media/realroot
87 89
88 cd $ROOT_MOUNT 90 cd $ROOT_MOUNT
89 exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init 91 exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init