All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: Tom Rini <trini@konsulko.com>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Simon Glass <sjg@chromium.org>
Subject: [u-boot-test-hooks PATCH 5/7] Update sdwire script to wait for umount
Date: Sat, 30 Oct 2021 12:25:37 -0600	[thread overview]
Message-ID: <20211030182539.1371361-5-sjg@chromium.org> (raw)
In-Reply-To: <20211030182539.1371361-1-sjg@chromium.org>

Sometimes the umount takes a while. Add the same wait loop as is used for
mount. Also rename the 'done' variable to 'complete' to void confusing it
with the end of the for loop.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 bin/flash.sdwire_common_mount | 28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/bin/flash.sdwire_common_mount b/bin/flash.sdwire_common_mount
index d696abb..6c763e6 100644
--- a/bin/flash.sdwire_common_mount
+++ b/bin/flash.sdwire_common_mount
@@ -25,10 +25,10 @@ mount_dir=/media/${mount_point}
 # Switch over to get USB card access
 sd-mux-ctrl --device-serial ${sdwire_serial} --ts
 
-done=false
+complete=false
 for i in {0..9}; do
     if out="$(mount UUID=${mount_uuid} 2>&1)"; then
-        done=true
+        complete=true
         break
     fi
     echo $out
@@ -41,7 +41,7 @@ for i in {0..9}; do
     fi
     sleep 1
 done
-if [[ $done = false ]]; then
+if [[ $complete = false ]]; then
     echo "Failed to mount UUID ${mount_uuid} after 10 tries"
     exit 1
 fi
@@ -53,7 +53,27 @@ if ! mountpoint -q ${mount_dir}; then
 fi
 
 writer.${flash_writer} ${mount_dir} ${U_BOOT_BUILD_DIR}
-umount ${mount_dir}
+
+complete=false
+for i in {0..9}; do
+    if out="$(umount ${mount_dir} 2>&1)"; then
+        complete=true
+        break
+    fi
+    echo $out
+    sleep 1
+done
+
+if [[ $complete = false ]]; then
+    echo "Failed to umount UUID ${mount_uuid} after 10 tries"
+    exit 1
+fi
+
+# Sanity check
+if mountpoint -q ${mount_dir}; then
+    echo "Mount ${mount_dir} still available after 'umount'"
+    exit 1
+fi
 
 # Back to card access for the DUT
 sd-mux-ctrl --device-serial ${sdwire_serial} --dut
-- 
2.33.1.1089.g2158813163f-goog


  parent reply	other threads:[~2021-10-30 18:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-30 18:25 [u-boot-test-hooks PATCH 1/7] travis-ci: Add qemu_arm_spl board Simon Glass
2021-10-30 18:25 ` [u-boot-test-hooks PATCH 2/7] sdwire: Tidy up the mount script Simon Glass
2021-11-11 17:37   ` Tom Rini
2021-10-30 18:25 ` [u-boot-test-hooks PATCH 3/7] rpi3: Tweak the grep pattern Simon Glass
2021-11-11 17:37   ` Tom Rini
2021-10-30 18:25 ` [u-boot-test-hooks PATCH 4/7] Add wait_raw_device for common code Simon Glass
2021-11-11 17:37   ` Tom Rini
2021-10-30 18:25 ` Simon Glass [this message]
2021-11-11 17:37   ` [u-boot-test-hooks PATCH 5/7] Update sdwire script to wait for umount Tom Rini
2021-10-30 18:25 ` [u-boot-test-hooks PATCH 6/7] kea: Add samus Simon Glass
2021-11-11 17:38   ` Tom Rini
2021-10-30 18:25 ` [u-boot-test-hooks PATCH 7/7] ellesmere: Add qemu rules Simon Glass
2021-10-31 16:57   ` Tom Rini
2021-10-31 18:22     ` Simon Glass
2021-10-31 19:15       ` Tom Rini
2021-11-03 15:23 ` [u-boot-test-hooks PATCH 1/7] travis-ci: Add qemu_arm_spl board Tuomas Tynkkynen
2021-11-11 17:37 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211030182539.1371361-5-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.