xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH OSSTEST 3/3] Debian: erase-other-disks: rescan partition tables after erasing whole disk
Date: Wed, 20 Jan 2016 15:06:21 +0000	[thread overview]
Message-ID: <1453302381-28692-3-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1453302359.26343.133.camel@citrix.com>

This appears to happen anyway, but force it to be sure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Osstest/Debian.pm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 20f3de7..e7b5538 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -1053,6 +1053,14 @@ zero () {
     fi
 }
 
+rescan () {
+    if ! test -b \${dev}; then
+	return
+    fi
+    log "Rescaning partition table on \${dev}"
+    echo 1 > /sys/block/\${dev#/dev/}/device/rescan
+}
+
 udevadm settle
 for sd in sd hd; do
     log "\${sd} devices present before: `echo /dev/\${sd}*`"
@@ -1063,6 +1071,7 @@ for sd in sd hd; do
 
         dev=/dev/\${sd}\${b}
         zero
+        rescan
     done
     udevadm settle
     log "\${sd} devices present after: `echo /dev/\${sd}*`"
-- 
2.6.1

  parent reply	other threads:[~2016-01-20 15:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20 15:05 [PATCH OSSTEST 0/3] fixes to erase-other-disks d-i hook Ian Campbell
2016-01-20 15:06 ` [PATCH OSSTEST 1/3] Debian: erase-other-disks: add a log() helper Ian Campbell
2016-01-20 16:10   ` Ian Jackson
2016-01-20 15:06 ` [PATCH OSSTEST 2/3] Debian: erase-other-disks: erase partitions first Ian Campbell
2016-01-20 16:11   ` Ian Jackson
2016-01-20 15:06 ` Ian Campbell [this message]
2016-01-20 16:11   ` [PATCH OSSTEST 3/3] Debian: erase-other-disks: rescan partition tables after erasing whole disk Ian Jackson

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=1453302381-28692-3-git-send-email-ian.campbell@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).