Skip to content

Commit e316744

Browse files
committed
v8.4
- DietPi-PREP | Apply haveged bug workaround for ARMv7 - DietPi-Patches | Bring forward haveged workaround for ARMv7 and merge another workaround for ARM on Buster.
1 parent 6f2b89e commit e316744

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

.update/patches

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ Patch_7_3()
186186
# This is required to call our software CLI wrapper scripts, which contain "sudo -u <service_user>" to assure correct config and data is loaded.
187187
[[ -f '/etc/sudoers.d/dietpi' ]] && echo 'dietpi ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/dietpi
188188

189-
# When haveged from Bullseye was installed on Buster (on ARM to workaround a bug), mark the related library as auto-installed so that it can be autoremoved when haveged itself is removed.
190-
dpkg-query -s haveged &> /dev/null && dpkg-query -s libhavege2 &> /dev/null && G_EXEC apt-mark auto libhavege2
191-
192189
# Update DietPi-Backup filter file
193190
if [[ -f '/boot/dietpi/.dietpi-backup_inc_exc' && $(head -1 /boot/dietpi/.dietpi-backup_inc_exc) != '# DietPi-Backup include/exclude filter' ]]
194191
then
@@ -306,17 +303,8 @@ Patch_7_6()
306303
G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/buster/haveged_$G_HW_ARCH_NAME.deb"
307304
G_AGI "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb"
308305
G_EXEC rm "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb"
309-
fi
310-
311-
# https://github.com/MichaIng/DietPi/issues/4710
312-
if [[ $G_DISTRO -ge 5 && $G_HW_ARCH == 2 ]] && dpkg-query -s haveged &> /dev/null
313-
then
314-
G_DIETPI-NOTIFY 2 'Applying workaround for haveged entropy daemon bug:'
315-
G_DIETPI-NOTIFY 2 ' - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=985196'
316-
G_EXEC mkdir -p /etc/systemd/system/haveged.service.d
317-
G_EXEC eval "echo -e '[Service]\nSystemCallFilter=uname' > /etc/systemd/system/haveged.service.d/dietpi.conf"
318-
G_EXEC systemctl daemon-reload
319-
G_EXEC systemctl restart haveged
306+
# Mark the library as auto-installed so that it can be autoremoved when haveged itself is removed.
307+
G_EXEC apt-mark auto libhavege2
320308
fi
321309
}
322310

@@ -743,6 +731,16 @@ Patch_8_4()
743731
G_EXEC rm /etc/kernel/preinst.d/dietpi-initramfs_cleanup
744732
G_EXEC rmdir --ignore-fail-on-non-empty /etc/kernel/preinst.d
745733
fi
734+
735+
# https://github.com/MichaIng/DietPi/issues/4710
736+
if (( $G_HW_ARCH == 2 )) && dpkg-query -s haveged &> /dev/null
737+
then
738+
G_DIETPI-NOTIFY 2 'Applying workaround for haveged entropy daemon bug: https://bugs.debian.org/985196'
739+
[[ -d '/etc/systemd/system/haveged.service.d' ]] || G_EXEC mkdir /etc/systemd/system/haveged.service.d
740+
G_EXEC eval 'echo -e '\''[Service]\nSystemCallFilter=uname'\'' > /etc/systemd/system/haveged.service.d/dietpi.conf'
741+
G_EXEC systemctl daemon-reload
742+
G_EXEC systemctl restart haveged
743+
fi
746744
}
747745

748746
# v6.35 => v7 migration

PREP_SYSTEM_FOR_DIETPI.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,13 @@ _EOF_
688688
aPACKAGES_REQUIRED_INSTALL+=('rng-tools5')
689689
else
690690
aPACKAGES_REQUIRED_INSTALL+=('haveged')
691+
# https://github.com/MichaIng/DietPi/issues/4710
692+
if (( $G_HW_ARCH == 2 ))
693+
then
694+
G_DIETPI-NOTIFY 2 'Applying workaround for haveged entropy daemon bug: https://bugs.debian.org/985196'
695+
[[ -d '/etc/systemd/system/haveged.service.d' ]] || G_EXEC mkdir /etc/systemd/system/haveged.service.d
696+
G_EXEC eval 'echo -e '\''[Service]\nSystemCallFilter=uname'\'' > /etc/systemd/system/haveged.service.d/dietpi.conf'
697+
fi
691698
fi
692699

693700
# G_DISTRO specific

0 commit comments

Comments
 (0)