Add a config file for storing rngd options

So rngd options can be adjusted and not overwritten on updates (bz1252175)
Disable pkcs11 and nist entropy sources by default (bz1252175#c21)

Signed-off-by: Vladis Dronov <vdronov@redhat.com>
This commit is contained in:
Vladis Dronov 2021-09-20 14:25:17 +02:00
parent 8e825f64b9
commit 12e926e87d
3 changed files with 15 additions and 4 deletions

View File

@ -16,6 +16,7 @@ License: GPLv2+
URL: https://github.com/nhorman/rng-tools
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: rngd.service
Source2: rngd.sysconfig
BuildRequires: gcc make
BuildRequires: gettext
@ -63,6 +64,8 @@ Hardware random number generation tools.
# install systemd unit file
install -Dt %{buildroot}%{_unitdir} -m0644 %{SOURCE1}
# install sysconfig file
install -D %{SOURCE2} -m0644 %{buildroot}%{_sysconfdir}/sysconfig/rngd
%post
%systemd_post rngd.service
@ -81,13 +84,15 @@ install -Dt %{buildroot}%{_unitdir} -m0644 %{SOURCE1}
%{_sbindir}/rngd
%{_mandir}/man1/rngtest.1.*
%{_mandir}/man8/rngd.8.*
%attr(0644,root,root) %{_unitdir}/rngd.service
%attr(0644,root,root) %{_unitdir}/rngd.service
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/rngd
%changelog
* Sat Sep 18 2021 Vladis Dronov <vdronov@redhat.com> - 6.14-1.git.56626083
* Mon Sep 20 2021 Vladis Dronov <vdronov@redhat.com> - 6.14-1.git.56626083
- Update to the upstream v6.14 + tip of origin/master @ 56626083
- Add an important cb52458b and a revert of 2ce93190
- Add an important 82f665c4 and a revert of 2ce93190
- Add a fix for covscan unused variable warning
- Add a config file for storing rngd options
* Tue Sep 14 2021 Sahana Prasad <sahana@redhat.com> - 6.13-4.git.d207e0b6
- Rebuilt with OpenSSL 3.0.0

View File

@ -2,8 +2,11 @@
Description=Hardware RNG Entropy Gatherer Daemon
ConditionVirtualization=!container
# The "-f" option is required for the systemd service rngd to work with Type=simple
[Service]
ExecStart=/usr/sbin/rngd -f
Type=simple
EnvironmentFile=/etc/sysconfig/rngd
ExecStart=/usr/sbin/rngd -f $RNGD_ARGS
[Install]
WantedBy=multi-user.target

3
rngd.sysconfig Normal file
View File

@ -0,0 +1,3 @@
# Optional arguments passed to rngd. See rngd(8) and
# https://bugzilla.redhat.com/show_bug.cgi?id=1252175#c21
RNGD_ARGS="-x pkcs11 -x nist"