From: Michael Prokop Date: Fri, 18 Jan 2019 12:54:47 +0000 (+0100) Subject: Bind-mount /run/udev in target system as workaround for lvm2 issue #918590 X-Git-Tag: v0.86~1 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=430abb16315fef4bfc5f7b129b452c26ffb9b6ae Bind-mount /run/udev in target system as workaround for lvm2 issue #918590 Installation takes ages with lvm 2.03.02-1 if /run/udev isn't available in the target system, causing messages like: | WARNING: Device /dev/[...] not initialized in udev database even after waiting 10000000 microseconds. Especially when grub package gets installed (which invokes vgs and related tools) this takes forever and looks like a failing installation. This /run/udev bind-mount is a workaround required for Debian/buster's lvm2, at least until #918590 is resolved. --- diff --git a/grml-debootstrap b/grml-debootstrap index accef96..945b859 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -266,7 +266,7 @@ cleanup() { # ugly, but make sure we really don't leave anything (/proc /proc and # /dev /dev are intended, trying to work around timing issues, see #657023) - for ARG in /sys /proc /proc /dev/pts /dev/pts /dev /dev ; do + for ARG in /run/udev /sys /proc /proc /dev/pts /dev/pts /dev /dev ; do [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount $ARG >/dev/null 2>&1 umount "$MNTPOINT"/$ARG >/dev/null 2>&1 done @@ -1742,6 +1742,13 @@ iface eth0 inet dhcp cp /etc/network/interfaces.examples "$MNTPOINT/etc/network/interfaces.examples" fi + 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 + eend 0 } # }}} @@ -1866,6 +1873,12 @@ umount_chroot() { fi if grep -q "$MNTPOINT" /proc/mounts ; then + if mountpoint "${MNTPOINT}"/run/udev &>/dev/null ; then + einfo "Unmounting bind-mount /run/udev" + umount "${MNTPOINT}"/run/udev + eend $? + fi + if [ -n "$PARTITION" ] ; then einfo "Unmount $MNTPOINT" umount "$MNTPOINT"