Skip to content

Commit

Permalink
Provide workaround for Debian bug #918590 with lvm + udev in VM insta…
Browse files Browse the repository at this point in the history
…llations

We need the /run/udev bind-mount to be present also when doing VM
installations for buster and newer, otherwise the installation
takes loooong due to the:

| WARNING: Device /dev/... not initialized in udev database even after waiting 10000000 microseconds

bug. As the /run/udev bind-mount is already gone we need
to resurrect before invoking update-grub in the VM installation.
  • Loading branch information
mika committed Dec 13, 2019
1 parent ef76531 commit 22cdc9f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions grml-debootstrap
Expand Up @@ -1515,6 +1515,15 @@ if [[ -z "${GRUB}" ]] || ! dd if="${GRUB}" bs=512 count=1 2>/dev/null | cat -v |
rm -f "${MNTPOINT}/tmp/core.img"
fi

# workaround for Debian bug #918590 with lvm + udev:
# WARNING: Device /dev/... not initialized in udev database even after waiting 10000000 microseconds
if [ -d /run/udev ] ; then
einfo "Setting up bind-mount /run/udev"
mkdir -p "${MNTPOINT}"/run/udev
mount --bind /run/udev "${MNTPOINT}"/run/udev
eend $?
fi

einfo "Updating grub configuration file."
chroot "${MNTPOINT}" update-grub

Expand All @@ -1534,6 +1543,14 @@ fi
sed -i "s;root=[^ ]\\+;root=UUID=$TARGET_UUID;" "${MNTPOINT}"/boot/grub/grub.cfg
fi

# workaround for Debian bug #918590 with lvm + udev:
# WARNING: Device /dev/... not initialized in udev database even after waiting 10000000 microseconds
if mountpoint "${MNTPOINT}"/run/udev &>/dev/null ; then
einfo "Unmounting bind-mount /run/udev"
umount "${MNTPOINT}"/run/udev
eend $?
fi

umount "${MNTPOINT}"/proc
umount "${MNTPOINT}"/sys
umount "${MNTPOINT}"/dev/pts
Expand Down

0 comments on commit 22cdc9f

Please sign in to comment.