mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] rng-tools: add systemd service and rngtest options
@ 2016-05-13  7:30 Steffen Trumtrar
  2016-05-17  6:32 ` Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Steffen Trumtrar @ 2016-05-13  7:30 UTC (permalink / raw)
  To: ptxdist; +Cc: Steffen Trumtrar

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-17  6:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-13  7:30 [ptxdist] [PATCH] rng-tools: add systemd service and rngtest options Steffen Trumtrar
2016-05-17  6:32 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox