summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity
diff options
context:
space:
mode:
authorMuhammad Shakeel <muhammad_shakeel@mentor.com>2013-09-04 11:04:59 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-10 23:15:15 +0100
commitc6d25fbd3f65c3744a4778d68cac3795a6fb2970 (patch)
treed3cbb0a460ae0c013e2b003d778940880530032c /meta/recipes-connectivity
parent42742e39d416f917640b23553b5fef8cb669c676 (diff)
downloadpoky-c6d25fbd3f65c3744a4778d68cac3795a6fb2970.tar.gz
openssh: Add systemd support
-Remove dependency on meta-systemd (From OE-Core rev: 6e6445d487c033913a29763f8e3a7a339d5b612d) Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity')
-rw-r--r--meta/recipes-connectivity/openssh/openssh-6.2p2/sshd.socket11
-rw-r--r--meta/recipes-connectivity/openssh/openssh-6.2p2/sshd@.service9
-rw-r--r--meta/recipes-connectivity/openssh/openssh-6.2p2/sshdgenkeys.service10
-rw-r--r--meta/recipes-connectivity/openssh/openssh_6.2p2.bb19
4 files changed, 47 insertions, 2 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh-6.2p2/sshd.socket b/meta/recipes-connectivity/openssh/openssh-6.2p2/sshd.socket
new file mode 100644
index 0000000000..d19ab2ac43
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh-6.2p2/sshd.socket
@@ -0,0 +1,11 @@
1[Unit]
2Conflicts=sshd.service
3
4[Socket]
5ExecStartPre=@BASE_BINDIR@/mkdir -p /var/run/sshd
6ListenStream=22
7Accept=yes
8
9[Install]
10WantedBy=sockets.target
11Also=sshdgenkeys.service
diff --git a/meta/recipes-connectivity/openssh/openssh-6.2p2/sshd@.service b/meta/recipes-connectivity/openssh/openssh-6.2p2/sshd@.service
new file mode 100644
index 0000000000..64e009ff00
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh-6.2p2/sshd@.service
@@ -0,0 +1,9 @@
1[Unit]
2Description=OpenSSH Per-Connection Daemon
3After=sshdgenkeys.service
4
5[Service]
6ExecStart=-@SBINDIR@/sshd -i
7ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
8StandardInput=socket
9StandardError=syslog
diff --git a/meta/recipes-connectivity/openssh/openssh-6.2p2/sshdgenkeys.service b/meta/recipes-connectivity/openssh/openssh-6.2p2/sshdgenkeys.service
new file mode 100644
index 0000000000..2fd8a9aaf2
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh-6.2p2/sshdgenkeys.service
@@ -0,0 +1,10 @@
1[Unit]
2Description=SSH Key Generation
3
4[Service]
5ExecStart=@BINDIR@/ssh-keygen -A
6Type=oneshot
7RemainAfterExit=yes
8
9[Install]
10WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/openssh/openssh_6.2p2.bb b/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
index c76f9ac7ee..3a7f50d5fb 100644
--- a/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
+++ b/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
@@ -26,14 +26,17 @@ SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.
26 file://init \ 26 file://init \
27 file://openssh-CVE-2011-4327.patch \ 27 file://openssh-CVE-2011-4327.patch \
28 file://mac.patch \ 28 file://mac.patch \
29 ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}" 29 ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
30 file://sshd.socket \
31 file://sshd@.service \
32 file://sshdgenkeys.service "
30 33
31PAM_SRC_URI = "file://sshd" 34PAM_SRC_URI = "file://sshd"
32 35
33SRC_URI[md5sum] = "be46174dcbb77ebb4ea88ef140685de1" 36SRC_URI[md5sum] = "be46174dcbb77ebb4ea88ef140685de1"
34SRC_URI[sha256sum] = "7f29b9d2ad672ae0f9e1dcbff871fc5c2e60a194e90c766432e32161b842313b" 37SRC_URI[sha256sum] = "7f29b9d2ad672ae0f9e1dcbff871fc5c2e60a194e90c766432e32161b842313b"
35 38
36inherit useradd update-rc.d update-alternatives 39inherit useradd update-rc.d update-alternatives systemd
37 40
38USERADD_PACKAGES = "${PN}-sshd" 41USERADD_PACKAGES = "${PN}-sshd"
39USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd" 42USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd"
@@ -41,6 +44,9 @@ INITSCRIPT_PACKAGES = "${PN}-sshd"
41INITSCRIPT_NAME_${PN}-sshd = "sshd" 44INITSCRIPT_NAME_${PN}-sshd = "sshd"
42INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9" 45INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9"
43 46
47SYSTEMD_PACKAGES = "${PN}-sshd"
48SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket sshd@.service sshdgenkeys.service"
49
44PACKAGECONFIG ??= "tcp-wrappers" 50PACKAGECONFIG ??= "tcp-wrappers"
45PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,,tcp-wrappers" 51PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,,tcp-wrappers"
46 52
@@ -93,6 +99,15 @@ do_install_append () {
93 echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly 99 echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
94 echo "HostKey /var/run/ssh/ssh_host_dsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly 100 echo "HostKey /var/run/ssh/ssh_host_dsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
95 echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly 101 echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
102
103 install -d ${D}${systemd_unitdir}/system
104 install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_unitdir}/system
105 install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_unitdir}/system
106 install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_unitdir}/system
107 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
108 -e 's,@SBINDIR@,${sbindir},g' \
109 -e 's,@BINDIR@,${bindir},g' \
110 ${D}${systemd_unitdir}/system/sshd.socket ${D}${systemd_unitdir}/system/*.service
96} 111}
97 112
98ALLOW_EMPTY_${PN} = "1" 113ALLOW_EMPTY_${PN} = "1"