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