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 <[email protected]>
Signed-off-by: Matthias Schiffer <[email protected]>
---

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
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
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/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to