[OE-core] postinst questions (was postinst does not finish)

Martin Jansa martin.jansa at gmail.com
Wed Apr 24 12:36:08 UTC 2013


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 at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20130424/400bb2e8/attachment-0002.sig>


More information about the Openembedded-core mailing list