Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] init-live.sh: fix media automount failed after booting from usb-drive
@ 2013-06-06  6:31 Hongxu Jia
  2013-06-06  6:31 ` [PATCH 1/1] " Hongxu Jia
  0 siblings, 1 reply; 2+ messages in thread
From: Hongxu Jia @ 2013-06-06  6:31 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 5cb59cc6910d8f3165528c4a71e29e4de897d242:

  yocto-bsp: re-enable AutoAddDevices in xorg.conf for generated BSPs (2013-05-29 22:25:41 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib hongxu/fix-init-live
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-init-live

Hongxu Jia (1):
  init-live.sh: fix media automount failed after booting from usb-drive

 meta/recipes-core/initrdscripts/files/init-live.sh |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
1.7.10.4



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] init-live.sh: fix media automount failed after booting from usb-drive
  2013-06-06  6:31 [PATCH 0/1] init-live.sh: fix media automount failed after booting from usb-drive Hongxu Jia
@ 2013-06-06  6:31 ` Hongxu Jia
  0 siblings, 0 replies; 2+ messages in thread
From: Hongxu Jia @ 2013-06-06  6:31 UTC (permalink / raw)
  To: openembedded-core

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]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-core/initrdscripts/files/init-live.sh |    6 ++++--
 1 file 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 4bd1b52..804e16e 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() {
 
     # Move the mount points of some filesystems over to
     # the corresponding directories under the real root filesystem.
+    for dir in `awk '/\/dev.* \/media/{print $2}' /proc/mounts`; do
+        mkdir -p  ${ROOT_MOUNT}/$dir
+        mount -n --move $dir ${ROOT_MOUNT}/$dir
+    done
     mount -n --move /proc ${ROOT_MOUNT}/proc
     mount -n --move /sys ${ROOT_MOUNT}/sys
     mount -n --move /dev ${ROOT_MOUNT}/dev
-    # Move /media/$i over to the real root filesystem
-    mount -n --move /media/$i ${ROOT_MOUNT}/media/realroot
 
     cd $ROOT_MOUNT
     exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-06  6:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-06  6:31 [PATCH 0/1] init-live.sh: fix media automount failed after booting from usb-drive Hongxu Jia
2013-06-06  6:31 ` [PATCH 1/1] " Hongxu Jia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox