summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssh/openssh_8.4p1.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/openssh/openssh_8.4p1.bb')
-rw-r--r--meta/recipes-connectivity/openssh/openssh_8.4p1.bb175
1 files changed, 175 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh_8.4p1.bb b/meta/recipes-connectivity/openssh/openssh_8.4p1.bb
new file mode 100644
index 0000000000..720b238e71
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh_8.4p1.bb
@@ -0,0 +1,175 @@
1SUMMARY = "A suite of security-related network utilities based on \
2the SSH protocol including the ssh client and sshd server"
3DESCRIPTION = "Secure rlogin/rsh/rcp/telnet replacement (OpenSSH) \
4Ssh (Secure Shell) is a program for logging into a remote machine \
5and for executing commands on a remote machine."
6HOMEPAGE = "http://www.openssh.com/"
7SECTION = "console/network"
8LICENSE = "BSD & ISC & MIT"
9LIC_FILES_CHKSUM = "file://LICENCE;md5=18d9e5a8b3dd1790d73502f50426d4d3"
10
11DEPENDS = "zlib openssl virtual/crypt"
12DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
13
14SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \
15 file://sshd_config \
16 file://ssh_config \
17 file://init \
18 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
19 file://sshd.socket \
20 file://sshd@.service \
21 file://sshdgenkeys.service \
22 file://volatiles.99_sshd \
23 file://run-ptest \
24 file://fix-potential-signed-overflow-in-pointer-arithmatic.patch \
25 file://sshd_check_keys \
26 file://add-test-support-for-busybox.patch \
27 "
28SRC_URI[sha256sum] = "5a01d22e407eb1c05ba8a8f7c654d388a13e9f226e4ed33bd38748dafa1d2b24"
29
30PAM_SRC_URI = "file://sshd"
31
32inherit manpages useradd update-rc.d update-alternatives systemd
33
34USERADD_PACKAGES = "${PN}-sshd"
35USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd"
36INITSCRIPT_PACKAGES = "${PN}-sshd"
37INITSCRIPT_NAME_${PN}-sshd = "sshd"
38INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9"
39
40SYSTEMD_PACKAGES = "${PN}-sshd"
41SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket"
42
43inherit autotools-brokensep ptest
44
45PACKAGECONFIG ??= "rng-tools"
46PACKAGECONFIG[kerberos] = "--with-kerberos5,--without-kerberos5,krb5"
47PACKAGECONFIG[ldns] = "--with-ldns,--without-ldns,ldns"
48PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit"
49PACKAGECONFIG[manpages] = "--with-mantype=man,--with-mantype=cat"
50
51# Add RRECOMMENDS to rng-tools for sshd package
52PACKAGECONFIG[rng-tools] = ""
53
54EXTRA_AUTORECONF += "--exclude=aclocal"
55
56# login path is hardcoded in sshd
57EXTRA_OECONF = "'LOGIN_PROGRAM=${base_bindir}/login' \
58 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
59 --without-zlib-version-check \
60 --with-privsep-path=${localstatedir}/run/sshd \
61 --sysconfdir=${sysconfdir}/ssh \
62 --with-xauth=${bindir}/xauth \
63 --disable-strip \
64 "
65
66# musl doesn't implement wtmp/utmp
67EXTRA_OECONF_append_libc-musl = " --disable-wtmp"
68
69# Since we do not depend on libbsd, we do not want configure to use it
70# just because it finds libutil.h. But, specifying --disable-libutil
71# causes compile errors, so...
72CACHED_CONFIGUREVARS += "ac_cv_header_bsd_libutil_h=no ac_cv_header_libutil_h=no"
73
74# passwd path is hardcoded in sshd
75CACHED_CONFIGUREVARS += "ac_cv_path_PATH_PASSWD_PROG=${bindir}/passwd"
76
77# We don't want to depend on libblockfile
78CACHED_CONFIGUREVARS += "ac_cv_header_maillock_h=no"
79
80do_configure_prepend () {
81 export LD="${CC}"
82 install -m 0644 ${WORKDIR}/sshd_config ${B}/
83 install -m 0644 ${WORKDIR}/ssh_config ${B}/
84}
85
86do_compile_ptest() {
87 # skip regress/unittests/ binaries: this will silently skip
88 # unittests in run-ptests which is good because they are so slow.
89 oe_runmake regress/modpipe regress/setuid-allowed regress/netcat \
90 regress/check-perm regress/mkdtemp
91}
92
93do_install_append () {
94 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
95 install -D -m 0644 ${WORKDIR}/sshd ${D}${sysconfdir}/pam.d/sshd
96 sed -i -e 's:#UsePAM no:UsePAM yes:' ${D}${sysconfdir}/ssh/sshd_config
97 fi
98
99 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then
100 sed -i -e 's:#X11Forwarding no:X11Forwarding yes:' ${D}${sysconfdir}/ssh/sshd_config
101 fi
102
103 install -d ${D}${sysconfdir}/init.d
104 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
105 rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin
106 rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir}
107 install -d ${D}/${sysconfdir}/default/volatiles
108 install -m 644 ${WORKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd
109 install -m 0755 ${S}/contrib/ssh-copy-id ${D}${bindir}
110
111 # Create config files for read-only rootfs
112 install -d ${D}${sysconfdir}/ssh
113 install -m 644 ${D}${sysconfdir}/ssh/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly
114 sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly
115 echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
116 echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
117 echo "HostKey /var/run/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
118
119 install -d ${D}${systemd_unitdir}/system
120 install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_unitdir}/system
121 install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_unitdir}/system
122 install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_unitdir}/system
123 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
124 -e 's,@SBINDIR@,${sbindir},g' \
125 -e 's,@BINDIR@,${bindir},g' \
126 -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \
127 ${D}${systemd_unitdir}/system/sshd.socket ${D}${systemd_unitdir}/system/*.service
128
129 sed -i -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \
130 ${D}${sysconfdir}/init.d/sshd
131
132 install -D -m 0755 ${WORKDIR}/sshd_check_keys ${D}${libexecdir}/${BPN}/sshd_check_keys
133}
134
135do_install_ptest () {
136 sed -i -e "s|^SFTPSERVER=.*|SFTPSERVER=${libexecdir}/sftp-server|" regress/test-exec.sh
137 cp -r regress ${D}${PTEST_PATH}
138}
139
140ALLOW_EMPTY_${PN} = "1"
141
142PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server"
143FILES_${PN}-scp = "${bindir}/scp.${BPN}"
144FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config"
145FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd ${systemd_unitdir}/system"
146FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd ${sysconfdir}/pam.d/sshd"
147FILES_${PN}-sshd += "${libexecdir}/${BPN}/sshd_check_keys"
148FILES_${PN}-sftp = "${bindir}/sftp"
149FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"
150FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*"
151FILES_${PN}-keygen = "${bindir}/ssh-keygen"
152
153RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
154RDEPENDS_${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-keyinit pam-plugin-loginuid', '', d)}"
155RRECOMMENDS_${PN}-sshd_append_class-target = "\
156 ${@bb.utils.filter('PACKAGECONFIG', 'rng-tools', d)} \
157"
158
159# gdb would make attach-ptrace test pass rather than skip but not worth the build dependencies
160RDEPENDS_${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make sed sudo coreutils"
161
162RPROVIDES_${PN}-ssh = "ssh"
163RPROVIDES_${PN}-sshd = "sshd"
164
165RCONFLICTS_${PN} = "dropbear"
166RCONFLICTS_${PN}-sshd = "dropbear"
167
168CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config"
169CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config"
170
171ALTERNATIVE_PRIORITY = "90"
172ALTERNATIVE_${PN}-scp = "scp"
173ALTERNATIVE_${PN}-ssh = "ssh"
174
175BBCLASSEXTEND += "nativesdk"