diff mbox series

[master/kirkstone] ti-sgx-ddk-um: fix error in postinst with sysvinit+udev

Message ID 20230320142534.2542288-1-matthias.schiffer@ew.tq-group.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [master/kirkstone] ti-sgx-ddk-um: fix error in postinst with sysvinit+udev | expand

Commit Message

Matthias Schiffer March 20, 2023, 2:25 p.m. UTC
When sysvinit is in DISTRO_FEATURES, the update-rc.d class must only be
inherited when the script referenced by INITSCRIPT_NAME actually exists,
or the update-rc.d command in the generated postinst script will fail.

Reported-by: Denys Dmytriyenko <denis@denix.org>
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---

I have omitted a Fixes tag, as this applies to both master and kirkstone.
The tags would be:

# kirkstone
Fixes: f50f55102f92 ("ti-sgx-ddk-um: use udev for userspace initialization")

# master
Fixes: 0b3fa09a5f0b ("ti-sgx-ddk-um: use udev for userspace initialization")

Let me know if I should send separate patches with the tags included.


 .../libgles/ti-sgx-ddk-um_1.17.4948957.bb             | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

Andrew Davis March 21, 2023, 3:50 p.m. UTC | #1
On 3/20/23 9:25 AM, Matthias Schiffer wrote:
> When sysvinit is in DISTRO_FEATURES, the update-rc.d class must only be
> inherited when the script referenced by INITSCRIPT_NAME actually exists,
> or the update-rc.d command in the generated postinst script will fail.
> 
> Reported-by: Denys Dmytriyenko <denis@denix.org>
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---

Thanks handling this, LGTM,

Reviewed-by: Andrew Davis <afd@ti.com>

