]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oe-core/init-install.sh: do not overwrite /etc/mtab if the link already exist
authorShan Hai <shan.hai@windriver.com>
Thu, 5 Jun 2014 02:18:49 +0000 (10:18 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 10 Jun 2014 16:23:57 +0000 (17:23 +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: Shan Hai <shan.hai@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/recipes-core/initrdscripts/files/init-install.sh

index f84a5eb83b66077c541c3d89bbf10737908169fd..0a1141a6f5d35110b1d5618221171372817d4d6f 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//")