summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-core/dropbear/dropbear.inc17
-rw-r--r--meta/recipes-core/dropbear/dropbear/dropbear.socket10
-rw-r--r--meta/recipes-core/dropbear/dropbear/dropbear@.service11
-rw-r--r--meta/recipes-core/dropbear/dropbear/dropbearkey.service8
4 files changed, 45 insertions, 1 deletions
diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc
index e85a9e6678..d5fceec687 100644
--- a/meta/recipes-core/dropbear/dropbear.inc
+++ b/meta/recipes-core/dropbear/dropbear.inc
@@ -19,17 +19,22 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
19 file://0004-fix-2kb-keys.patch \ 19 file://0004-fix-2kb-keys.patch \
20 file://0007-dropbear-fix-for-x32-abi.patch \ 20 file://0007-dropbear-fix-for-x32-abi.patch \
21 file://init \ 21 file://init \
22 file://dropbearkey.service \
23 file://dropbear@.service \
24 file://dropbear.socket \
22 ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} " 25 ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} "
23 26
24PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \ 27PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
25 file://0006-dropbear-configuration-file.patch \ 28 file://0006-dropbear-configuration-file.patch \
26 file://dropbear" 29 file://dropbear"
27 30
28inherit autotools update-rc.d 31inherit autotools update-rc.d systemd
29 32
30INITSCRIPT_NAME = "dropbear" 33INITSCRIPT_NAME = "dropbear"
31INITSCRIPT_PARAMS = "defaults 10" 34INITSCRIPT_PARAMS = "defaults 10"
32 35
36SYSTEMD_SERVICE_${PN} = "dropbear.socket"
37
33CFLAGS_prepend = " -I. " 38CFLAGS_prepend = " -I. "
34LD = "${CC}" 39LD = "${CC}"
35 40
@@ -66,6 +71,16 @@ do_install() {
66 install -d ${D}${sysconfdir}/pam.d 71 install -d ${D}${sysconfdir}/pam.d
67 install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/ 72 install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/
68 fi 73 fi
74
75 # deal with systemd unit files
76 install -d ${D}${systemd_unitdir}/system
77 install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_unitdir}/system
78 install -m 0644 ${WORKDIR}/dropbear@.service ${D}${systemd_unitdir}/system
79 install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_unitdir}/system
80 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
81 -e 's,@BINDIR@,${bindir},g' \
82 -e 's,@SBINDIR@,${sbindir},g' \
83 ${D}${systemd_unitdir}/system/dropbear.socket ${D}${systemd_unitdir}/system/*.service
69} 84}
70 85
71inherit update-alternatives 86inherit update-alternatives
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear.socket b/meta/recipes-core/dropbear/dropbear/dropbear.socket
new file mode 100644
index 0000000000..e5c61b755e
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbear.socket
@@ -0,0 +1,10 @@
1[Unit]
2Conflicts=dropbear.service
3
4[Socket]
5ListenStream=22
6Accept=yes
7
8[Install]
9WantedBy=sockets.target
10Also=dropbearkey.service
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear@.service b/meta/recipes-core/dropbear/dropbear/dropbear@.service
new file mode 100644
index 0000000000..6fe9942090
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbear@.service
@@ -0,0 +1,11 @@
1[Unit]
2Description=SSH Per-Connection Server
3Wants=dropbearkey.service
4After=syslog.target dropbearkey.service
5
6[Service]
7EnvironmentFile=-/etc/default/dropbear
8ExecStart=-@SBINDIR@/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key $DROPBEAR_EXTRA_ARGS
9ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
10StandardInput=socket
11KillMode=process
diff --git a/meta/recipes-core/dropbear/dropbear/dropbearkey.service b/meta/recipes-core/dropbear/dropbear/dropbearkey.service
new file mode 100644
index 0000000000..ccc21d5cca
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbearkey.service
@@ -0,0 +1,8 @@
1[Unit]
2Description=SSH Key Generation
3ConditionPathExists=|!/etc/dropbear/dropbear_rsa_host_key
4
5[Service]
6Type=oneshot
7ExecStart=@SBINDIR@/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
8RemainAfterExit=yes