From 7b60ff4091233bd9b3cd3158e1b6c5e9e14f279e Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Tue, 16 Mar 2021 18:54:13 +0100 Subject: [PATCH] dropbear keygen --- Makefile | 5 ++--- root_overlay/etc/init.d/S40dropbearkey.sh | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 root_overlay/etc/init.d/S40dropbearkey.sh diff --git a/Makefile b/Makefile index dca12f5..8f304a3 100644 --- a/Makefile +++ b/Makefile @@ -34,8 +34,7 @@ root_overlay/bin/door.py: door_control/door.py cp $< $@ root_overlay/etc/dropbear/dropbear_ecdsa_host_key: - mkdir -p `dirname $@` - ssh-keygen -t ecdsa -f $@ + sh -c 'if [[ ! -f $@ && ! -f $@.openssh ]]; then mkdir -p `dirname $@` && ssh-keygen -t ecdsa -f $@.openssh; fi' root_overlay/etc/wpa_supplicant/wpa_supplicant.conf: mkdir -p `dirname $@` @@ -51,4 +50,4 @@ clean: menuconfig: make -C buildroot menuconfig -.PHONY: all clean sdcard.img menuconfig root_overlay +.PHONY: all clean sdcard.img menuconfig root_overlay root_overlay/etc/dropbear/dropbear_ecdsa_host_key diff --git a/root_overlay/etc/init.d/S40dropbearkey.sh b/root_overlay/etc/init.d/S40dropbearkey.sh new file mode 100644 index 0000000..b8deb28 --- /dev/null +++ b/root_overlay/etc/init.d/S40dropbearkey.sh @@ -0,0 +1,2 @@ +#!/bin/sh +[[ ! -f /etc/dropbear/dropbear_ecdsa_host_key && -f /etc/dropbear/host_key ]] && dropbearconvert openssh dropbear /etc/dropbear/host_key /etc/dropbear/dropbear_ecdsa_host_key