diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2014-01-16 04:24:53 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-28 00:52:31 +0000 |
commit | ab2e677df0a95dc52b32401fa77f63710f346c54 (patch) | |
tree | 0a3010737315bcb6deb687be7e404dfe763f974d /meta/recipes-core | |
parent | 330e5ebd1f66f01736b8121c6641ae00afc1010a (diff) | |
download | poky-ab2e677df0a95dc52b32401fa77f63710f346c54.tar.gz |
dropbear: add systemd unit files
This patch mainly comes from meta-systemd with a few modifications.
The purpose is to get rid of the LSB init scripts in systemd images.
[YOCTO #4420]
(From OE-Core rev: 5d90c5ebdb899b2951c97a94ff57867c1e491c15)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/dropbear/dropbear.inc | 17 | ||||
-rw-r--r-- | meta/recipes-core/dropbear/dropbear/dropbear.socket | 10 | ||||
-rw-r--r-- | meta/recipes-core/dropbear/dropbear/dropbear@.service | 11 | ||||
-rw-r--r-- | meta/recipes-core/dropbear/dropbear/dropbearkey.service | 8 |
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 | ||
24 | PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \ | 27 | PAM_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 | ||
28 | inherit autotools update-rc.d | 31 | inherit autotools update-rc.d systemd |
29 | 32 | ||
30 | INITSCRIPT_NAME = "dropbear" | 33 | INITSCRIPT_NAME = "dropbear" |
31 | INITSCRIPT_PARAMS = "defaults 10" | 34 | INITSCRIPT_PARAMS = "defaults 10" |
32 | 35 | ||
36 | SYSTEMD_SERVICE_${PN} = "dropbear.socket" | ||
37 | |||
33 | CFLAGS_prepend = " -I. " | 38 | CFLAGS_prepend = " -I. " |
34 | LD = "${CC}" | 39 | LD = "${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 | ||
71 | inherit update-alternatives | 86 | inherit 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] | ||
2 | Conflicts=dropbear.service | ||
3 | |||
4 | [Socket] | ||
5 | ListenStream=22 | ||
6 | Accept=yes | ||
7 | |||
8 | [Install] | ||
9 | WantedBy=sockets.target | ||
10 | Also=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] | ||
2 | Description=SSH Per-Connection Server | ||
3 | Wants=dropbearkey.service | ||
4 | After=syslog.target dropbearkey.service | ||
5 | |||
6 | [Service] | ||
7 | EnvironmentFile=-/etc/default/dropbear | ||
8 | ExecStart=-@SBINDIR@/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key $DROPBEAR_EXTRA_ARGS | ||
9 | ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID | ||
10 | StandardInput=socket | ||
11 | KillMode=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] | ||
2 | Description=SSH Key Generation | ||
3 | ConditionPathExists=|!/etc/dropbear/dropbear_rsa_host_key | ||
4 | |||
5 | [Service] | ||
6 | Type=oneshot | ||
7 | ExecStart=@SBINDIR@/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key | ||
8 | RemainAfterExit=yes | ||