mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-05-07 05:10:20 +00:00
dropbear-systemd: config files for socket-based activation of dropbear
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
[Unit]
|
||||||
|
Conflicts=dropbear.service
|
||||||
|
|
||||||
|
[Socket]
|
||||||
|
ListenStream=22
|
||||||
|
Accept=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sockets.target
|
||||||
|
Also=dropbearkey.service
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=SSH Per-Connection Server
|
||||||
|
Requires=dropbearkey.service
|
||||||
|
After=syslog.target dropbearkey.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=-/usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -p 22
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
StandardInput=socket
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=SSH Key Generation
|
||||||
|
ConditionPathExists=|!/etc/dropbear/dropbear_rsa_host_key
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/sbin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
40
meta-oe/recipes-core/dropbear/dropbear-systemd_v1.bb
Normal file
40
meta-oe/recipes-core/dropbear/dropbear-systemd_v1.bb
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
DESCRIPTION = "Socket based activation for dropbear ssh server"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
|
||||||
|
|
||||||
|
inherit allarch
|
||||||
|
|
||||||
|
SRC_URI = "file://dropbearkey.service \
|
||||||
|
file://dropbear@.service \
|
||||||
|
file://dropbear.socket \
|
||||||
|
"
|
||||||
|
|
||||||
|
do_configure() {
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
do_compile() {
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install() {
|
||||||
|
install -d ${D}${base_libdir}/systemd/system
|
||||||
|
install -m 0644 ${WORKDIR}/dropbear*.* ${D}${base_libdir}/systemd/system/
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst_${PN} () {
|
||||||
|
if test "x$D" != "x"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
systemctl enable dropbear.socket
|
||||||
|
ln -sf /dev/null ${base_libdir}/systemd/system/dropbear.service
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postrm_${PN} () {
|
||||||
|
systemctl disable dropbear.socket
|
||||||
|
rm -f ${base_libdir}/systemd/system/dropbear.service
|
||||||
|
}
|
||||||
|
|
||||||
|
RDEPENDS_${PN} = "systemd dropbear"
|
||||||
|
FILES_${PN} = "${base_libdir}/systemd/system"
|
||||||
|
|
||||||
Reference in New Issue
Block a user