Hi, On Mon, 05 Feb 2024 17:49:06 +0300 Michael Tokarev <m...@tls.msk.ru> wrote: > Currently, when installing other packages together with a new kernel, > initramfs image for the new kernel is generated two times: once it is > kernel-activated from /etc/kernel/postinst.d/initramfs-tools, and next it is > dpkg-trigger-activated by updating certain paths (eg installing or upgrading > busybox, mdadm, etc, which triggers initramfs rebuilds). > > This is especially annoying when building images for virtual machines > (like debvm-create etc), - there, initramfs is especially slow (it is > already very slow as it is, but makes several times slower when run > in emulated environment). The whole thing needs to be generated only > once, dpkg trigger should be enough, but it is actually generated > twice. > > For that I suggest to check in /etc/kernel/postinst.d/initramfs-tools > if dpkg trigger for it is pending already, and if yes, do not generate > the whole thing but create just a stub, an empty /boot/initrd.img-$kver, > to be updated later when dpkg trigger is fired. > > That will save a lot of time in various situations, including regular > user machines where initrd is often regenerated multiple times during > upgrades.
a duplicate of this bug seems to have been filed as #1079509 but it comes with a patch which was submitted as a merge request on salsa: https://salsa.debian.org/kernel-team/initramfs-tools/-/merge_requests/137 More discussion can be found there. Thanks! cheers, josch
signature.asc
Description: signature