[oe-commits] Cristian Iorga : oe-core/init-install-testfs.sh: do not overwrite /etc/ mtab if the link already exist

git at git.openembedded.org git at git.openembedded.org
Tue Jun 24 10:06:04 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: 5cd96e28825d345650be878d4b7be4fea2996839
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=5cd96e28825d345650be878d4b7be4fea2996839

Author: Cristian Iorga <cristian.iorga at intel.com>
Date:   Fri Jun 20 18:42:17 2014 +0300

oe-core/init-install-testfs.sh: do not overwrite /etc/mtab if the link already exist

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 at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/recipes-core/initrdscripts/files/init-install-testfs.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-install-testfs.sh b/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
index 6faa233..d2cc6ac 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
@@ -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//")
 



More information about the Openembedded-commits mailing list