[oe-commits] Christopher Larson : rng-tools: obey the sysvinit distro feature

git at git.openembedded.org git at git.openembedded.org
Wed Dec 31 15:47:10 UTC 2014


Module: meta-openembedded.git
Branch: master-next
Commit: f7b3fd7a2dadf96498bf410ae6ff0349f24179fa
URL:    http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=f7b3fd7a2dadf96498bf410ae6ff0349f24179fa

Author: Christopher Larson <chris_larson at mentor.com>
Date:   Mon Dec 29 13:50:17 2014 -0700

rng-tools: obey the sysvinit distro feature

Signed-off-by: Christopher Larson <chris_larson at mentor.com>
Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>

---

 meta-oe/recipes-support/rng-tools/rng-tools_4.bb | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/meta-oe/recipes-support/rng-tools/rng-tools_4.bb b/meta-oe/recipes-support/rng-tools/rng-tools_4.bb
index f10fad1..0b40fc5 100644
--- a/meta-oe/recipes-support/rng-tools/rng-tools_4.bb
+++ b/meta-oe/recipes-support/rng-tools/rng-tools_4.bb
@@ -10,16 +10,26 @@ SRC_URI = "http://heanet.dl.sourceforge.net/sourceforge/gkernel/${BP}.tar.gz \
 SRC_URI[md5sum] = "ae89dbfcf08bdfbea19066cfbf599127"
 SRC_URI[sha256sum] = "b71bdfd4222c05e8316001556be90e1606f2a1bac3efde60153bd84e873cc195"
 
+# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
+# manually to avoid unnecessary postinst/preinst generated.
+python () {
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
 inherit autotools update-rc.d
 
 do_install_append() {
-    install -d "${D}${sysconfdir}/init.d"
-    install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rng-tools
-    sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir},' \
-        ${D}${sysconfdir}/init.d/rng-tools
+    # Only install the init script when 'sysvinit' is in DISTRO_FEATURES.
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+        install -d "${D}${sysconfdir}/init.d"
+        install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rng-tools
+        sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir},' \
+            ${D}${sysconfdir}/init.d/rng-tools
 
-    install -d "${D}${sysconfdir}/default"
-    install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default
+        install -d "${D}${sysconfdir}/default"
+        install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default
+    fi
 }
 
 INITSCRIPT_NAME = "rng-tools"



More information about the Openembedded-commits mailing list