diff options
| author | Muhammad Shakeel <muhammad_shakeel@mentor.com> | 2013-09-04 11:04:59 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-10 23:15:15 +0100 |
| commit | c6d25fbd3f65c3744a4778d68cac3795a6fb2970 (patch) | |
| tree | d3cbb0a460ae0c013e2b003d778940880530032c /meta/recipes-connectivity | |
| parent | 42742e39d416f917640b23553b5fef8cb669c676 (diff) | |
| download | poky-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')
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] | ||
| 2 | Conflicts=sshd.service | ||
| 3 | |||
| 4 | [Socket] | ||
| 5 | ExecStartPre=@BASE_BINDIR@/mkdir -p /var/run/sshd | ||
| 6 | ListenStream=22 | ||
| 7 | Accept=yes | ||
| 8 | |||
| 9 | [Install] | ||
| 10 | WantedBy=sockets.target | ||
| 11 | Also=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] | ||
| 2 | Description=OpenSSH Per-Connection Daemon | ||
| 3 | After=sshdgenkeys.service | ||
| 4 | |||
| 5 | [Service] | ||
| 6 | ExecStart=-@SBINDIR@/sshd -i | ||
| 7 | ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID | ||
| 8 | StandardInput=socket | ||
| 9 | StandardError=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] | ||
| 2 | Description=SSH Key Generation | ||
| 3 | |||
| 4 | [Service] | ||
| 5 | ExecStart=@BINDIR@/ssh-keygen -A | ||
| 6 | Type=oneshot | ||
| 7 | RemainAfterExit=yes | ||
| 8 | |||
| 9 | [Install] | ||
| 10 | WantedBy=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 | ||
| 31 | PAM_SRC_URI = "file://sshd" | 34 | PAM_SRC_URI = "file://sshd" |
| 32 | 35 | ||
| 33 | SRC_URI[md5sum] = "be46174dcbb77ebb4ea88ef140685de1" | 36 | SRC_URI[md5sum] = "be46174dcbb77ebb4ea88ef140685de1" |
| 34 | SRC_URI[sha256sum] = "7f29b9d2ad672ae0f9e1dcbff871fc5c2e60a194e90c766432e32161b842313b" | 37 | SRC_URI[sha256sum] = "7f29b9d2ad672ae0f9e1dcbff871fc5c2e60a194e90c766432e32161b842313b" |
| 35 | 38 | ||
| 36 | inherit useradd update-rc.d update-alternatives | 39 | inherit useradd update-rc.d update-alternatives systemd |
| 37 | 40 | ||
| 38 | USERADD_PACKAGES = "${PN}-sshd" | 41 | USERADD_PACKAGES = "${PN}-sshd" |
| 39 | USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd" | 42 | USERADD_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" | |||
| 41 | INITSCRIPT_NAME_${PN}-sshd = "sshd" | 44 | INITSCRIPT_NAME_${PN}-sshd = "sshd" |
| 42 | INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9" | 45 | INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9" |
| 43 | 46 | ||
| 47 | SYSTEMD_PACKAGES = "${PN}-sshd" | ||
| 48 | SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket sshd@.service sshdgenkeys.service" | ||
| 49 | |||
| 44 | PACKAGECONFIG ??= "tcp-wrappers" | 50 | PACKAGECONFIG ??= "tcp-wrappers" |
| 45 | PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,,tcp-wrappers" | 51 | PACKAGECONFIG[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 | ||
| 98 | ALLOW_EMPTY_${PN} = "1" | 113 | ALLOW_EMPTY_${PN} = "1" |
