app-emulation/libvirt: create /var/lib/libvirt/secrets via tmpfiles

libvirt 12.1.0 introduces virt-secret-init-encryption.service which generates
a host-specific key used to encrypt libvirt secrets. The service writes
the key to /var/lib/libvirt/secrets/secrets-encryption-key.

Since in the ebuild we are doing rm -fr ${D}/var during src_install and
relying on tmpfiles to recreate required directories an entry in the
tmpfiles is needed with correct permission for the creation of the
secrets folder.

Please note that this only affects systemd based systems as the
virt-secret-init-encryption.service is never used in OpenRC. On systemd
without the secrets folder, virt-secret-init-encryption.service fails
wich inturn blocks libvirtd.service from starting.

Closes: https://bugs.gentoo.org/970956
Signed-off-by: Brahmajit Das <listout@listout.xyz>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/231
Merges: https://codeberg.org/gentoo/gentoo/pulls/231
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Brahmajit Das
2026-03-08 02:09:54 +00:00
committed by Sam James
parent 8a24b485f1
commit db8e4d5bdd
2 changed files with 1 additions and 0 deletions
@@ -1 +1,2 @@
d /run/libvirt/lxc 0755 root root -
d /var/lib/libvirt/secrets 0700 root root -