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

git at git.openembedded.org git at git.openembedded.org
Tue Jun 10 16:44:21 UTC 2014


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

Author: Shan Hai <shan.hai at windriver.com>
Date:   Thu Jun  5 10:18:49 2014 +0800

oe-core/init-install.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: Shan Hai <shan.hai at windriver.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>

---

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

diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index f84a5eb..0a1141a 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.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