mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-20 02:36:39 +02:00
Upgrade to 6.16. Create rngd user & group and change init.d script to tell rngd to drop privileges and switch to running as this user/group after initialisation. Add README.Alpine pointing out recent kernel changes make rngd redundant.
72 lines
1.6 KiB
Bash
72 lines
1.6 KiB
Bash
#!/sbin/openrc-run
|
|
|
|
description="Random number generator daemon"
|
|
|
|
pidfile="/run/$RC_SVCNAME.pid"
|
|
command="/usr/sbin/rngd"
|
|
command_args="-b -p $pidfile -D rngd:rngd"
|
|
|
|
depend() {
|
|
after procfs urandom
|
|
provide entropy
|
|
}
|
|
|
|
start_pre() {
|
|
command_args="${command_args} ${EXTRA_ARGS}"
|
|
|
|
for entsrc in ${INCLUDE_ENTROPY_SOURCES}; do
|
|
command_args="${command_args} -n ${entsrc}"
|
|
done
|
|
|
|
for entsrc in ${EXCLUDE_ENTROPY_SOURCES}; do
|
|
command_args="${command_args} -x ${entsrc}"
|
|
done
|
|
|
|
if [ "x${ENTROPY_COUNT}" != "x" ]; then
|
|
command_args="${command_args} -e ${ENTROPY_COUNT}"
|
|
fi
|
|
|
|
if [ "x${FORCE_RESEED}" != "x" ]; then
|
|
command_args="${command_args} -R ${FORCE_RESEED}"
|
|
fi
|
|
|
|
if [ "x${HWRNG_DEVICE}" != "x" ]; then
|
|
command_args="${command_args} -r ${HWRNG_DEVICE}"
|
|
fi
|
|
|
|
if [ "x${RANDOM_DEVICE}" != "x" ]; then
|
|
command_args="${command_args} -o ${RANDOM_DEVICE}"
|
|
fi
|
|
|
|
if [ "x${STEP}" != "x" ]; then
|
|
command_args="${command_args} -s ${STEP}"
|
|
fi
|
|
|
|
if [ "x${WATERMARK}" != "x" ]; then
|
|
command_args="${command_args} -W ${WATERMARK}"
|
|
fi
|
|
|
|
for entsrc_opt in ${DARN_OPTIONS}; do
|
|
command_args="${command_args} -O darn:${entsrc_opt}"
|
|
done
|
|
|
|
for entsrc_opt in ${JITTER_OPTIONS}; do
|
|
command_args="${command_args} -O jitter:${entsrc_opt}"
|
|
done
|
|
|
|
for entsrc_opt in ${NIST_OPTIONS}; do
|
|
command_args="${command_args} -O nist:${entsrc_opt}"
|
|
done
|
|
|
|
for entsrc_opt in ${RDRAND_OPTIONS}; do
|
|
command_args="${command_args} -O rdrand:${entsrc_opt}"
|
|
done
|
|
|
|
for entsrc_opt in ${RNDR_OPTIONS}; do
|
|
command_args="${command_args} -O rndr:${entsrc_opt}"
|
|
done
|
|
|
|
for entsrc_opt in ${RTLSDR_OPTIONS}; do
|
|
command_args="${command_args} -O rtlsdr:${entsrc_opt}"
|
|
done
|
|
}
|