dracut: fix checking for "Root filesystem" label, improve udev sync

Don't try to dereference "Root filesytem" partlabel symlink, unless it's
really present (not only directory for it).

Also, use udevadm settle for waiting for /dev/xvda, instead of naive
wait sleep loop.
This commit is contained in:
Marek Marczykowski-Górecki 2019-01-21 02:06:39 +01:00
parent 456fe99fa6
commit 5eb526da4b
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -53,12 +53,12 @@ fi
modprobe xenblk || modprobe xen-blkfront || warn "Qubes: Cannot load Xen Block Frontend..." modprobe xenblk || modprobe xen-blkfront || warn "Qubes: Cannot load Xen Block Frontend..."
log_begin "Waiting for /dev/xvda* devices..." log_begin "Waiting for /dev/xvda* devices..."
while ! [ -e /dev/xvda ]; do sleep 0.1; done udevadm settle --exit-if-exists=/dev/xvda
log_end log_end
# prefer partition if exists # prefer partition if exists
if [ -b /dev/xvda1 ]; then if [ -b /dev/xvda1 ]; then
if [ -d /dev/disk/by-partlabel ]; then if [ -e "/dev/disk/by-partlabel/Root\\x20filesystem" ]; then
ROOT_DEV=$(basename $(readlink "/dev/disk/by-partlabel/Root\\x20filesystem")) ROOT_DEV=$(basename $(readlink "/dev/disk/by-partlabel/Root\\x20filesystem"))
else else
ROOT_DEV=xvda3 ROOT_DEV=xvda3