Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 673120 - sys-apps/rng-tools init script improvements
Summary: sys-apps/rng-tools init script improvements
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Göktürk Yüksek
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-14 09:17 UTC by BT
Modified: 2018-12-29 04:33 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description BT 2018-12-14 09:17:13 UTC
rng-tools 6.5 added support for referencing entropy sources by short name rather than by index. rngd also warns that entropy source indexes are deprecated.

# /etc/init.d/rngd start
 * Starting rngd ...
Note, reference of entropy sources by index is deprecated, use entropy source short name instead

Disabling 2: Intel RDRAND Instruction RNG (rdrand)


Initalizing available sources

Failed to init entropy source hwrng

Enabling JITTER rng support

Initalizing entropy source jitter


The rngd init script is currently using '-x 1' and '-x 2' to optionally disable TPM and RDRAND. It should instead use '-x tpm' and '-x rdrand'.

It would also be useful to have an OPTS variable added to the conf.d file to allow additional options to be passed to rngd.
Comment 1 Larry the Git Cow gentoo-dev 2018-12-29 02:12:52 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fcd29101d4458d6715c5aaa96c75da29e93f80b4

commit fcd29101d4458d6715c5aaa96c75da29e93f80b4
Author:     Göktürk Yüksek <gokturk@gentoo.org>
AuthorDate: 2018-12-29 02:11:42 +0000
Commit:     Göktürk Yüksek <gokturk@gentoo.org>
CommitDate: 2018-12-29 02:12:35 +0000

    sys-apps/rng-tools: rewrite initd and confd (6.6-r1 only)
    
    Restructure the openrc init script and the accompanying confd file to
    reflect the recent changes to rngd.
    
    - Instead of having individual NO_FOO="1" style variables in the confd
      file for each entropy source, maintain a single list of entropy
      sources to enable. Likewise, maintain a list of entropy sources to
      disable.
    - Allow per-entropy-source options to be set inside the confd file.
    - The init file defines $description now.
    - Use $command_args_background instead of $command_args to specify the
      daemon behavior.
    - Allow default setting of --fill-watermark.
    - Allow extra arguments to be passed to rngd from the confd file.
    
    Bug: https://bugs.gentoo.org/650622
    Bug: https://bugs.gentoo.org/673120
    Package-Manager: Portage-2.3.52, Repoman-2.3.12
    Signed-off-by: Göktürk Yüksek <gokturk@gentoo.org>

 sys-apps/rng-tools/files/rngd-confd-6      | 82 ++++++++++++++++++++++++++++++
 sys-apps/rng-tools/files/rngd-initd-6-r1   | 60 ++++++++++++++++++++++
 sys-apps/rng-tools/rng-tools-6.6-r1.ebuild | 68 +++++++++++++++++++++++++
 3 files changed, 210 insertions(+)
Comment 2 Göktürk Yüksek archtester gentoo-dev 2018-12-29 02:15:12 UTC
Hi,

I've pushed a new pair of initd, confd files with the version 6.6-r1. If possible, can you give them a try and let me know?

Thanks
Comment 3 BT 2018-12-29 04:21:49 UTC
Thank you very much for the new confd and initd files. They are a big improvement over the previous ones.

I have tested with the following in confd:

INCLUDE_ENTROPY_SOURCES="jitter"
EXCLUDE_ENTROPY_SOURCES="hwrng tpm rdrand"
EXTRA_ARGS="--quiet"

`ps ax` prints the following:

/usr/sbin/rngd -n jitter -x hwrng -x tpm -x rdrand --quiet --pid-file /var/run/rngd.pid --background

So far it appears to be working great.
Comment 4 Göktürk Yüksek archtester gentoo-dev 2018-12-29 04:33:35 UTC
Thanks for testing it. Feel free to re-open if something goes wrong.