[oe-commits] Michael Lippautz : omap3-mkcard.sh: Adding sleep and umounts to fix race cond.

git version control git at git.openembedded.org
Thu Apr 8 13:36:06 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 6360c49be656de4a169f69711292b1ea8970e265
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=6360c49be656de4a169f69711292b1ea8970e265

Author: Michael Lippautz <michael.lippautz at gmail.com>
Date:   Thu Apr  8 14:44:15 2010 +0200

omap3-mkcard.sh: Adding sleep and umounts to fix race cond.

* Adds sleep to wait for blocknodes in /dev
* Adds unmounts to fix possible automounts

Signed-off-by: Michael Lippautz <michael.lippautz at gmail.com>

---

 contrib/angstrom/omap3-mkcard.sh |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/contrib/angstrom/omap3-mkcard.sh b/contrib/angstrom/omap3-mkcard.sh
index d8b5b43..1cf6817 100755
--- a/contrib/angstrom/omap3-mkcard.sh
+++ b/contrib/angstrom/omap3-mkcard.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# mkcard.sh v0.4
+# mkcard.sh v0.5
 # (c) Copyright 2009 Graeme Gregory <dp at xora.org.uk>
 # Licensed under terms of GPLv2
 #
@@ -30,10 +30,14 @@ echo ,9,0x0C,*
 echo ,,,-
 } | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
 
+sleep 1
+
 if [ -b ${DRIVE}1 ]; then
+	umount ${DRIVE}1
 	mkfs.vfat -F 32 -n "boot" ${DRIVE}1
 else
 	if [ -b ${DRIVE}p1 ]; then
+		umount ${DRIVE}p1
 		mkfs.vfat -F 32 -n "boot" ${DRIVE}p1
 	else
 		echo "Cant find boot partition in /dev"
@@ -41,9 +45,11 @@ else
 fi
 
 if [ -b ${DRIVE}2 ]; then
+	umount ${DRIVE}2
 	mke2fs -j -L "rootfs" ${DRIVE}2
 else
 	if [ -b ${DRIVE}p2 ]; then
+		umount ${DRIVE}p2
 		mke2fs -j -L "rootfs" ${DRIVE}p2
 	else
 		echo "Cant find rootfs partition in /dev"





More information about the Openembedded-commits mailing list