* postinst questions (was postinst does not finish)
@ 2013-04-24 12:04 Andreas Müller
2013-04-24 12:36 ` Martin Jansa
2013-04-24 13:21 ` Paul Eggleton
0 siblings, 2 replies; 5+ messages in thread
From: Andreas Müller @ 2013-04-24 12:04 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Hi
as written before: an 'exit 1' within recipe's postinst causes
trouble. E.g meta-oe's lxdm does not run systemd.bbclass' code which
leaves lxdm in unprepared condition causing start too early and ending
in unfinished postinstall.
A simple workaround for this (we should think of something else later)
would be to prepend postinst code within systemd.bbclass (and maybe
others too) instead of appending. Hereby we ensure that the code is
executed independent of recipe's code. First question: Any objections?
In case of no objections: Second question: Is shebang in
post/pre/install/remove scripts (I saw many scripts without shebang)?
Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: postinst questions (was postinst does not finish)
2013-04-24 12:04 postinst questions (was postinst does not finish) Andreas Müller
@ 2013-04-24 12:36 ` Martin Jansa
2013-04-24 13:03 ` Andreas Müller
2013-04-24 13:21 ` Paul Eggleton
1 sibling, 1 reply; 5+ messages in thread
From: Martin Jansa @ 2013-04-24 12:36 UTC (permalink / raw)
To: Andreas Müller; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 1725 bytes --]
On Wed, Apr 24, 2013 at 02:04:39PM +0200, Andreas Müller wrote:
> Hi
>
> as written before: an 'exit 1' within recipe's postinst causes
> trouble. E.g meta-oe's lxdm does not run systemd.bbclass' code which
> leaves lxdm in unprepared condition causing start too early and ending
> in unfinished postinstall.
>
> A simple workaround for this (we should think of something else later)
> would be to prepend postinst code within systemd.bbclass (and maybe
> others too) instead of appending. Hereby we ensure that the code is
> executed independent of recipe's code. First question: Any objections?
>
> In case of no objections: Second question: Is shebang in
> post/pre/install/remove scripts (I saw many scripts without shebang)?
When looking for something else I've noticed
package.bbclass:do_split_packages
if postinst:
postinst = '#!/bin/sh\n' + postinst + '\n'
if postrm:
postrm = '#!/bin/sh\n' + postrm + '\n'
and few other places like update-alternatives.bbclass:
meta/classes/update-alternatives.bbclass: postinst = d.getVar('pkg_postinst_%s' % pkg, True) or '#!/bin/sh\n'
meta/classes/update-alternatives.bbclass: postrm = d.getVar('pkg_postrm_%s' % pkg, True) or '#!/bin/sh\n'
Maybe it would be easier to prepend shebang only in one place, just
before it's written in package. Well until someone decides to write some
postinst script in perl :).
>
> Andreas
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: postinst questions (was postinst does not finish)
2013-04-24 12:36 ` Martin Jansa
@ 2013-04-24 13:03 ` Andreas Müller
0 siblings, 0 replies; 5+ messages in thread
From: Andreas Müller @ 2013-04-24 13:03 UTC (permalink / raw)
To: Martin Jansa; +Cc: Patches and discussions about the oe-core layer
On Wed, Apr 24, 2013 at 2:36 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Wed, Apr 24, 2013 at 02:04:39PM +0200, Andreas Müller wrote:
>> Hi
>>
>> as written before: an 'exit 1' within recipe's postinst causes
>> trouble. E.g meta-oe's lxdm does not run systemd.bbclass' code which
>> leaves lxdm in unprepared condition causing start too early and ending
>> in unfinished postinstall.
>>
>> A simple workaround for this (we should think of something else later)
>> would be to prepend postinst code within systemd.bbclass (and maybe
>> others too) instead of appending. Hereby we ensure that the code is
>> executed independent of recipe's code. First question: Any objections?
>>
>> In case of no objections: Second question: Is shebang in
>> post/pre/install/remove scripts (I saw many scripts without shebang)?
>
> When looking for something else I've noticed
> package.bbclass:do_split_packages
> if postinst:
> postinst = '#!/bin/sh\n' + postinst + '\n'
> if postrm:
> postrm = '#!/bin/sh\n' + postrm + '\n'
This code is not run - at least for many many recipes. I modified it
for test purpose but did not find my modifications anywhere...
Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: postinst questions (was postinst does not finish)
2013-04-24 12:04 postinst questions (was postinst does not finish) Andreas Müller
2013-04-24 12:36 ` Martin Jansa
@ 2013-04-24 13:21 ` Paul Eggleton
2013-04-24 14:01 ` Andreas Müller
1 sibling, 1 reply; 5+ messages in thread
From: Paul Eggleton @ 2013-04-24 13:21 UTC (permalink / raw)
To: Andreas Müller; +Cc: openembedded-core
On Wednesday 24 April 2013 14:04:39 Andreas Müller wrote:
> as written before: an 'exit 1' within recipe's postinst causes
> trouble. E.g meta-oe's lxdm does not run systemd.bbclass' code which
> leaves lxdm in unprepared condition causing start too early and ending
> in unfinished postinstall.
I think the way forward with this is to avoid doing this at all - let's try to
get as many of these postinstalls working on the host. Looking at the
postinstall in the lxdm recipe in meta-oe, I can't see anything that couldn't
work on the host - $D would just be needed in front of ${libdir} and
${localstatedir}.
> A simple workaround for this (we should think of something else later)
> would be to prepend postinst code within systemd.bbclass (and maybe
> others too) instead of appending. Hereby we ensure that the code is
> executed independent of recipe's code. First question: Any objections?
As long as there's no reliance within systemd.bbclass upon anything that a
recipe's custom postinstall might be doing - this could be problematic for
example if the custom postinstall were configuring a service which would be
automatically started as a result of the systemd postinstall (not sure if this
is how this ends up operating without trying it, but you get the idea.)
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: postinst questions (was postinst does not finish)
2013-04-24 13:21 ` Paul Eggleton
@ 2013-04-24 14:01 ` Andreas Müller
0 siblings, 0 replies; 5+ messages in thread
From: Andreas Müller @ 2013-04-24 14:01 UTC (permalink / raw)
To: Paul Eggleton; +Cc: openembedded-core
On Wed, Apr 24, 2013 at 3:21 PM, Paul Eggleton
<paul.eggleton@linux.intel.com> wrote:
> On Wednesday 24 April 2013 14:04:39 Andreas Müller wrote:
>> as written before: an 'exit 1' within recipe's postinst causes
>> trouble. E.g meta-oe's lxdm does not run systemd.bbclass' code which
>> leaves lxdm in unprepared condition causing start too early and ending
>> in unfinished postinstall.
>
> I think the way forward with this is to avoid doing this at all - let's try to
> get as many of these postinstalls working on the host. Looking at the
> postinstall in the lxdm recipe in meta-oe, I can't see anything that couldn't
> work on the host - $D would just be needed in front of ${libdir} and
> ${localstatedir}.
>
>> A simple workaround for this (we should think of something else later)
>> would be to prepend postinst code within systemd.bbclass (and maybe
>> others too) instead of appending. Hereby we ensure that the code is
>> executed independent of recipe's code. First question: Any objections?
>
> As long as there's no reliance within systemd.bbclass upon anything that a
> recipe's custom postinstall might be doing - this could be problematic for
> example if the custom postinstall were configuring a service which would be
> automatically started as a result of the systemd postinstall (not sure if this
> is how this ends up operating without trying it, but you get the idea.)
>
> Cheers,
> Paul
>
The more I look into all this I think we need a rework on the
pre/post/inst/rm stuff:
* exit allover - nobody can tell which code gets useless
* shebang is only found for recipes inheriting classes taking care..
Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-04-24 14:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-24 12:04 postinst questions (was postinst does not finish) Andreas Müller
2013-04-24 12:36 ` Martin Jansa
2013-04-24 13:03 ` Andreas Müller
2013-04-24 13:21 ` Paul Eggleton
2013-04-24 14:01 ` Andreas Müller
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.