From: Michael Prokop Date: Fri, 13 Dec 2019 11:13:49 +0000 (+0100) Subject: Provide workaround for Debian bug #918590 with lvm + udev in VM installations X-Git-Tag: v0.91~4 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=22cdc9fc66a89cb73b7d279849b19941bdd1ae24 Provide workaround for Debian bug #918590 with lvm + udev in VM installations 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. --- diff --git a/grml-debootstrap b/grml-debootstrap index 103946c..6f9743c 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -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 @@ -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