Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC regarding rng-tools startup. #500

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions stage2/01-sys-tweaks/01-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ on_chroot << EOF
systemctl disable hwclock.sh
systemctl disable nfs-common
systemctl disable rpcbind
systemctl disable rng-tools
if [ "${ENABLE_SSH}" == "1" ]; then
systemctl enable ssh
else
Expand Down
11 changes: 11 additions & 0 deletions stage2/04-rng-tools/00-patches/01-rng-tools.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- stage2.orig/rootfs/etc/init.d/rng-tools 2020-09-20 17:48:03.967820377 +0100
+++ stage2/rootfs/etc/init.d/rng-tools 2020-09-21 04:30:07.379806813 +0100
@@ -19,7 +19,7 @@
DAEMON=/usr/sbin/rngd
NAME=rngd
DESC="Hardware RNG entropy gatherer daemon"
-PIDFILE=/var/run/rngd.pid
+PIDFILE=/run/rngd.pid

DEVICELIST="hwrng hw_random hwrandom intel_rng i810_rng"

1 change: 1 addition & 0 deletions stage2/04-rng-tools/00-patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
01-rng-tools.diff
7 changes: 7 additions & 0 deletions stage2/04-rng-tools/01-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -e

install -m 644 files/rng-tools.service "${ROOTFS_DIR}/etc/systemd/system/"

on_chroot << EOF
systemctl -f enable rng-tools
EOF
22 changes: 22 additions & 0 deletions stage2/04-rng-tools/files/rng-tools.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is provided by pi-gen.
#

[Unit]
Description=Start rng-tools
DefaultDependencies=no
Conflicts=shutdown.target
Before=fake-hwclock.service systemd-journald.service
Before=sysinit.target shutdown.target
ConditionVirtualization=!container

[Service]
EnvironmentFile=-/etc/default/rng-tools
Type=oneshot
RemainAfterExit=yes
ExecStart=/etc/init.d/rng-tools start
ExecStop=/etc/init.d/rng-tools stop

[Install]
WantedBy=systemd-random-seed.service