All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] update_gio_module_cache: Do not chown a non-existing file
@ 2017-03-29 23:16 Peter Kjellerstedt
  2017-03-30  9:29 ` Alexander Kanavin
  2017-03-30  9:38 ` Alexander Kanavin
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Kjellerstedt @ 2017-03-29 23:16 UTC (permalink / raw)
  To: openembedded-core

Only change the ownership of ${libdir}/gio/modules/giomodule.cache if
it exists.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 scripts/postinst-intercepts/update_gio_module_cache | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/postinst-intercepts/update_gio_module_cache b/scripts/postinst-intercepts/update_gio_module_cache
index 92092f2144..fc3f9d0d6c 100644
--- a/scripts/postinst-intercepts/update_gio_module_cache
+++ b/scripts/postinst-intercepts/update_gio_module_cache
@@ -3,7 +3,7 @@
 set -e
 
 PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
-        $D${libexecdir}/${binprefix}gio-querymodules $D${libdir}/gio/modules/
-
-chown root:root $D${libdir}/gio/modules/giomodule.cache
+	$D${libexecdir}/${binprefix}gio-querymodules $D${libdir}/gio/modules/
 
+[ ! -e $D${libdir}/gio/modules/giomodule.cache ] ||
+	chown root:root $D${libdir}/gio/modules/giomodule.cache
-- 
2.12.0



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

* Re: [PATCH] update_gio_module_cache: Do not chown a non-existing file
  2017-03-29 23:16 [PATCH] update_gio_module_cache: Do not chown a non-existing file Peter Kjellerstedt
@ 2017-03-30  9:29 ` Alexander Kanavin
  2017-03-30  9:31   ` Richard Purdie
  2017-03-30  9:38 ` Alexander Kanavin
  1 sibling, 1 reply; 6+ messages in thread
From: Alexander Kanavin @ 2017-03-30  9:29 UTC (permalink / raw)
  To: openembedded-core

On 03/30/2017 02:16 AM, Peter Kjellerstedt wrote:
> Only change the ownership of ${libdir}/gio/modules/giomodule.cache if
> it exists.

Why do we need to change the owndership in the first place?

Alex



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

* Re: [PATCH] update_gio_module_cache: Do not chown a non-existing file
  2017-03-30  9:29 ` Alexander Kanavin
@ 2017-03-30  9:31   ` Richard Purdie
  2017-03-30  9:34     ` Alexander Kanavin
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2017-03-30  9:31 UTC (permalink / raw)
  To: Alexander Kanavin, openembedded-core

On Thu, 2017-03-30 at 12:29 +0300, Alexander Kanavin wrote:
> On 03/30/2017 02:16 AM, Peter Kjellerstedt wrote:
> > 
> > Only change the ownership of ${libdir}/gio/modules/giomodule.cache
> > if
> > it exists.
> Why do we need to change the owndership in the first place?

The qemu call in the line above is made under PSEUDO_UNLOAD, see the
original patch from Chris.

Cheers,

Richard



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

* Re: [PATCH] update_gio_module_cache: Do not chown a non-existing file
  2017-03-30  9:31   ` Richard Purdie
@ 2017-03-30  9:34     ` Alexander Kanavin
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Kanavin @ 2017-03-30  9:34 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

On 03/30/2017 12:31 PM, Richard Purdie wrote:
>>> Only change the ownership of ${libdir}/gio/modules/giomodule.cache
>>> if
>>> it exists.
>> Why do we need to change the owndership in the first place?
>
> The qemu call in the line above is made under PSEUDO_UNLOAD, see the
> original patch from Chris.

With this change, if the qemu call fails (which it is allowed to), will 
the entire script fail, and be deferred to first boot as it should?

Alex



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

