]> code.ossystems Code Review - openembedded-core.git/commitdiff
oe-core/init-install-testfs.sh: do not overwrite /etc/mtab if the link already exist
authorCristian Iorga <cristian.iorga@intel.com>
Fri, 20 Jun 2014 15:42:17 +0000 (18:42 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 23 Jun 2014 16:51:22 +0000 (17:51 +0100)
Overwriting of /etc/mtab would fail as below if the /etc/mtab link already
exist during installation phase, this patch fix this problem by checking
existance of the link before try to overwrite it.

Error message during installation if the /etc/mtab exists:
"cat: /proc/mounts: input file is output file"

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/initrdscripts/files/init-install-testfs.sh

index 6faa233c9f7b10b0fadb3e390a0e73919a787285..d2cc6ac534fc101ba4bb1b5b9b653a6db577dce2 100644 (file)
@@ -90,7 +90,9 @@ if [ ! -b /dev/loop0 ] ; then
 fi
 
 mkdir -p /tmp
-cat /proc/mounts > /etc/mtab
+if [ ! -L /etc/mtab ]; then
+       cat /proc/mounts > /etc/mtab
+fi
 
 disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")