diff --git a/raspberrypi/recipes/pi3-pi4.sh b/raspberrypi/recipes/pi3-pi4.sh index 78e4125..ca505b5 100644 --- a/raspberrypi/recipes/pi3-pi4.sh +++ b/raspberrypi/recipes/pi3-pi4.sh @@ -14,6 +14,11 @@ toast_me() { echo "pi:raspberry" | chroot $MNT chpasswd # Force generate SSH host keys if they exist rm -f $MNT/etc/ssh/ssh_host_* + # Work around longstanding bug (ssh fails to start until host keys + # have been generated on the target), until it's fixed upstream: + if ! grep -qs ^Before= $MNT/etc/systemd/system/rpi-generate-ssh-host-keys.service; then + sed '/^Description=/a Before=sshd.service' -i $MNT/etc/systemd/system/rpi-generate-ssh-host-keys.service + fi # Change the hostname echo "127.0.1.1 pirogue.local pirogue" >> $MNT/etc/hosts echo "::1 pirogue.local pirogue" >> $MNT/etc/hosts