All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-virtualization][scarthgap][PATCH] libvirt: set USERADD_DEPENDS to avoid package_write_rpm failure
@ 2024-11-08  2:55 Qi.Chen
  0 siblings, 0 replies; 3+ messages in thread
From: Qi.Chen @ 2024-11-08  2:55 UTC (permalink / raw)
  To: meta-virtualization

From: Chen Qi <Qi.Chen@windriver.com>

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.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 recipes-extended/libvirt/libvirt_10.0.0.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/recipes-extended/libvirt/libvirt_10.0.0.bb b/recipes-extended/libvirt/libvirt_10.0.0.bb
index a33b6980..22193ff3 100644
--- a/recipes-extended/libvirt/libvirt_10.0.0.bb
+++ b/recipes-extended/libvirt/libvirt_10.0.0.bb
@@ -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"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [meta-virtualization][scarthgap][PATCH] libvirt: set USERADD_DEPENDS to avoid package_write_rpm failure
       [not found] <1805DEC3FAC3F34F.28149@lists.yoctoproject.org>
@ 2024-11-08  2:59 ` ChenQi
  2024-11-12 23:22   ` Bruce Ashfield
  0 siblings, 1 reply; 3+ messages in thread
From: ChenQi @ 2024-11-08  2:59 UTC (permalink / raw)
  To: meta-virtualization

I didn't sent this patch for master branch because master branch has 
changed the polkit part and there's no chown there.
So this patch is only suitable for scarthgap.

Regards,
Qi

On 11/8/24 10:55, Chen Qi via lists.yoctoproject.org wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> 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.
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>   recipes-extended/libvirt/libvirt_10.0.0.bb | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/recipes-extended/libvirt/libvirt_10.0.0.bb b/recipes-extended/libvirt/libvirt_10.0.0.bb
> index a33b6980..22193ff3 100644
> --- a/recipes-extended/libvirt/libvirt_10.0.0.bb
> +++ b/recipes-extended/libvirt/libvirt_10.0.0.bb
> @@ -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"
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#8960): https://lists.yoctoproject.org/g/meta-virtualization/message/8960
> Mute This Topic: https://lists.yoctoproject.org/mt/109457527/3618072
> Group Owner: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [Qi.Chen@windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [meta-virtualization][scarthgap][PATCH] libvirt: set USERADD_DEPENDS to avoid package_write_rpm failure
  2024-11-08  2:59 ` [meta-virtualization][scarthgap][PATCH] libvirt: set USERADD_DEPENDS to avoid package_write_rpm failure ChenQi
@ 2024-11-12 23:22   ` Bruce Ashfield
  0 siblings, 0 replies; 3+ messages in thread
From: Bruce Ashfield @ 2024-11-12 23:22 UTC (permalink / raw)
  To: Qi.Chen; +Cc: meta-virtualization



In message: Re: [meta-virtualization][scarthgap][PATCH] libvirt: set USERADD_DEPENDS to avoid package_write_rpm failure
on 08/11/2024 Chen Qi via lists.yoctoproject.org wrote:

> I didn't sent this patch for master branch because master branch has changed
> the polkit part and there's no chown there.
> So this patch is only suitable for scarthgap.

I was wondering just that! thanks for the explanation, this is now merged.

Bruce

> 
> Regards,
> Qi
> 
> On 11/8/24 10:55, Chen Qi via lists.yoctoproject.org wrote:
> > From: Chen Qi <Qi.Chen@windriver.com>
> > 
> > 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.
> > 
> > Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> > ---
> >   recipes-extended/libvirt/libvirt_10.0.0.bb | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/recipes-extended/libvirt/libvirt_10.0.0.bb b/recipes-extended/libvirt/libvirt_10.0.0.bb
> > index a33b6980..22193ff3 100644
> > --- a/recipes-extended/libvirt/libvirt_10.0.0.bb
> > +++ b/recipes-extended/libvirt/libvirt_10.0.0.bb
> > @@ -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"
> > 
> > 
> > 
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#8961): https://lists.yoctoproject.org/g/meta-virtualization/message/8961
> Mute This Topic: https://lists.yoctoproject.org/mt/109457527/1050810
> Group Owner: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-12 23:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1805DEC3FAC3F34F.28149@lists.yoctoproject.org>
2024-11-08  2:59 ` [meta-virtualization][scarthgap][PATCH] libvirt: set USERADD_DEPENDS to avoid package_write_rpm failure ChenQi
2024-11-12 23:22   ` Bruce Ashfield
2024-11-08  2:55 Qi.Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.