That's testing for offline installation. If $D is not set, it's running on the 
target.

p.


On 25 August 2021 22:12:22 BST, "Robert P. J. Day" <rpj...@crashcourse.ca> 
wrote:
>
>Quoting Alexander Kanavin <alex.kana...@gmail.com>:
>
>> If you show the confusing examples, we could try to figure it out.
>>
>> Alex
>>
>> On Wed, 25 Aug 2021 at 22:35, Robert P. J. Day <rpj...@crashcourse.ca>
>> wrote:
>>
>>>
>>> there will be many more questions about pkg_postinst (and related)
>>> routines shortly, but digging into these for the first time, i
>>> thought that that test checked whether the routine was being run
>>> at image creation time, or at first-time boot. now i'm not quite
>>> sure what to think after seeing several examples.
>>>
>>> what does the test for null or non-null variable "D" mean in
>>> a pkg_postinst routine? and once i figure all this out, i may
>>> very well contribute some enhanced docs for the next confused
>>> person.
>
>   there's no shortage of examples ... here's just one from
>recipes-bsp/alsa-state/alsa-state.bb:
>
>
>pkg_postinst:${PN}() {
>         if test -z "$D"       <========
>         then
>                 if test -x ${sbindir}/alsactl
>                 then
>                         ${sbindir}/alsactl -g -f  
>${localstatedir}/lib/alsa/asound.state restore
>                 fi
>         fi
>}
>
>
>there's plenty more ... recipes-bsp/keymaps/keymaps_1.0.bb:
>
>
>pkg_postinst:${PN} () {
>         if ${@bb.utils.contains('DISTRO_FEATURES','systemd  
>sysvinit','true','false',d)}; then
>                 if [ -n "$D" ]; then        <========
>                         OPTS="--root=$D"
>                 fi
>                 systemctl $OPTS mask keymap.service
>         fi
>}
>
>
>rday
>

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155326): 
https://lists.openembedded.org/g/openembedded-core/message/155326
Mute This Topic: https://lists.openembedded.org/mt/85146007/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to