fix VM autostart race condition
https://github.com/QubesOS/qubes-issues/issues/1075
This commit is contained in:
parent
39379364c7
commit
472ed54e4c
@ -27,8 +27,11 @@ sfdisk --no-reread -u M "$FILENAME" > /dev/null 2> /dev/null <<EOF
|
|||||||
,${ROOT_SIZE},L
|
,${ROOT_SIZE},L
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
(
|
||||||
|
flock 200
|
||||||
loopdev=`losetup -f --show --partscan "$FILENAME"`
|
loopdev=`losetup -f --show --partscan "$FILENAME"`
|
||||||
udevadm settle
|
udevadm settle
|
||||||
mkswap -f ${loopdev}p1 > /dev/null
|
mkswap -f ${loopdev}p1 > /dev/null
|
||||||
losetup -d ${loopdev} || :
|
losetup -d ${loopdev} || :
|
||||||
chown --reference `dirname "$FILENAME"` "$FILENAME"
|
chown --reference `dirname "$FILENAME"` "$FILENAME"
|
||||||
|
) 200>"/var/run/qubes/prepare-volatile-img.lock"
|
||||||
|
Loading…
Reference in New Issue
Block a user