[OE-core] [RFC] opkg: avoid running postinst scripts twice when using systemd

Stefan Agner stefan at agner.ch
Thu Dec 14 17:16:21 UTC 2017


On 2017-12-14 17:59, Alexander Kanavin wrote:
> On 12/14/2017 06:46 PM, Stefan Agner wrote:
> 
>> Suggestion:
>> - Still remove systemd opkg service as proposed, since run-postinsts
>> gets run with systemd and should/will handle package manager just fine
> 
> Yes.
> 
>> - Change run-postinsts to behave sane: Detect package management by
>> checking /var/lib/dpkg/status and /var/lib/opkg/status only (remove the
>> if [ ! -d $pi_dir ]; then continue; fi...)
> 
> Maybe; you need to explain this carefully in the commit message.
> 
>> - Stop deploying /etc/*-postinsts when package management is installed
> 
> Probably not; rpm does not have a facility for 'delayed postinst
> execution' the way dpkg/opkg do, and this would create more confusion
> and special-casing than achieve any real improvement imo.

Are you sure that rpm has no such facility? Maybe there is some other
mechanism around...

If rpm really does not handle it, would mean that delayed postinst would
have been broken back when we did not ship /etc/*-postinsts:
http://git.openembedded.org/openembedded-core/commit/meta/lib/oe/rootfs.py?id=5aae19959a443c6ac4b0feef10715c8acf3c6376

If there is special case handling needed it is not particularly nice due
to the additional condition.

But IMHO still better, it can easily be explained in rootfs.py with a
comment like:

    # deb/ipk package management is able to handle postinsts on first
boot.
    if ... 

I will do some tests with rpm and send a patchset.

> 
> Jussi left Intel several months ago.

I see.

--
Stefan



More information about the Openembedded-core mailing list