Add service file and systemd package config to rngd

Submitted by Leonel Gonzalez on June 16, 2017, 3:37 p.m. | Patch ID: 140994

Details

Message ID 1497627437-1903-1-git-send-email-lgonzalez@us.ibm.com
State New
Headers show

Commit Message

Leonel Gonzalez June 16, 2017, 3:37 p.m.
Signed-off-by: Leonel Gonzalez <lgonzalez@us.ibm.com>
---
 meta/recipes-support/rng-tools/rng-tools/rngd.service |  8 ++++++++
 meta/recipes-support/rng-tools/rng-tools_5.bb         | 17 +++++++++++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-support/rng-tools/rng-tools/rngd.service

Patch hide | download patch | download mbox

diff --git a/meta/recipes-support/rng-tools/rng-tools/rngd.service b/meta/recipes-support/rng-tools/rng-tools/rngd.service
new file mode 100644
index 0000000..7b0e9a7
--- /dev/null
+++ b/meta/recipes-support/rng-tools/rng-tools/rngd.service
@@ -0,0 +1,8 @@ 
+[Unit]
+Description=Hardware RNG Entropy Gatherer Daemon
+
+[Service]
+ExecStart=@SBINDIR@/rngd -f
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-support/rng-tools/rng-tools_5.bb b/meta/recipes-support/rng-tools/rng-tools_5.bb
index e2acaba..c6d08e6 100644
--- a/meta/recipes-support/rng-tools/rng-tools_5.bb
+++ b/meta/recipes-support/rng-tools/rng-tools_5.bb
@@ -9,7 +9,8 @@  SRC_URI = "${SOURCEFORGE_MIRROR}/gkernel/${BP}.tar.gz \
            file://uclibc-libuargp-configure.patch \
            file://rng-tools-5-fix-textrels-on-PIC-x86.patch \
            file://init \
-           file://default"
+           file://default \
+           file://rngd.service"
 
 SRC_URI[md5sum] = "6726cdc6fae1f5122463f24ae980dd68"
 SRC_URI[sha256sum] = "60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e"
@@ -21,7 +22,7 @@  python () {
         d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
 }
 
-inherit autotools update-rc.d
+inherit autotools update-rc.d systemd
 
 PACKAGECONFIG = "libgcrypt"
 PACKAGECONFIG_libc-musl = "libargp"
@@ -29,6 +30,7 @@  PACKAGECONFIG_libc-uclibc = "libuargp"
 PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"
 PACKAGECONFIG[libuargp] = "--enable-uclibc,,,"
 PACKAGECONFIG[libgcrypt] = "--with-libgcrypt,--without-libgcrypt,libgcrypt,"
+PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd,systemd"
 
 do_install_append() {
     # Only install the init script when 'sysvinit' is in DISTRO_FEATURES.
@@ -41,7 +43,18 @@  do_install_append() {
         install -d "${D}${sysconfdir}/default"
         install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/rng-tools
     fi
+
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        install -d ${D}${systemd_unitdir}/system
+        install -m 644 ${WORKDIR}/rngd.service ${D}${systemd_unitdir}/system
+        sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/rngd.service
+    fi
 }
 
 INITSCRIPT_NAME = "rng-tools"
 INITSCRIPT_PARAMS = "start 30 2 3 4 5 . stop 30 0 6 1 ."
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+SYSTEMD_SERVICE_${PN} = "rngd.service"

Comments

Denys Dmytriyenko June 16, 2017, 4:09 p.m.
On Fri, Jun 16, 2017 at 04:01:30PM -0000, Patchwork wrote:
> == Series Details ==
> 
> Series: Add service file and systemd package config to rngd
> Revision: 1
> URL   : https://patchwork.openembedded.org/series/7298/
> State : failure
> 
> == Summary ==
> 
> 
> Thank you for submitting this patch series to OpenEmbedded Core. This is
> an automated response. Several tests have been executed on the proposed
> series by patchtest resulting in the following failures:
> 
> 
> 
> * Patch            Add service file and systemd package config to rngd
>  Issue             Shortlog does not follow expected format [test_shortlog_format] 
>   Suggested fix    Commit shortlog (first line of commit message) should follow the format "<target>: <summary>"

For more details:
https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines


> If you believe any of these test results are incorrect, please reply to the
> mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
> Otherwise we would appreciate you correcting the issues and submitting a new
> version of the patchset if applicable. Please ensure you add/increment the
> version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
> [PATCH v3] -> ...).
> 
> ---
> Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
> Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Leonardo Sandoval June 16, 2017, 4:23 p.m.
On Fri, 2017-06-16 at 12:09 -0400, Denys Dmytriyenko wrote:
> On Fri, Jun 16, 2017 at 04:01:30PM -0000, Patchwork wrote:
> > == Series Details ==
> > 
> > Series: Add service file and systemd package config to rngd
> > Revision: 1
> > URL   : https://patchwork.openembedded.org/series/7298/
> > State : failure
> > 
> > == Summary ==
> > 
> > 
> > Thank you for submitting this patch series to OpenEmbedded Core. This is
> > an automated response. Several tests have been executed on the proposed
> > series by patchtest resulting in the following failures:
> > 
> > 
> > 
> > * Patch            Add service file and systemd package config to rngd
> >  Issue             Shortlog does not follow expected format [test_shortlog_format] 
> >   Suggested fix    Commit shortlog (first line of commit message) should follow the format "<target>: <summary>"
> 
> For more details:
> https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines

I believe is time to add that URL on the patchwork email!

> 
> 
> > If you believe any of these test results are incorrect, please reply to the
> > mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
> > Otherwise we would appreciate you correcting the issues and submitting a new
> > version of the patchset if applicable. Please ensure you add/increment the
> > version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
> > [PATCH v3] -> ...).
> > 
> > ---
> > Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
> > Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
> > 
> > -- 
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
Denys Dmytriyenko June 16, 2017, 4:41 p.m.
On Fri, Jun 16, 2017 at 11:23:22AM -0500, Leonardo Sandoval wrote:
> On Fri, 2017-06-16 at 12:09 -0400, Denys Dmytriyenko wrote:
> > On Fri, Jun 16, 2017 at 04:01:30PM -0000, Patchwork wrote:
> > > == Series Details ==
> > > 
> > > Series: Add service file and systemd package config to rngd
> > > Revision: 1
> > > URL   : https://patchwork.openembedded.org/series/7298/
> > > State : failure
> > > 
> > > == Summary ==
> > > 
> > > 
> > > Thank you for submitting this patch series to OpenEmbedded Core. This is
> > > an automated response. Several tests have been executed on the proposed
> > > series by patchtest resulting in the following failures:
> > > 
> > > 
> > > 
> > > * Patch            Add service file and systemd package config to rngd
> > >  Issue             Shortlog does not follow expected format [test_shortlog_format] 
> > >   Suggested fix    Commit shortlog (first line of commit message) should follow the format "<target>: <summary>"
> > 
> > For more details:
> > https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
> 
> I believe is time to add that URL on the patchwork email!

Finally! :) As I had requested this before...
The same URL can be used for missing S-o-B or Upstream-Status lines.


> > > If you believe any of these test results are incorrect, please reply to the
> > > mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
> > > Otherwise we would appreciate you correcting the issues and submitting a new
> > > version of the patchset if applicable. Please ensure you add/increment the
> > > version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
> > > [PATCH v3] -> ...).
> > > 
> > > ---
> > > Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
> > > Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
> > > 
> > > -- 
> > > _______________________________________________
> > > Openembedded-core mailing list
> > > Openembedded-core@lists.openembedded.org
> > > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 
>