2 ## Copyright (C) 2019 Wind River Systems, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
19 SRCREV = "d778e862571957ece3c404c0c37d325769772fde"
22 file://stx/sshd.init \
23 file://stx/sshd-keygen \
24 file://stx/sshd-keygen.service \
25 file://stx/sshd.sysconfig \
26 git://opendev.org/starlingx/config-files.git;protocol=https;rev=${SRCREV};branch=${BRANCH};destsuffix=stx-configfiles;subpath=openssh-config \
27 file://openssh-config-rm-hmac-ripemd160.patch \
31 bb.build.exec_func('do_copy_config_files', d)
34 do_copy_config_files () {
35 cp -f ${WORKDIR}/stx-configfiles/files/sshd_config ${S}
36 # remove the unsupported and deprecated options
37 sed -i -e 's/^\(GSSAPIAuthentication.*\)/#\1/' \
38 -e 's/^\(GSSAPICleanupCredentials.*\)/#\1/' \
39 -e 's/^\(UsePrivilegeSeparation.*\)/#\1/' \
41 cp -f ${WORKDIR}/stx-configfiles/files/ssh_config ${S}
44 SYSTEMD_SERVICE_${PN}-sshd = "sshd.service"
46 do_install_append () {
47 rm -f ${D}${systemd_system_unitdir}/sshd.socket
48 rm -f ${D}${systemd_system_unitdir}/sshd@service.socket
49 rm -f ${D}${systemd_system_unitdir}/sshdgenkeys.service
51 install -d ${D}/${sysconfdir}/init.d/
52 install -m 755 ${WORKDIR}/stx/sshd.init ${D}/${sysconfdir}/init.d/sshd
54 install -d ${D}/${sysconfdir}/sysconfig/
55 install -m 644 ${WORKDIR}/stx/sshd.sysconfig ${D}/${sysconfdir}/sysconfig/sshd
57 install -m 755 ${WORKDIR}/stx/sshd-keygen ${D}/${sbindir}/sshd-keygen
58 install -m644 ${WORKDIR}/stx-configfiles/files/sshd.service ${D}/${systemd_system_unitdir}/sshd.service
59 install -m644 ${WORKDIR}/stx/sshd-keygen.service ${D}/${systemd_system_unitdir}/sshd-keygen.service
61 install -d ${D}/${sysconfdir}/tmpfiles.d
62 echo "d ${localstatedir}/run/sshd 0755 root root -" >> ${D}/${sysconfdir}/tmpfiles.d/sshd.conf
66 RDEPENDS_${PN} += "bash"
67 RDEPENDS_${PN}-sshd += "bash"
69 # allow both systemd service and sysvinit scripts are installed
70 DISTRO_FEATURES_BACKFILL_CONSIDERED_remove = "sysvinit"
72 USERADD_PARAM_${PN}-sshd = "-r -d /var/empty/sshd -s /sbin/nologin -g sshd -c 'Privilege-separated SSH' sshd"
73 GROUPADD_PARAM_${PN}-sshd = "-r ssh_keys; -r sshd"