Skip to content

Commit

Permalink
re-arranged the if block around udevadm control --stop-exec-queue for…
Browse files Browse the repository at this point in the history
… issue #508; this was introduced by issue #480 and #490 (pull request)

I believe the fix is not yet final as on fedora21 beta it still exits with an error code 2 (not sure why as I cannot see anything wrong)
  • Loading branch information
gdha committed Nov 12, 2014
1 parent 0190aaf commit 871bd72
Showing 1 changed file with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,18 @@ create_disk() {
StopIfError "Disk $disk has size $disk_size, unable to continue."

cat >> "$LAYOUT_CODE" <<EOF
Log "Stop mdadm and pause udev"
if [ -d "/dev/md" ] && ls /dev/md?* &>/dev/null; then
Log "Stop mdadm and pause udev"
mdadm --stop /dev/md?* >&2
type -p udevadm >/dev/null
if [ $? -eq 0 ]; then
udevadm control --stop-exec-queue
else
udevcontrol stop_exec_queue
fi
fi
type -p udevadm >/dev/null && udevadm control --stop-exec-queue || udevcontrol stop_exec_queue
Log "Erasing MBR of disk $disk"
dd if=/dev/zero of=$disk bs=512 count=1
sync
Expand All @@ -57,8 +64,16 @@ EOF
create_partitions "$disk" "$label"

cat >> "$LAYOUT_CODE" <<EOF
Log "Resume udev"
type -p udevadm >/dev/null && udevadm control --start-exec-queue || udevcontrol start_exec_queue
if [ -d "/dev/md" ] && ls /dev/md?* &>/dev/null; then
Log "Resume udev"
type -p udevadm >/dev/null
if [ $? -eq 0 ]; then
udevadm control --stop-exec-queue
else
udevcontrol stop_exec_queue
fi
fi
# Wait some time before advancing
sleep 10
Expand Down

0 comments on commit 871bd72

Please sign in to comment.