diff options
author | Awais Belal <awais_belal@mentor.com> | 2016-08-01 16:31:43 +0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-17 10:35:41 +0100 |
commit | 92f505b0162f666b14208e2835c7def9f2cd4f2c (patch) | |
tree | fe76519105e93595ac44b9f1988ae0a221268288 | |
parent | caaff71f97ff7595d256d6b63f3400eee90f3a7b (diff) | |
download | poky-92f505b0162f666b14208e2835c7def9f2cd4f2c.tar.gz |
init-install*: /etc/mtab make a link rather than a copy
Using a copy would only make management of devices erroneous
and makes the system unstable in some scenarios as tools will
have to manipulate both files separately. A link ensures that
both files /proc/mounts and /etc/mtab will have the same
information at all times and this is how it is handled
on newer systems where there is such a need. Same is
suggested by busybox.
(From OE-Core rev: 9f9240d175acee274c04242fd5781094b3f5491b)
Signed-off-by: Awais Belal <awais_belal@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/initrdscripts/files/init-install-efi.sh | 4 | ||||
-rw-r--r-- | meta/recipes-core/initrdscripts/files/init-install.sh | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh index 3134486aae..2d20a6dad7 100644 --- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh +++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh | |||
@@ -128,8 +128,8 @@ umount ${device}* 2> /dev/null || /bin/true | |||
128 | mkdir -p /tmp | 128 | mkdir -p /tmp |
129 | 129 | ||
130 | # Create /etc/mtab if not present | 130 | # Create /etc/mtab if not present |
131 | if [ ! -e /etc/mtab ]; then | 131 | if [ ! -e /etc/mtab ] && [ -e /proc/mounts ]; then |
132 | cat /proc/mounts > /etc/mtab | 132 | ln -sf /proc/mounts /etc/mtab |
133 | fi | 133 | fi |
134 | 134 | ||
135 | disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//") | 135 | disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//") |
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh index 0542e26fd2..89d5a5d9a4 100644 --- a/meta/recipes-core/initrdscripts/files/init-install.sh +++ b/meta/recipes-core/initrdscripts/files/init-install.sh | |||
@@ -124,8 +124,8 @@ if [ ! -b /dev/loop0 ] ; then | |||
124 | fi | 124 | fi |
125 | 125 | ||
126 | mkdir -p /tmp | 126 | mkdir -p /tmp |
127 | if [ ! -L /etc/mtab ]; then | 127 | if [ ! -L /etc/mtab ] && [ -e /proc/mounts ]; then |
128 | cat /proc/mounts > /etc/mtab | 128 | ln -sf /proc/mounts /etc/mtab |
129 | fi | 129 | fi |
130 | 130 | ||
131 | disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//") | 131 | disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//") |