Skip to contentSkip to conversation

V2 [PATCH 0/1] overwrite /etc/mtab conditionally

PATCH New Shan Hai 1 participant 2 messages Jun 5, 2014

lore
Share & tools
lore

Shan Hai

author
#0 lore raw

Please ignore the previous patch, there is an error in the commit log.

The installation fails with message "cat: /proc/mounts input file is output file", the root cause is a failure of overwriting existing symbol link in installer script.

Fix it by conditionally overwrit of the link.

author
#1 lore raw

PATCH 1/1 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

---
 .../initrdscripts/files/init-install.sh            |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
meta/recipes-core/initrdscripts/files/init-install.sh +3 -1
index 0ede928..d7d3439 100644
@@ -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//")
 
Signature · 1 line
1.7.0.5