> 
> I have omitted a Fixes tag, as this applies to both master and kirkstone.
> The tags would be:
> 
> # kirkstone
> Fixes: f50f55102f92 ("ti-sgx-ddk-um: use udev for userspace initialization")
> 
> # master
> Fixes: 0b3fa09a5f0b ("ti-sgx-ddk-um: use udev for userspace initialization")
> 
> Let me know if I should send separate patches with the tags included.
> 
> 
>   .../libgles/ti-sgx-ddk-um_1.17.4948957.bb             | 11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
> index f1fbed15..73d7acb9 100644
> --- a/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
> +++ b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
> @@ -24,11 +24,16 @@ TARGET_PRODUCT:am65xx = "ti654x"
>   INITSCRIPT_NAME = "rc.pvr"
>   INITSCRIPT_PARAMS = "defaults 8"
>   
> -inherit update-rc.d
> -
>   PACKAGECONFIG ??= "udev"
>   PACKAGECONFIG[udev] = ",,,udev"
>   
> +def use_initscript(d):
> +    sysvinit = bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d)
> +    udev = bb.utils.contains('PACKAGECONFIG', 'udev', True, False, d)
> +    return sysvinit and not udev
> +
> +inherit ${@oe.utils.ifelse(use_initscript(d), 'update-rc.d', '')}
> +
>   RDEPENDS:${PN} += "libdrm libdrm-omap"
>   
>   RRECOMMENDS:${PN} += "ti-sgx-ddk-km"
> @@ -42,7 +47,7 @@ do_install () {
>       with_udev=${@bb.utils.contains('PACKAGECONFIG', 'udev', 'true', 'false', d)}
>   
>       # Delete initscript if it is not needed or would conflict with the udev rules
> -    if $without_sysvinit || $with_udev; then
> +    if ${@oe.utils.ifelse(use_initscript(d), 'false', 'true')}; then
>           rm -rf ${D}${sysconfdir}/init.d
>           rmdir --ignore-fail-on-non-empty ${D}${sysconfdir}
>       fi
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#16216): https://lists.yoctoproject.org/g/meta-ti/message/16216
> Mute This Topic: https://lists.yoctoproject.org/mt/97732105/3619733
> Group Owner: meta-ti+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub [afd@ti.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Denys Dmytriyenko March 22, 2023, 12:17 a.m. UTC | #2
On Mon, Mar 20, 2023 at 03:25:34PM +0100, Matthias Schiffer wrote:
> When sysvinit is in DISTRO_FEATURES, the update-rc.d class must only be
> inherited when the script referenced by INITSCRIPT_NAME actually exists,
> or the update-rc.d command in the generated postinst script will fail.
> 
> Reported-by: Denys Dmytriyenko <denis@denix.org>
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
> 
> I have omitted a Fixes tag, as this applies to both master and kirkstone.
> The tags would be:
> 
> # kirkstone
> Fixes: f50f55102f92 ("ti-sgx-ddk-um: use udev for userspace initialization")
> 
> # master
> Fixes: 0b3fa09a5f0b ("ti-sgx-ddk-um: use udev for userspace initialization")
> 
> Let me know if I should send separate patches with the tags included.

Thank you for taking care of this. And don't worry about Fixes: tag - meta-ti 
doesn't have a strict policy for it.

I haven't tested it yet, but so far looks good to me:

Acked-by: Denys Dmytriyenko <denys@konsulko.com>


>  .../libgles/ti-sgx-ddk-um_1.17.4948957.bb             | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
> index f1fbed15..73d7acb9 100644
> --- a/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
> +++ b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
> @@ -24,11 +24,16 @@ TARGET_PRODUCT:am65xx = "ti654x"
>  INITSCRIPT_NAME = "rc.pvr"
>  INITSCRIPT_PARAMS = "defaults 8"
>  
> -inherit update-rc.d
> -
>  PACKAGECONFIG ??= "udev"
>  PACKAGECONFIG[udev] = ",,,udev"
>  
> +def use_initscript(d):
> +    sysvinit = bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d)
> +    udev = bb.utils.contains('PACKAGECONFIG', 'udev', True, False, d)
> +    return sysvinit and not udev
> +
> +inherit ${@oe.utils.ifelse(use_initscript(d), 'update-rc.d', '')}
> +
>  RDEPENDS:${PN} += "libdrm libdrm-omap"
>  
>  RRECOMMENDS:${PN} += "ti-sgx-ddk-km"
> @@ -42,7 +47,7 @@ do_install () {
>      with_udev=${@bb.utils.contains('PACKAGECONFIG', 'udev', 'true', 'false', d)}
>  
>      # Delete initscript if it is not needed or would conflict with the udev rules
> -    if $without_sysvinit || $with_udev; then
> +    if ${@oe.utils.ifelse(use_initscript(d), 'false', 'true')}; then
>          rm -rf ${D}${sysconfdir}/init.d
>          rmdir --ignore-fail-on-non-empty ${D}${sysconfdir}
>      fi
> -- 
> 2.34.1
Andrew Davis April 3, 2023, 4:43 p.m. UTC | #3
On 3/20/23 9:25 AM, Matthias Schiffer wrote:
> When sysvinit is in DISTRO_FEATURES, the update-rc.d class must only be
> inherited when the script referenced by INITSCRIPT_NAME actually exists,
> or the update-rc.d command in the generated postinst script will fail.
> 
> Reported-by: Denys Dmytriyenko <denis@denix.org>
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---

Ryan, ping on this, no huge rush, just needed for some rework I have in my queue.

Andrew

> 
> I have omitted a Fixes tag, as this applies to both master and kirkstone.
> The tags would be:
> 
> # kirkstone
> Fixes: f50f55102f92 ("ti-sgx-ddk-um: use udev for userspace initialization")
> 
> # master
> Fixes: 0b3fa09a5f0b ("ti-sgx-ddk-um: use udev for userspace initialization")
> 
> Let me know if I should send separate patches with the tags included.
> 
> 
>   .../libgles/ti-sgx-ddk-um_1.17.4948957.bb             | 11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
> index f1fbed15..73d7acb9 100644
> --- a/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
> +++ b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
> @@ -24,11 +24,16 @@ TARGET_PRODUCT:am65xx = "ti654x"
>   INITSCRIPT_NAME = "rc.pvr"
>   INITSCRIPT_PARAMS = "defaults 8"
>   
> -inherit update-rc.d
> -
>   PACKAGECONFIG ??= "udev"
>   PACKAGECONFIG[udev] = ",,,udev"
>   
> +def use_initscript(d):
> +    sysvinit = bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d)
> +    udev = bb.utils.contains('PACKAGECONFIG', 'udev', True, False, d)
> +    return sysvinit and not udev
> +
> +inherit ${@oe.utils.ifelse(use_initscript(d), 'update-rc.d', '')}
> +
>   RDEPENDS:${PN} += "libdrm libdrm-omap"
>   
>   RRECOMMENDS:${PN} += "ti-sgx-ddk-km"
> @@ -42,7 +47,7 @@ do_install () {
>       with_udev=${@bb.utils.contains('PACKAGECONFIG', 'udev', 'true', 'false', d)}
>   
>       # Delete initscript if it is not needed or would conflict with the udev rules
> -    if $without_sysvinit || $with_udev; then
> +    if ${@oe.utils.ifelse(use_initscript(d), 'false', 'true')}; then
>           rm -rf ${D}${sysconfdir}/init.d
>           rmdir --ignore-fail-on-non-empty ${D}${sysconfdir}
>       fi
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#16216): https://lists.yoctoproject.org/g/meta-ti/message/16216
> Mute This Topic: https://lists.yoctoproject.org/mt/97732105/3619733
> Group Owner: meta-ti+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub [afd@ti.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Ryan Eatmon April 3, 2023, 6:54 p.m. UTC | #4
On 4/3/2023 11:43, Andrew Davis via lists.yoctoproject.org wrote:
> On 3/20/23 9:25 AM, Matthias Schiffer wrote:
>> When sysvinit is in DISTRO_FEATURES, the update-rc.d class must only be
>> inherited when the script referenced by INITSCRIPT_NAME actually exists,
>> or the update-rc.d command in the generated postinst script will fail.
>>
>> Reported-by: Denys Dmytriyenko <denis@denix.org>
>> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
>> ---
> 
> Ryan, ping on this, no huge rush, just needed for some rework I have in 
> my queue.
> 
> Andrew

Looking at it now.


>>
>> I have omitted a Fixes tag, as this applies to both master and kirkstone.
>> The tags would be:
>>
>> # kirkstone
>> Fixes: f50f55102f92 ("ti-sgx-ddk-um: use udev for userspace 
>> initialization")
>>
>> # master
>> Fixes: 0b3fa09a5f0b ("ti-sgx-ddk-um: use udev for userspace 
>> initialization")
>>
>> Let me know if I should send separate patches with the tags included.
>>
>>
>>   .../libgles/ti-sgx-ddk-um_1.17.4948957.bb             | 11 ++++++++---
>>   1 file changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git 
>> a/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb 
>> b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
>> index f1fbed15..73d7acb9 100644
>> --- a/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
>> +++ b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
>> @@ -24,11 +24,16 @@ TARGET_PRODUCT:am65xx = "ti654x"
>>   INITSCRIPT_NAME = "rc.pvr"
>>   INITSCRIPT_PARAMS = "defaults 8"
>> -inherit update-rc.d
>> -
>>   PACKAGECONFIG ??= "udev"
>>   PACKAGECONFIG[udev] = ",,,udev"
>> +def use_initscript(d):
>> +    sysvinit = bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, 
>> False, d)
>> +    udev = bb.utils.contains('PACKAGECONFIG', 'udev', True, False, d)
>> +    return sysvinit and not udev
>> +
>> +inherit ${@oe.utils.ifelse(use_initscript(d), 'update-rc.d', '')}
>> +
>>   RDEPENDS:${PN} += "libdrm libdrm-omap"
>>   RRECOMMENDS:${PN} += "ti-sgx-ddk-km"
>> @@ -42,7 +47,7 @@ do_install () {
>>       with_udev=${@bb.utils.contains('PACKAGECONFIG', 'udev', 'true', 
>> 'false', d)}
>>       # Delete initscript if it is not needed or would conflict with 
>> the udev rules
>> -    if $without_sysvinit || $with_udev; then
>> +    if ${@oe.utils.ifelse(use_initscript(d), 'false', 'true')}; then
>>           rm -rf ${D}${sysconfdir}/init.d
>>           rmdir --ignore-fail-on-non-empty ${D}${sysconfdir}
>>       fi
>>
>>
>>
>>
>>
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#16285): https://lists.yoctoproject.org/g/meta-ti/message/16285
> Mute This Topic: https://lists.yoctoproject.org/mt/97732105/6551054
> Group Owner: meta-ti+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub [reatmon@ti.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
index f1fbed15..73d7acb9 100644
--- a/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
+++ b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
@@ -24,11 +24,16 @@  TARGET_PRODUCT:am65xx = "ti654x"
 INITSCRIPT_NAME = "rc.pvr"
 INITSCRIPT_PARAMS = "defaults 8"
 
-inherit update-rc.d
-
 PACKAGECONFIG ??= "udev"
 PACKAGECONFIG[udev] = ",,,udev"
 
+def use_initscript(d):
+    sysvinit = bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d)
+    udev = bb.utils.contains('PACKAGECONFIG', 'udev', True, False, d)
+    return sysvinit and not udev
+
+inherit ${@oe.utils.ifelse(use_initscript(d), 'update-rc.d', '')}
+
 RDEPENDS:${PN} += "libdrm libdrm-omap"
 
 RRECOMMENDS:${PN} += "ti-sgx-ddk-km"
@@ -42,7 +47,7 @@  do_install () {
     with_udev=${@bb.utils.contains('PACKAGECONFIG', 'udev', 'true', 'false', d)}
 
     # Delete initscript if it is not needed or would conflict with the udev rules
-    if $without_sysvinit || $with_udev; then
+    if ${@oe.utils.ifelse(use_initscript(d), 'false', 'true')}; then
         rm -rf ${D}${sysconfdir}/init.d
         rmdir --ignore-fail-on-non-empty ${D}${sysconfdir}
     fi