From 059d18c6eb1ca07b82691e48d311239397b434f8 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Mon, 29 Dec 2014 13:50:17 -0700 Subject: rng-tools: obey the sysvinit distro feature Signed-off-by: Christopher Larson Signed-off-by: Martin Jansa --- 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 f10fad1df..0b40fc547 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" -- cgit v1.2.3-54-g00ecf