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

Stefan Agner stefan at agner.ch
Thu Dec 14 14:41:54 UTC 2017


On 2017-12-14 15:24, Alexander Kanavin wrote:
> On 12/14/2017 03:59 PM, Stefan Agner wrote:
> 
>> That at least contradicts my testing with opkg/ipk.
>>
>> If /etc/ipk-postinsts is not there and /var/lib/opkg/status is there
>> (package management installed), then run-postinst runs "opkg configure",
>> which takes care of postinsts just fine.
>>
>> Reading the code at least let me to believe that this is true for deb as
>> well.
>>
>> Not sure how it works with rpm though. How do you came to the conclusion
>> that this only happens when using rpm?
> 
> I think there was confusion between what happens at image creation
> time vs what happens at first boot :)
> 
> So what's the issue again that your RFC patch doesn't resolve? I read
> your followup and I still don't get it.

I think removing the Opkg first boot systemd service (as the initial
patch does) is the correct first step.

However, it currently still leads to a second copy of the postinst
scripts in /etc if package management is enabled.

I am pretty sure that adding if delayed_postinsts and not
runtime_pkgmanage: should resolve the problem for ipk/deb fully: With
that run-postinsts will run "opkg configure"/"dpkg --configure -a"
respectively when package management is installed, and those command
will run all postinst correctly.

So for me the only question is what will happen with rpm... Will package
managment do something on first boot? And if yes, what mechanism?

If rpm needs /etc/*-postinsts even with package management, then maybe
we need to add:

if delayed_postinsts and (not runtime_pkgmanage or rpm):
    self._save_postinsts()

--
Stefan



More information about the Openembedded-core mailing list