mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Subject: [ptxdist] [PATCH] rng-tools: add systemd service and rngtest options
Date: Fri, 13 May 2016 09:30:52 +0200	[thread overview]
Message-ID: <1463124652-25841-1-git-send-email-s.trumtrar@pengutronix.de> (raw)

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 projectroot/lib/systemd/system/rngd.service |  7 +++++++
 rules/rng-tools.in                          | 19 +++++++++++++++++--
 rules/rng-tools.make                        |  9 +++++++++
 3 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 projectroot/lib/systemd/system/rngd.service

diff --git a/projectroot/lib/systemd/system/rngd.service b/projectroot/lib/systemd/system/rngd.service
new file mode 100644
index 000000000000..e1efcbf36e31
--- /dev/null
+++ b/projectroot/lib/systemd/system/rngd.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Hardware RNG Daemon
+DefaultDependencies=no
+Before=local-fs.target
+
+[Service]
+ExecStart=/usr/sbin/rngd -f
diff --git a/rules/rng-tools.in b/rules/rng-tools.in
index 8282b9302a25..3c30406c1cc2 100644
--- a/rules/rng-tools.in
+++ b/rules/rng-tools.in
@@ -1,8 +1,8 @@
 ## SECTION=shell_and_console
 
-config RNG_TOOLS
+menuconfig RNG_TOOLS
 	tristate
-	prompt "rng-tools rngd"
+	prompt "rng-tools rngd                "
 	help
 	  random number generator daemon - seed kernel random from hwrng
 
@@ -16,8 +16,23 @@ config RNG_TOOLS
 	      http://sourceforge.net/projects/gkernel/
 	      git://git.kernel.org/pub/scm/utils/kernel/rng-tools/rng-tools.git
 
+if RNG_TOOLS
+
 config RNG_TOOLS_STARTSCRIPT
 	bool
 	default y
 	depends on RNG_TOOLS
 	prompt "install /etc/init.d/rngd"
+
+config RNG_TOOLS_SYSTEMD_UNIT
+	bool
+	default y
+	depends on SYSTEMD
+	prompt "install systemd unit files"
+
+config RNG_TOOLS_RNGTEST
+	bool
+	default n
+	prompt "install rngtest"
+
+endif
diff --git a/rules/rng-tools.make b/rules/rng-tools.make
index 559f32ccf5d2..e9b4122ac0fa 100644
--- a/rules/rng-tools.make
+++ b/rules/rng-tools.make
@@ -49,6 +49,15 @@ ifneq ($(call remove_quotes,$(PTXCONF_RNG_TOOLS_BBINIT_LINK)),)
 endif
 endif
 endif
+ifdef PTXCONF_RNG_TOOLS_SYSTEMD_UNIT
+	@$(call install_alternative, rng-tools, 0, 0, 0644, \
+		/lib/systemd/system/rngd.service)
+	@$(call install_link, rng-tools, ../rngd.service, \
+		/lib/systemd/system/basic.target.wants/rngd.service)
+endif
+ifdef PTXCONF_RNG_TOOLS_RNGTEST
+	@$(call install_copy, rng-tools, 0, 0, 0755, -, /usr/bin/rngtest)
+endif
 	@$(call install_finish, rng-tools)
 
 	@$(call touch)
-- 
2.8.0.rc3


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

             reply	other threads:[~2016-05-13  7:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13  7:30 Steffen Trumtrar [this message]
2016-05-17  6:32 ` Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1463124652-25841-1-git-send-email-s.trumtrar@pengutronix.de \
    --to=s.trumtrar@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox