From 90396e8f5ed64d7f3813603a193332e944f5ac48 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sun, 20 Sep 2020 20:47:04 +0100 Subject: [PATCH 1/9] rng-tools files --- rng-tools-dmesg.txt | 21 +++++++++++++++++++++ rng-tools.patch | 30 ++++++++++++++++++++++++++++++ rng-tools.service | 26 ++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 rng-tools-dmesg.txt create mode 100644 rng-tools.patch create mode 100644 rng-tools.service diff --git a/rng-tools-dmesg.txt b/rng-tools-dmesg.txt new file mode 100644 index 0000000000..e95503c835 --- /dev/null +++ b/rng-tools-dmesg.txt @@ -0,0 +1,21 @@ +Sep 20 20:18:53 box.lan systemd[1]: Detected architecture arm. +Sep 20 20:18:53 box.lan systemd[1]: Set hostname to . +Sep 20 20:18:53 box.lan kernel: random: systemd: uninitialized urandom read (16 bytes read) +Sep 20 20:18:53 box.lan kernel: random: systemd: uninitialized urandom read (16 bytes read) +Sep 20 20:18:53 box.lan systemd[1]: Reached target Swap. +Sep 20 20:18:53 box.lan kernel: random: systemd: uninitialized urandom read (16 bytes read) +Sep 20 20:18:53 box.lan systemd[1]: Listening on Journal Socket (/dev/log). +Sep 20 20:18:53 box.lan systemd[1]: Condition check resulted in Journal Audit Socket being skipped. +Sep 20 20:18:53 box.lan systemd[1]: Started Dispatch Password Requests to Console Directory Watch. +Sep 20 20:18:53 box.lan kernel: random: crng init done +Sep 20 20:18:53 box.lan kernel: random: 7 urandom warning(s) missed due to ratelimiting +Sep 20 20:18:53 box.lan systemd-journald[140]: Journal started +Sep 20 20:18:53 box.lan systemd-journald[140]: Runtime journal (/run/log/journal/adf551f779b3429594630e1f56c98394) is 8.0M, max 191.3M, +Sep 20 20:18:53 box.lan rngd[119]: rngd 2-unofficial-mt.14 starting up... +Sep 20 20:18:53 box.lan rngd[119]: entropy feed to the kernel ready +Sep 20 20:18:53 box.lan rng-tools[114]: Starting Hardware RNG entropy gatherer daemon: rngd. +Sep 20 20:18:53 box.lan fake-hwclock[136]: Sun 20 Sep 19:18:53 UTC 2020 +Sep 20 20:18:53 box.lan systemd-fsck[145]: e2fsck 1.44.5 (15-Dec-2018) +Sep 20 20:18:53 box.lan systemd[1]: Started udev Coldplug all Devices. +Sep 20 20:18:53 box.lan systemd[1]: Starting Helper to synchronize boot up for ifupdown... +Sep 20 20:18:53 box.lan systemd[1]: Started Helper to synchronize boot up for ifupdown. diff --git a/rng-tools.patch b/rng-tools.patch new file mode 100644 index 0000000000..c29d93f515 --- /dev/null +++ b/rng-tools.patch @@ -0,0 +1,30 @@ +--- rng-tools.orig 2020-09-20 17:48:03.967820377 +0100 ++++ rng-tools 2020-09-20 18:48:01.060123787 +0100 +@@ -6,11 +6,15 @@ + # + ### BEGIN INIT INFO + # Provides: rng-tools +-# Required-Start: $remote_fs $syslog +-# Required-Stop: $remote_fs $syslog +-# Default-Start: 1 2 3 4 5 ++# Required-Start: ++# Required-Stop: unmoutroot ++# Should-Stop: ++# X-Start-Before: fake-hwclock ++# Default-Start: S + # Default-Stop: 0 1 6 + ### END INIT INFO ++ ++ + # + # + # $Id: rng-tools.init,v 1.6.2.10 2008-06-10 19:51:37 hmh Exp $ +@@ -19,7 +23,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" + diff --git a/rng-tools.service b/rng-tools.service new file mode 100644 index 0000000000..61e8afd241 --- /dev/null +++ b/rng-tools.service @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Start rng-tools +DefaultDependencies=no +Conflicts=shutdown.target +Before=fake-hwclock.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] +RequiredBy=systemd-random-seed.service From 42f6391dc1628a1ac308a3543c072fb5f578835d Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sun, 20 Sep 2020 21:02:42 +0100 Subject: [PATCH 2/9] add systemd-journald.service --- rng-tools.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rng-tools.service b/rng-tools.service index 61e8afd241..4341981586 100644 --- a/rng-tools.service +++ b/rng-tools.service @@ -11,7 +11,7 @@ Description=Start rng-tools DefaultDependencies=no Conflicts=shutdown.target -Before=fake-hwclock.service +Before=fake-hwclock.service systemd-journald.service Before=sysinit.target shutdown.target ConditionVirtualization=!container From 9cdec93a87ac09a1008641dc85e159bc6ec2d9cc Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Mon, 21 Sep 2020 00:18:32 +0100 Subject: [PATCH 3/9] use WantedBy --- rng-tools.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rng-tools.service b/rng-tools.service index 4341981586..8090108a98 100644 --- a/rng-tools.service +++ b/rng-tools.service @@ -23,4 +23,4 @@ ExecStart=/etc/init.d/rng-tools start ExecStop=/etc/init.d/rng-tools stop [Install] -RequiredBy=systemd-random-seed.service +WantedBy=systemd-random-seed.service From c24521268bbd49ab8ed7db00a5f0088dba3ae37a Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Mon, 21 Sep 2020 03:37:02 +0100 Subject: [PATCH 4/9] intergrate rng-tools update --- .../01-sys-tweaks/00-patches/08-rng-tools.diff | 14 +++++--------- stage2/01-sys-tweaks/00-patches/series | 1 + stage2/01-sys-tweaks/01-run.sh | 3 +++ .../01-sys-tweaks/files/rng-tools.service | 0 4 files changed, 9 insertions(+), 9 deletions(-) rename rng-tools.patch => stage2/01-sys-tweaks/00-patches/08-rng-tools.diff (66%) rename rng-tools.service => stage2/01-sys-tweaks/files/rng-tools.service (100%) diff --git a/rng-tools.patch b/stage2/01-sys-tweaks/00-patches/08-rng-tools.diff similarity index 66% rename from rng-tools.patch rename to stage2/01-sys-tweaks/00-patches/08-rng-tools.diff index c29d93f515..748ddecfcb 100644 --- a/rng-tools.patch +++ b/stage2/01-sys-tweaks/00-patches/08-rng-tools.diff @@ -1,12 +1,12 @@ ---- rng-tools.orig 2020-09-20 17:48:03.967820377 +0100 -+++ rng-tools 2020-09-20 18:48:01.060123787 +0100 -@@ -6,11 +6,15 @@ +--- 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 +@@ -6,9 +6,11 @@ # ### BEGIN INIT INFO # Provides: rng-tools -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog --# Default-Start: 1 2 3 4 5 +-# Default-Start: 2 3 4 5 +# Required-Start: +# Required-Stop: unmoutroot +# Should-Stop: @@ -14,12 +14,8 @@ +# Default-Start: S # Default-Stop: 0 1 6 ### END INIT INFO -+ -+ # - # - # $Id: rng-tools.init,v 1.6.2.10 2008-06-10 19:51:37 hmh Exp $ -@@ -19,7 +23,7 @@ +@@ -19,7 +21,7 @@ DAEMON=/usr/sbin/rngd NAME=rngd DESC="Hardware RNG entropy gatherer daemon" diff --git a/stage2/01-sys-tweaks/00-patches/series b/stage2/01-sys-tweaks/00-patches/series index aee040228a..d64aa4320d 100644 --- a/stage2/01-sys-tweaks/00-patches/series +++ b/stage2/01-sys-tweaks/00-patches/series @@ -3,3 +3,4 @@ 04-inputrc.diff 05-path.diff 07-resize-init.diff +08-rng-tools.diff diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index c1836f9ca6..bccd33c746 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -2,6 +2,8 @@ install -m 755 files/resize2fs_once "${ROOTFS_DIR}/etc/init.d/" +install -m 644 files/rng-tools.service "${ROOTFS_DIR}/etc/systemd/system/" + install -d "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d" install -m 644 files/ttyoutput.conf "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d/" @@ -27,6 +29,7 @@ on_chroot << EOF systemctl disable hwclock.sh systemctl disable nfs-common systemctl disable rpcbind +systemctl enable rng-tools if [ "${ENABLE_SSH}" == "1" ]; then systemctl enable ssh else diff --git a/rng-tools.service b/stage2/01-sys-tweaks/files/rng-tools.service similarity index 100% rename from rng-tools.service rename to stage2/01-sys-tweaks/files/rng-tools.service From 5ef7d815fbf6352e355bf82f1abd7f78ab1a1695 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Mon, 21 Sep 2020 05:37:06 +0100 Subject: [PATCH 5/9] update unit file with orginator --- stage2/01-sys-tweaks/files/rng-tools.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/files/rng-tools.service b/stage2/01-sys-tweaks/files/rng-tools.service index 8090108a98..7057085879 100644 --- a/stage2/01-sys-tweaks/files/rng-tools.service +++ b/stage2/01-sys-tweaks/files/rng-tools.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1+ # -# This file is part of systemd. +# This file is provided by pi-gen. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by From d371dbed77c8d536528ca53984bdee3cb68ae691 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Mon, 21 Sep 2020 19:05:51 +0100 Subject: [PATCH 6/9] rng-tools - use same logic as by hand --- stage2/01-sys-tweaks/00-patches/series | 1 - stage2/01-sys-tweaks/01-run.sh | 4 +--- .../00-patches/01-rng-tools.diff} | 0 stage2/04-rng-tools/00-patches/series | 1 + stage2/04-rng-tools/01-run.sh | 7 +++++++ .../files/rng-tools.service | 0 6 files changed, 9 insertions(+), 4 deletions(-) rename stage2/{01-sys-tweaks/00-patches/08-rng-tools.diff => 04-rng-tools/00-patches/01-rng-tools.diff} (100%) create mode 100644 stage2/04-rng-tools/00-patches/series create mode 100755 stage2/04-rng-tools/01-run.sh rename stage2/{01-sys-tweaks => 04-rng-tools}/files/rng-tools.service (100%) diff --git a/stage2/01-sys-tweaks/00-patches/series b/stage2/01-sys-tweaks/00-patches/series index d64aa4320d..aee040228a 100644 --- a/stage2/01-sys-tweaks/00-patches/series +++ b/stage2/01-sys-tweaks/00-patches/series @@ -3,4 +3,3 @@ 04-inputrc.diff 05-path.diff 07-resize-init.diff -08-rng-tools.diff diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index bccd33c746..d286b9fac7 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -2,8 +2,6 @@ install -m 755 files/resize2fs_once "${ROOTFS_DIR}/etc/init.d/" -install -m 644 files/rng-tools.service "${ROOTFS_DIR}/etc/systemd/system/" - install -d "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d" install -m 644 files/ttyoutput.conf "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d/" @@ -29,7 +27,7 @@ on_chroot << EOF systemctl disable hwclock.sh systemctl disable nfs-common systemctl disable rpcbind -systemctl enable rng-tools +systemctl disable rng-tools if [ "${ENABLE_SSH}" == "1" ]; then systemctl enable ssh else diff --git a/stage2/01-sys-tweaks/00-patches/08-rng-tools.diff b/stage2/04-rng-tools/00-patches/01-rng-tools.diff similarity index 100% rename from stage2/01-sys-tweaks/00-patches/08-rng-tools.diff rename to stage2/04-rng-tools/00-patches/01-rng-tools.diff diff --git a/stage2/04-rng-tools/00-patches/series b/stage2/04-rng-tools/00-patches/series new file mode 100644 index 0000000000..45df89a511 --- /dev/null +++ b/stage2/04-rng-tools/00-patches/series @@ -0,0 +1 @@ +01-rng-tools.diff diff --git a/stage2/04-rng-tools/01-run.sh b/stage2/04-rng-tools/01-run.sh new file mode 100755 index 0000000000..9f42cb263c --- /dev/null +++ b/stage2/04-rng-tools/01-run.sh @@ -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 diff --git a/stage2/01-sys-tweaks/files/rng-tools.service b/stage2/04-rng-tools/files/rng-tools.service similarity index 100% rename from stage2/01-sys-tweaks/files/rng-tools.service rename to stage2/04-rng-tools/files/rng-tools.service From ea6ba078176115206426168dd5437b17205ebb19 Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 23 Mar 2021 14:46:22 +0000 Subject: [PATCH 7/9] just pidfile --- .../04-rng-tools/00-patches/01-rng-tools.diff | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/stage2/04-rng-tools/00-patches/01-rng-tools.diff b/stage2/04-rng-tools/00-patches/01-rng-tools.diff index 748ddecfcb..62f6da3017 100644 --- a/stage2/04-rng-tools/00-patches/01-rng-tools.diff +++ b/stage2/04-rng-tools/00-patches/01-rng-tools.diff @@ -1,21 +1,6 @@ --- 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 -@@ -6,9 +6,11 @@ - # - ### BEGIN INIT INFO - # Provides: rng-tools --# Required-Start: $remote_fs $syslog --# Required-Stop: $remote_fs $syslog --# Default-Start: 2 3 4 5 -+# Required-Start: -+# Required-Stop: unmoutroot -+# Should-Stop: -+# X-Start-Before: fake-hwclock -+# Default-Start: S - # Default-Stop: 0 1 6 - ### END INIT INFO - # -@@ -19,7 +21,7 @@ +@@ -19,7 +19,7 @@ DAEMON=/usr/sbin/rngd NAME=rngd DESC="Hardware RNG entropy gatherer daemon" From 06f8b0ba20196e57d4b7b27ac71ea2e733875475 Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 23 Mar 2021 15:04:54 +0000 Subject: [PATCH 8/9] update origin of file --- stage2/04-rng-tools/files/rng-tools.service | 4 ---- 1 file changed, 4 deletions(-) diff --git a/stage2/04-rng-tools/files/rng-tools.service b/stage2/04-rng-tools/files/rng-tools.service index 7057085879..fc2f48b8f9 100644 --- a/stage2/04-rng-tools/files/rng-tools.service +++ b/stage2/04-rng-tools/files/rng-tools.service @@ -2,10 +2,6 @@ # # This file is provided by pi-gen. # -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. [Unit] Description=Start rng-tools From 232e64217479cabd1a6a929ddca80bc201ea3a5b Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 23 Mar 2021 15:35:12 +0000 Subject: [PATCH 9/9] remove old dmesg --- rng-tools-dmesg.txt | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 rng-tools-dmesg.txt diff --git a/rng-tools-dmesg.txt b/rng-tools-dmesg.txt deleted file mode 100644 index e95503c835..0000000000 --- a/rng-tools-dmesg.txt +++ /dev/null @@ -1,21 +0,0 @@ -Sep 20 20:18:53 box.lan systemd[1]: Detected architecture arm. -Sep 20 20:18:53 box.lan systemd[1]: Set hostname to . -Sep 20 20:18:53 box.lan kernel: random: systemd: uninitialized urandom read (16 bytes read) -Sep 20 20:18:53 box.lan kernel: random: systemd: uninitialized urandom read (16 bytes read) -Sep 20 20:18:53 box.lan systemd[1]: Reached target Swap. -Sep 20 20:18:53 box.lan kernel: random: systemd: uninitialized urandom read (16 bytes read) -Sep 20 20:18:53 box.lan systemd[1]: Listening on Journal Socket (/dev/log). -Sep 20 20:18:53 box.lan systemd[1]: Condition check resulted in Journal Audit Socket being skipped. -Sep 20 20:18:53 box.lan systemd[1]: Started Dispatch Password Requests to Console Directory Watch. -Sep 20 20:18:53 box.lan kernel: random: crng init done -Sep 20 20:18:53 box.lan kernel: random: 7 urandom warning(s) missed due to ratelimiting -Sep 20 20:18:53 box.lan systemd-journald[140]: Journal started -Sep 20 20:18:53 box.lan systemd-journald[140]: Runtime journal (/run/log/journal/adf551f779b3429594630e1f56c98394) is 8.0M, max 191.3M, -Sep 20 20:18:53 box.lan rngd[119]: rngd 2-unofficial-mt.14 starting up... -Sep 20 20:18:53 box.lan rngd[119]: entropy feed to the kernel ready -Sep 20 20:18:53 box.lan rng-tools[114]: Starting Hardware RNG entropy gatherer daemon: rngd. -Sep 20 20:18:53 box.lan fake-hwclock[136]: Sun 20 Sep 19:18:53 UTC 2020 -Sep 20 20:18:53 box.lan systemd-fsck[145]: e2fsck 1.44.5 (15-Dec-2018) -Sep 20 20:18:53 box.lan systemd[1]: Started udev Coldplug all Devices. -Sep 20 20:18:53 box.lan systemd[1]: Starting Helper to synchronize boot up for ifupdown... -Sep 20 20:18:53 box.lan systemd[1]: Started Helper to synchronize boot up for ifupdown.