diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2012-12-31 15:55:20 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-01-07 11:09:40 +0000 |
commit | 14649c003550ee08b73b1d8dbf51343087295e7b (patch) | |
tree | a3d50f09af98448827e40eb2247b037a29b67164 /meta/recipes-core/initrdscripts | |
parent | 9f5e0b8fec193846d531ac59c2f91297325eff6c (diff) | |
download | poky-14649c003550ee08b73b1d8dbf51343087295e7b.tar.gz |
init-live.sh: avoid duplicate mount points for the same filesystem
A live system had duplicate mount points for the same filesystem
in the output of 'mount' command. That was because we didn't handle
the temporary mounts properly before switch_root.
This patch fixes this problem by moving the mount points of some
filesystems to the corresponding directories in the real root filesystem.
[YOCTO #3155]
(From OE-Core rev: 050a745413f8bb26212b84da391e0f7665f77728)
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/recipes-core/initrdscripts')
-rw-r--r-- | meta/recipes-core/initrdscripts/files/init-live.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh index e8d7f70c2c..0ae359d617 100644 --- a/meta/recipes-core/initrdscripts/files/init-live.sh +++ b/meta/recipes-core/initrdscripts/files/init-live.sh | |||
@@ -59,10 +59,11 @@ read_args() { | |||
59 | boot_live_root() { | 59 | boot_live_root() { |
60 | killall udevd 2>/dev/null | 60 | killall udevd 2>/dev/null |
61 | 61 | ||
62 | # use devtmpfs if available | 62 | # Move the mount points of some filesystems over to |
63 | if grep -q devtmpfs /proc/filesystems; then | 63 | # the corresponding directories under the real root filesystem. |
64 | mount -t devtmpfs devtmpfs $ROOT_MOUNT/dev | 64 | mount -n --move /proc ${ROOT_MOUNT}/proc |
65 | fi | 65 | mount -n --move /sys ${ROOT_MOUNT}/sys |
66 | mount -n --move /dev ${ROOT_MOUNT}/dev | ||
66 | 67 | ||
67 | cd $ROOT_MOUNT | 68 | cd $ROOT_MOUNT |
68 | exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init | 69 | exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init |