aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts/files/init-install.sh
diff options
context:
space:
mode:
authorAwais Belal <awais_belal@mentor.com>2016-08-01 16:31:43 +0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-17 10:33:29 +0100
commit9f9240d175acee274c04242fd5781094b3f5491b (patch)
tree468344656946d411419611cf7856e53ecdc4e6a3 /meta/recipes-core/initrdscripts/files/init-install.sh
parent769fae0b74d7c7992aa593907f446fab98ef5128 (diff)
downloadopenembedded-core-contrib-9f9240d175acee274c04242fd5781094b3f5491b.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. Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-core/initrdscripts/files/init-install.sh')
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install.sh4
1 files changed, 2 insertions, 2 deletions
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
fi
mkdir -p /tmp
-if [ ! -L /etc/mtab ]; then
- cat /proc/mounts > /etc/mtab
+if [ ! -L /etc/mtab ] && [ -e /proc/mounts ]; then
+ ln -sf /proc/mounts /etc/mtab
fi
disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//")