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

Stefan Agner stefan at agner.ch
Thu Dec 14 17:40:25 UTC 2017


On 2017-12-14 18:28, Alexander Kanavin wrote:
> On 12/14/2017 07:16 PM, Stefan Agner wrote:
> 
>> Are you sure that rpm has no such facility? Maybe there is some other
>> mechanism around...
> 
> You are welcome to find it. rpm does not distinguish between unpacking
> and configuring steps, and just does everything in a single
> installation step.
> 
>> 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
> 
> Rpm had a special way to save postinstall scripts (due to the same
> problem I described just above), and still does, which means
> _save_postinsts() did (and does) nothing in rpm case.
> 

Oh, I see, well that simplifies it, doesn't it? E.g.

    # If package managers support postinsts and the package manager is
present on the
    # rootfs, then it will handle postinsts just fine, no need to deploy
scripts again.
    if delayed_postinsts and not runtime_pkgmanage:
        self._save_postinsts()

And with that it will be as it used to be before the above commit, and
the way it should be.

--
Stefan

>> 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.
> 
> Please no; the class in question is the generic Rootfs(), and I do not
> want to add packagemanager-specific clauses there.
> 
> Alex



More information about the Openembedded-core mailing list