Open elboulangero opened 5 years ago
Another symptom of that is grub-mkconfig
being super slow with lines like:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.19.0-1-amd64
Found initrd image: /boot/initrd.img-4.19.0-1-amd64
WARNING: Device /dev/vda not initialized in udev database even after waiting 10000000 microseconds.
WARNING: Device /dev/vda1 not initialized in udev database even after waiting 10000000 microseconds.
WARNING: Device /dev/vda2 not initialized in udev database even after waiting 10000000 microseconds.
WARNING: Device /dev/vda3 not initialized in udev database even after waiting 10000000 microseconds.
WARNING: Device /dev/vda4 not initialized in udev database even after waiting 10000000 microseconds.
WARNING: Device /dev/vda5 not initialized in udev database even after waiting 10000000 microseconds.
WARNING: Device /dev/vda6 not initialized in udev database even after waiting 10000000 microseconds.
FWIW, comparing with what other tools do, arch-chroot
bind-mounts /run
: https://git.archlinux.org/arch-install-scripts.git/tree/common#n80
I need to run this command as part of a recipe:
lsblk -nlp -o NAME,PARTTYPE
. In order to query the parttype, lsblk relies on udev.However, udev is not really functional within a systemd-nspawn container. Which is kind of expected, according to this discussion: https://lists.freedesktop.org/archives/systemd-devel/2013-July/012347.html
As a consequence, lsblk cannot display the parttype if it's run from within a container (ie. debos run action with
chroot: true
).I found a workaround though: I can add
--bind /run/udev
to the systemd-nspawn command, which is enough to at least query udev, and get lsblk to work as I expect.Could we add that to debos systemd-nspawn call? Or does that sound silly?
Here's a quick recipe to illustrate this issue:
And here's the relevant part of debos output:
And some more debug lines that you can easily reproduce from the debos debug shell:
systemd-nspawn
as it's run by debos: lsblk can't display the parttype.--bind /run/udev
solves the issue.