@@ -1033,22 +1033,29 @@ if test -f \$stamp; then
exit 0
fi
>\$stamp
-logger -t osstest-erase-other-disks-\$\$ "Running..."
+
+log () {
+ logger -t osstest-erase-other-disks-\$\$ "\$\@"
+}
+
+log "Running..."
+
zero () {
if test -b \$dev; then
- logger -t osstest-erase-other-disks-\$\$ "Erasing \$dev"
+ log "Erasing \$dev"
dd if=/dev/zero of=\$dev count=64 ||:
if ! test -b \$dev; then
- logger -t osstest-erase-other-disks-\$\$ "\$dev is no longer a block device!"
+ log "\$dev is no longer a block device!"
exit 1
fi
else
- logger -t osstest-erase-other-disks-\$\$ "\$dev does not exist or is not a block device."
+ log "\$dev does not exist or is not a block device."
fi
}
udevadm settle
for sd in sd hd; do
+ log "\${sd} devices present before: `echo /dev/\${sd}*`"
for b in a b c d e f; do
dev=/dev/\${sd}\${b}
zero
@@ -1056,6 +1063,8 @@ for sd in sd hd; do
for dev in /dev/\${sd}a[0-9]; do
zero
done
+ udevadm settle
+ log "\${sd} devices present after: `echo /dev/\${sd}*`"
done
for dev in ${disk}*; do
zero
Writing it out each time is too verbose. At the same time log the set of devices present before and after each batch of erasing, with a udev settle before the second to ensure any changes to /dev have happened. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> --- Osstest/Debian.pm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)