summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-core/dropbear/dropbear-systemd/dropbear.socket10
-rw-r--r--meta-oe/recipes-core/dropbear/dropbear-systemd/dropbear@.service9
-rw-r--r--meta-oe/recipes-core/dropbear/dropbear-systemd/dropbearkey.service10
-rw-r--r--meta-oe/recipes-core/dropbear/dropbear-systemd_v1.bb40
4 files changed, 69 insertions, 0 deletions
diff --git a/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbear.socket b/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbear.socket
new file mode 100644
index 000000000..e5c61b755
--- /dev/null
+++ b/meta-oe/recipes-core/dropbear/dropbear-systemd/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-oe/recipes-core/dropbear/dropbear-systemd/dropbear@.service b/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbear@.service
new file mode 100644
index 000000000..4fba3f05c
--- /dev/null
+++ b/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbear@.service
@@ -0,0 +1,9 @@
1[Unit]
2Description=SSH Per-Connection Server
3Requires=dropbearkey.service
4After=syslog.target dropbearkey.service
5
6[Service]
7ExecStart=-/usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -p 22
8ExecReload=/bin/kill -HUP $MAINPID
9StandardInput=socket
diff --git a/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbearkey.service b/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbearkey.service
new file mode 100644
index 000000000..7f03000eb
--- /dev/null
+++ b/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbearkey.service
@@ -0,0 +1,10 @@
1[Unit]
2Description=SSH Key Generation
3ConditionPathExists=|!/etc/dropbear/dropbear_rsa_host_key
4
5[Service]
6ExecStart=/usr/sbin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
7RemainAfterExit=yes
8
9[Install]
10WantedBy=multi-user.target
diff --git a/meta-oe/recipes-core/dropbear/dropbear-systemd_v1.bb b/meta-oe/recipes-core/dropbear/dropbear-systemd_v1.bb
new file mode 100644
index 000000000..b46c0e2a4
--- /dev/null
+++ b/meta-oe/recipes-core/dropbear/dropbear-systemd_v1.bb
@@ -0,0 +1,40 @@
1DESCRIPTION = "Socket based activation for dropbear ssh server"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
4
5inherit allarch
6
7SRC_URI = "file://dropbearkey.service \
8 file://dropbear@.service \
9 file://dropbear.socket \
10 "
11
12do_configure() {
13 :
14}
15
16do_compile() {
17 :
18}
19
20do_install() {
21 install -d ${D}${base_libdir}/systemd/system
22 install -m 0644 ${WORKDIR}/dropbear*.* ${D}${base_libdir}/systemd/system/
23}
24
25pkg_postinst_${PN} () {
26if test "x$D" != "x"; then
27 exit 1
28fi
29systemctl enable dropbear.socket
30ln -sf /dev/null ${base_libdir}/systemd/system/dropbear.service
31}
32
33pkg_postrm_${PN} () {
34systemctl disable dropbear.socket
35rm -f ${base_libdir}/systemd/system/dropbear.service
36}
37
38RDEPENDS_${PN} = "systemd dropbear"
39FILES_${PN} = "${base_libdir}/systemd/system"
40