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

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


On 2017-12-14 14:52, Alexander Kanavin wrote:
> On 12/14/2017 03:11 PM, Stefan Agner wrote:
>>
>>> I don't think this is correct. Some postinsts are intentionally
>>> deferred to first boot, and they need to be run regardless of whether
>>> the image supports runtime package management or not.
>>
>> Yes I know, the mentioned opkg-keyrings is such a case.
>>
>> If there is no package management, then scripts get deployed via
>> /etc/*-postinsts, if package management is available then it will take
>> care of it.
> 
> From reading the code, that only happens when using rpm. In other
> cases you need to execute _save_postinsts(), regardless of whether
> package management is available on image or not.

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?

> 
> Whatever changes you try, do run oe-selftest's
> 'test_postinst_rootfs_and_boot' test against them and make sure it
> doesn't regress.

Yeah will do when I have a solution which I am happy with.

Before that, I rather prefer understanding the whole issue and try to
come up with a solution that works on first regression test (rather than
try and error)...

--
Stefan



More information about the Openembedded-core mailing list