Code Monkey home page Code Monkey logo

Comments (4)

nhorman avatar nhorman commented on August 16, 2024 1

well, I'm not sure what to tell you.

rng-tools started using libsysfs when it was first developed and its always worked just fine. Of course the only thing we've used it for was to lookup sysfs attributes directly (no following links etc). So in my opinion its perfectly safe, and all the distributions that rng-tools ships with also ship libsysfs. While it may be true that the library has shortcomings, I think its a bit disingenuous for the kernel documentation to assert that no one should use it.

I understand if you don't want to introduce libsysfs into your environment, but currently there is no option to exclude it from the build. That said, its only used for one entropy source in rngd (the hwrng source), and the libraries use is restricted to two calls (sysfs_open_attribute and sysfs_close_attribute). Both of those are really just wrapper calls to a sequence of open/read/close calls. So if you were so inclined, I'd be happy to review/accept a patch that implements that functionality directly and replaces the library calls to those internal implementations. Then we could remove the dependency.

from rng-tools.

jmrcpn avatar jmrcpn commented on August 16, 2024

Trying to build rng-tools, ./configure complain about libsysfs missing


configure: No Jitterentropy libary found
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libcurl... yes
checking for libxml-2.0... yes
checking for openssl... yes
checking for libp11... yes
checking for library containing sysfs_get_mnt_path... no
configure: error: libsysfs is required

Obviously I could import/config libsysfs (diagnostic toosl, 2.1.0), but kernel
guys are saying libsysfs is a "no, no"

https://www.mjmwired.net/kernel/Documentation/sysfs-rules.tx

Do not use libsysfs
It makes assumptions about sysfs which are not true. Its API does not offer any abstraction, it exposes all the kernel driver-core implementation details in its own API.

So I am reluctant to add libsysfs.
How I can have configure to bypass the libsysfs check? is it possible? is it wise?

from rng-tools.

jmrcpn avatar jmrcpn commented on August 16, 2024

Agreed, found the "kernel comment" rather mean (easy discarding of other's work, not nice)
So I added libsysfs and rngd is working fine, thanks for your help.
I am using rngd to reduce linux-4.+++ booting delay (cnrg).

Note: if indeed libsysfs is "useless" (kernel guys) or "restricted" (you), may be the library shouldn't be used. I checked if I can remove it from rng-tools, but I am not competent enough (no knowledge about rngd principle and intrinsic) to do a clean job.

Suggestions:
when you start rngd, it is in verbose mode by default (before entering in daemon mode)
./rngd -r /dev/urandom
Initalizing available sources
Initalizing entropy source hwrng
Failed to init entropy source rdrand
PKCS11 Engine /usr/lib64/opensc-pkcs11.so Error: No such file or directory

This verbose mode can be cancel by "-q",.... problem...
without -q , user believe rngd is not working while it is entering in background (and working fine)
with -q, there is no message if rngd is NOT going in background (the message "unable to adjust write_wakeup_threshold" is not displayed).
This is bad in term of functionality, if rngd is not able to reach a working state (fatal error) a message should be displayed, or "proceeding messages" should be displayed only via a verbose mode (-v) or debug mode (-d).
My 2 cents.

from rng-tools.

nhorman avatar nhorman commented on August 16, 2024

I'm not sure what you're saying, in quiet mode, output messages are suppressed, so if there are failures, you won't see messages, and thats by design (its the purpose of -q). If you're using that flag, you determine the status of rngd by its exit code, which systemd does. If you don't use -q, you get informational messages about which entropy sources are available and working, and are expected to understand that rngd has multiple sources and, if you don't expressly disable them and they fail to initialize (for instance, if the underlying hardware is unavailable), then thats an expected failure you can ignore.

from rng-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.