Add a call to "udevadm settle" in write_image.sh

After GPT and MBR are destroyed systemd-udevd gets triggered
which may hold /dev/sda open preventing qemu-img from writting
its image.

Story: 2008830
Task: 42312
Change-Id: I6105192a16fcb7f6898910e8d0ab824d731d491d
(cherry picked from commit 9c3fbfd000)
This commit is contained in:
Derek Higgins 2021-04-20 17:13:18 +01:00 committed by Dmitry Tantsur
parent b3f489caf3
commit bc13adfa49
2 changed files with 8 additions and 0 deletions

View File

@ -43,6 +43,7 @@ DEVICE_SECTORS_COUNT=`blockdev --getsz $DEVICE`
dd bs=512 if=/dev/zero of=$DEVICE count=33
dd bs=512 if=/dev/zero of=$DEVICE count=33 seek=$((${DEVICE_SECTORS_COUNT} - 33))
sgdisk -Z $DEVICE
udevadm settle
log "Imaging $IMAGEFILE to $DEVICE"

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Adds a call to "udevadm settle" in write_image.sh.
After GPT and MBR are destroyed systemd-udevd gets triggered
which may hold /dev/sda open preventing qemu-img from writting
its image.