OK I found.

Yes "opkg configure" will call /var/lib/opkg/info/*.postinst for packages
marked as "unpacked" in /var/lib/opkg/status ex:

Package: test-deployment-lic
Version: 1.0-r0
Status: install ok unpacked
Architecture: aarch64
Installed-Time: 1589349316
Auto-Installed: yes

After update
Package: test-deployment-lic
Version: 1.0-r0
Status: install ok unpacked
Architecture: aarch64
Installed-Time: 1589349316
Auto-Installed: yes

Should be easy to merge.

Thanks!
-Damien

On Wed, May 13, 2020 at 12:04 PM Alexander Kanavin <[email protected]>
wrote:

> Reading recipes-devtools/run-postinsts/run-postinsts/run-postinsts
> and_save_postinsts_common (in rootfs.py) once more, it seems
> /etc/ipk-postinsts is only used if there is no package manager on the
> target.
>
> If there is, then 'opkg configure' is run directly, and so postinsts come
> from some internal database. There is some additional magic in rootfs.py to
> mark packages with first-boot postinsts as unpacked, so they'll get picked
> up by opkg.
>
> Alex
>
> On Wed, 13 May 2020 at 09:33, Damien LEFEVRE <[email protected]> wrote:
>
>> Thanks Alex,
>>
>> When I do a factory reset, the system detects as a first boot and the
>> script is executed.
>>
>> > cat /var/log/postinstall.log
>> Configuring test-deployment.
>>
>> One thing which puzzles me: the /etc/ipk-postinsts directory do not
>> exist. Not in the image recipe folder, not in the image file which I mount
>> to check the content before flashing and of course it's deleted at the end
>> of run-postinsts
>>
>> rootfs.py:
>>     def _save_postinsts_common(self, dst_postinst_dir, src_postinst_dir):
>>         if bb.utils.contains("IMAGE_FEATURES", "package-management",
>>                          True, False, self.d):
>>             return
>>         num = 0
>>         for p in self._get_delayed_postinsts():
>>             bb.utils.mkdirhier(dst_postinst_dir)
>>
>>             if os.path.exists(os.path.join(src_postinst_dir, p +
>> ".postinst")):
>>                 shutil.copy(os.path.join(src_postinst_dir, p +
>> ".postinst"),
>>                             os.path.join(dst_postinst_dir, "%03d-%s" %
>> (num, p)))
>>
>>             num += 1
>>
>>
>> package-management is in my image features so I understand nothing get
>> written.
>>
>> So who temporarily creates that /etc/ipk-postinsts?
>>
>> Thanks,
>> -Damien
>>
>> On Fri, May 8, 2020 at 6:15 PM Alexander Kanavin <[email protected]>
>> wrote:
>>
>>> On Fri, 8 May 2020 at 11:32, Damien LEFEVRE <[email protected]>
>>> wrote:
>>>
>>>>
>>>> If can find the postinst script in
>>>> /var/lib/opkg/info/test-deployment.postinst and execute it.
>>>>
>>>> Since test-deployment is a new package, I would have expected
>>>> pkg_postinst_ontarget to be executed
>>>>
>>>> How is the first boot detected on a poky image? Is there a way to
>>>> detect if .postinst scripts haven't been executed?
>>>>
>>>
>>> The scripts to be executed  are written into /etc/rpm|deb|ipk-postinsts/
>>> and executed by
>>> meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts script
>>> (which is started on first boot as a service).
>>> Then they get deleted.
>>>
>>> Alex
>>>
>>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#49389): https://lists.yoctoproject.org/g/yocto/message/49389
Mute This Topic: https://lists.yoctoproject.org/mt/74069263/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to