Skip to contentSkip to conversation

libvirt: set USERADD_DEPENDS to avoid package_write_rpm failure

PATCH New [email protected] 1 participant 1 message Nov 8, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libvirt: set USERADD_DEPENDS to avoid package_write_rpm failure

From: Chen Qi <[email protected]>

When do_package uses state cache and is not re-run but do_package_write_rpm is re-run, then we get the following error:

Exception: KeyError: 'getpwuid(): uid not found: 996'

This is because libvirt does chown to polkitd in do_install and polkitd is from polkit.

Here's an easy way to reproduce this issue:

  bitbake libvirt -c cleansstate && bitbake libvirt -c package && \
  bitbake libvirt -c clean && bitbake libvirt -c package_write_rpm

So make use of USERADD_DEPENDS to ensure polkitd exists to fix this issue.

---
 recipes-extended/libvirt/libvirt_10.0.0.bb | 2 ++
 1 file changed, 2 insertions(+)
recipes-extended/libvirt/libvirt_10.0.0.bb +2 -0
index a33b6980..22193ff3 100644
@@ -11,6 +11,8 @@ DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux
 	   ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'shadow-native', '', d)} \
 	   ${@bb.utils.contains('PACKAGECONFIG', 'gnutls', 'gnutls-native', '', d)}"
 
+USERADD_DEPENDS = "${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'polkit', '', d)}"
+
 # libvirt-guests.sh needs gettext.sh
 #
 RDEPENDS:${PN} = "gettext-runtime"
Signature · 1 line
2.25.1