Skip to content

Commit e478646

Browse files
committed
Move fix guysoft/OctoPi#424 in to mainline
1 parent 7b693e0 commit e478646

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/modules/base/start_chroot_script

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ then
4343

4444
### Fix SSH outgoing
4545
echo "IPQoS 0x00" >> /etc/ssh/ssh_config
46+
47+
### Try and fix https://github.com/guysoft/OctoPi/issues/424
48+
sed -i "s@ExecStart=/usr/bin/ssh-keygen -A -v@ExecStart=/bin/bash -c ' /usr/bin/ssh-keygen -A -v >> /var/log/regenerate_ssh_host_keys.log 2>\&1'@g" /lib/systemd/system/regenerate_ssh_host_keys.service
49+
sed -i "s@ExecStartPost=/bin/systemctl disable regenerate_ssh_host_keys@ExecStartPost=/bin/bash -c 'for i in /etc/ssh/ssh_host_*_key*; do actualsize=\$(wc -c <\"\$i\") ;if [ \$actualsize -eq 0 ]; then echo size is 0 bytes ; exit 1 ; fi ; done ; /bin/systemctl disable regenerate_ssh_host_keys'@g" /lib/systemd/system/regenerate_ssh_host_keys.service
4650
fi
4751

4852
# Store version buildbase
@@ -81,4 +85,4 @@ if [ $BASE_CONFIG_KEYBOARD != 'default' ]
8185
then
8286
echo "Configuring keyboard"
8387
raspi-config nonint do_configure_keyboard $BASE_CONFIG_KEYBOARD
84-
fi
88+
fi

0 commit comments

Comments
 (0)