Merge branch 'master' into master
This commit is contained in:
@@ -17,6 +17,9 @@
|
|||||||
#include "infnoise.h"
|
#include "infnoise.h"
|
||||||
#include "KeccakF-1600-interface.h"
|
#include "KeccakF-1600-interface.h"
|
||||||
|
|
||||||
|
#define VEND_ID 0x0403
|
||||||
|
#define PROD_ID 0x6015
|
||||||
|
|
||||||
// Extract the INM output from the data received. Basically, either COMP1 or COMP2
|
// Extract the INM output from the data received. Basically, either COMP1 or COMP2
|
||||||
// changes, not both, so alternate reading bits from them. We get 1 INM bit of output
|
// changes, not both, so alternate reading bits from them. We get 1 INM bit of output
|
||||||
// per byte read. Feed bits from the INM to the health checker. Return the expected
|
// per byte read. Feed bits from the INM to the health checker. Return the expected
|
||||||
@@ -131,6 +134,7 @@ static bool listUSBDevices(struct ftdi_context *ftdic) {
|
|||||||
|
|
||||||
// search devices
|
// search devices
|
||||||
int rc = ftdi_usb_find_all(ftdic, &devlist, INFNOISE_VENDOR_ID, INFNOISE_PRODUCT_ID);
|
int rc = ftdi_usb_find_all(ftdic, &devlist, INFNOISE_VENDOR_ID, INFNOISE_PRODUCT_ID);
|
||||||
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
if(!isSuperUser()) {
|
if(!isSuperUser()) {
|
||||||
fprintf(stderr, "Can't find Infinite Noise Multiplier. Try running as super user?\n");
|
fprintf(stderr, "Can't find Infinite Noise Multiplier. Try running as super user?\n");
|
||||||
@@ -182,6 +186,7 @@ static bool initializeUSB(struct ftdi_context *ftdic, char **message, char *seri
|
|||||||
} else {
|
} else {
|
||||||
// serial specified
|
// serial specified
|
||||||
rc = ftdi_usb_open_desc(ftdic, INFNOISE_VENDOR_ID, INFNOISE_PRODUCT_ID, INFNOISE_DESCRIPTION, serial);
|
rc = ftdi_usb_open_desc(ftdic, INFNOISE_VENDOR_ID, INFNOISE_PRODUCT_ID, INFNOISE_DESCRIPTION, serial);
|
||||||
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
if(!isSuperUser()) {
|
if(!isSuperUser()) {
|
||||||
*message = "Can't find Infinite Noise Multiplier. Try running as super user?\n";
|
*message = "Can't find Infinite Noise Multiplier. Try running as super user?\n";
|
||||||
|
|||||||
22
software/scripts/infnoise.openrc
Executable file
22
software/scripts/infnoise.openrc
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
PIDFILE=/run/infnoise.pid
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need udev-settle localmount
|
||||||
|
provide trng # Support need/use trng in other scripts
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
ebegin "Starting infnoise"
|
||||||
|
/usr/local/sbin/infnoise --dev-random --daemon --pidfile $PIDFILE
|
||||||
|
eend $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
ebegin "Stopping infnoise"
|
||||||
|
kill `cat $PIDFILE`
|
||||||
|
RC=$?
|
||||||
|
rm -f $PIDFILE
|
||||||
|
eend $RC
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user