* Re: [PATCH] update_gio_module_cache: Do not chown a non-existing file
  2017-03-29 23:16 [PATCH] update_gio_module_cache: Do not chown a non-existing file Peter Kjellerstedt
  2017-03-30  9:29 ` Alexander Kanavin
@ 2017-03-30  9:38 ` Alexander Kanavin
  2017-03-30 10:53   ` Peter Kjellerstedt
  1 sibling, 1 reply; 6+ messages in thread
From: Alexander Kanavin @ 2017-03-30  9:38 UTC (permalink / raw)
  To: openembedded-core

On 03/30/2017 02:16 AM, Peter Kjellerstedt wrote:
> Only change the ownership of ${libdir}/gio/modules/giomodule.cache if
> it exists.
>
> Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> ---
>  scripts/postinst-intercepts/update_gio_module_cache | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/postinst-intercepts/update_gio_module_cache b/scripts/postinst-intercepts/update_gio_module_cache
> index 92092f2144..fc3f9d0d6c 100644
> --- a/scripts/postinst-intercepts/update_gio_module_cache
> +++ b/scripts/postinst-intercepts/update_gio_module_cache
> @@ -3,7 +3,7 @@
>  set -e
>
>  PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
> -        $D${libexecdir}/${binprefix}gio-querymodules $D${libdir}/gio/modules/
> -
> -chown root:root $D${libdir}/gio/modules/giomodule.cache
> +	$D${libexecdir}/${binprefix}gio-querymodules $D${libdir}/gio/modules/
>
> +[ ! -e $D${libdir}/gio/modules/giomodule.cache ] ||
> +	chown root:root $D${libdir}/gio/modules/giomodule.cache
>

Nope. The postinst-intercept scirpts are allowed to fail, and if they 
are, they are deferred to first boot. If giomodule.cache file does not 
exist, that means that qemu does not work for the target machine, which 
is not a bug, and is handled by detecting script failure and taking the 
same action at first boot time - which your change breaks.

Alex


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

* Re: [PATCH] update_gio_module_cache: Do not chown a non-existing file
  2017-03-30  9:38 ` Alexander Kanavin
@ 2017-03-30 10:53   ` Peter Kjellerstedt
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Kjellerstedt @ 2017-03-30 10:53 UTC (permalink / raw)
  To: Alexander Kanavin, openembedded-core

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Alexander Kanavin
> Sent: den 30 mars 2017 11:39
> To: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] update_gio_module_cache: Do not chown a
> non-existing file
> 
> On 03/30/2017 02:16 AM, Peter Kjellerstedt wrote:
> > Only change the ownership of ${libdir}/gio/modules/giomodule.cache if
> > it exists.
> >
> > Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> > ---
> >  scripts/postinst-intercepts/update_gio_module_cache | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/scripts/postinst-intercepts/update_gio_module_cache
> b/scripts/postinst-intercepts/update_gio_module_cache
> > index 92092f2144..fc3f9d0d6c 100644
> > --- a/scripts/postinst-intercepts/update_gio_module_cache
> > +++ b/scripts/postinst-intercepts/update_gio_module_cache
> > @@ -3,7 +3,7 @@
> >  set -e
> >
> >  PSEUDO_UNLOAD=1 qemuwrapper -L $D -E
> LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
> > -        $D${libexecdir}/${binprefix}gio-querymodules
> $D${libdir}/gio/modules/
> > -
> > -chown root:root $D${libdir}/gio/modules/giomodule.cache
> > +	$D${libexecdir}/${binprefix}gio-querymodules
> $D${libdir}/gio/modules/
> >
> > +[ ! -e $D${libdir}/gio/modules/giomodule.cache ] ||
> > +	chown root:root $D${libdir}/gio/modules/giomodule.cache
> >
> 
> Nope. The postinst-intercept scirpts are allowed to fail, and if they
> are, they are deferred to first boot. If giomodule.cache file does not
> exist, that means that qemu does not work for the target machine, which
> is not a bug, and is handled by detecting script failure and taking the
> same action at first boot time - which your change breaks.
> 
> Alex

No, the script will still fail if running gio-querymodules fails since 
`set -e` is in effect. But it will no longer fail if gio-querymodules 
succeeds without producing a cache file, which is the case for us.

I do not know under what circumstances gio-querymodules will or will 
not produce a cache file, but I have tried running it on our target 
and it does not produce a cache file there either, so I assume the 
build time job is doing the right thing in not creating a file.

//Peter



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

end of thread, other threads:[~2017-03-30 10:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-29 23:16 [PATCH] update_gio_module_cache: Do not chown a non-existing file Peter Kjellerstedt
2017-03-30  9:29 ` Alexander Kanavin
2017-03-30  9:31   ` Richard Purdie
2017-03-30  9:34     ` Alexander Kanavin
2017-03-30  9:38 ` Alexander Kanavin
2017-03-30 10:53   ` Peter Kjellerstedt

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.