]> code.ossystems Code Review - openembedded-core.git/commitdiff
init-install-efi.sh: Avoid /mnt/mtab creation if already present
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Mon, 3 Aug 2015 15:01:04 +0000 (15:01 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 15 Sep 2015 16:49:22 +0000 (17:49 +0100)
The base-files recipe installs /mnt/mtab (it is a softlink of /proc/mounts),
so if an image includes the latter, there is no new to created it again inside
the install-efi.sh script, otherwise an error may occur as indicated on the
bug's site.

[YOCTO #7971]

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/initrdscripts/files/init-install-efi.sh

index a3ed74b989336b1f4807df7a70a18769d1e51380..fc4908ef9138af969a95cb75b7bebe978d59af06 100644 (file)
@@ -114,7 +114,11 @@ rm -f /etc/udev/scripts/mount*
 umount ${device}* 2> /dev/null || /bin/true
 
 mkdir -p /tmp
-cat /proc/mounts > /etc/mtab
+
+# Create /etc/mtab if not present
+if [ ! -e /etc/mtab ]; then
+    cat /proc/mounts > /etc/mtab
+fi
 
 disk_size=$(parted ${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")