diff options
Diffstat (limited to 'meta/recipes-core/dropbear/dropbear_2022.82.bb')
-rw-r--r-- | meta/recipes-core/dropbear/dropbear_2022.82.bb | 129 |
1 files changed, 128 insertions, 1 deletions
diff --git a/meta/recipes-core/dropbear/dropbear_2022.82.bb b/meta/recipes-core/dropbear/dropbear_2022.82.bb index 154a407a19..2de243b889 100644 --- a/meta/recipes-core/dropbear/dropbear_2022.82.bb +++ b/meta/recipes-core/dropbear/dropbear_2022.82.bb | |||
@@ -1,3 +1,130 @@ | |||
1 | require dropbear.inc | 1 | SUMMARY = "A lightweight SSH and SCP implementation" |
2 | HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html" | ||
3 | DESCRIPTION = "Dropbear is a relatively small SSH server and client. It runs on a variety of POSIX-based platforms. Dropbear is open source software, distributed under a MIT-style license. Dropbear is particularly useful for "embedded"-type Linux (or other Unix) systems, such as wireless routers." | ||
4 | SECTION = "console/network" | ||
5 | |||
6 | # some files are from other projects and have others license terms: | ||
7 | # public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY | ||
8 | LICENSE = "MIT & BSD-3-Clause & BSD-2-Clause & PD" | ||
9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=25cf44512b7bc8966a48b6b1a9b7605f" | ||
10 | |||
11 | DEPENDS = "zlib virtual/crypt" | ||
12 | RPROVIDES:${PN} = "ssh sshd" | ||
13 | RCONFLICTS:${PN} = "openssh-sshd openssh" | ||
14 | |||
15 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
16 | |||
17 | SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \ | ||
18 | file://0001-urandom-xauth-changes-to-options.h.patch \ | ||
19 | file://init \ | ||
20 | file://dropbearkey.service \ | ||
21 | file://dropbear@.service \ | ||
22 | file://dropbear.socket \ | ||
23 | file://dropbear.default \ | ||
24 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ | ||
25 | ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} " | ||
2 | 26 | ||
3 | SRC_URI[sha256sum] = "3a038d2bbc02bf28bbdd20c012091f741a3ec5cbe460691811d714876aad75d1" | 27 | SRC_URI[sha256sum] = "3a038d2bbc02bf28bbdd20c012091f741a3ec5cbe460691811d714876aad75d1" |
28 | |||
29 | PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \ | ||
30 | file://0006-dropbear-configuration-file.patch \ | ||
31 | file://dropbear" | ||
32 | |||
33 | PAM_PLUGINS = "libpam-runtime \ | ||
34 | pam-plugin-deny \ | ||
35 | pam-plugin-permit \ | ||
36 | pam-plugin-unix \ | ||
37 | " | ||
38 | RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}" | ||
39 | |||
40 | inherit autotools update-rc.d systemd | ||
41 | |||
42 | CVE_PRODUCT = "dropbear_ssh" | ||
43 | |||
44 | INITSCRIPT_NAME = "dropbear" | ||
45 | INITSCRIPT_PARAMS = "defaults 10" | ||
46 | |||
47 | SYSTEMD_SERVICE:${PN} = "dropbear.socket" | ||
48 | |||
49 | SBINCOMMANDS = "dropbear dropbearkey dropbearconvert" | ||
50 | BINCOMMANDS = "dbclient ssh scp" | ||
51 | EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"' | ||
52 | |||
53 | PACKAGECONFIG ?= "disable-weak-ciphers" | ||
54 | PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt" | ||
55 | PACKAGECONFIG[disable-weak-ciphers] = "" | ||
56 | |||
57 | EXTRA_OECONF += "\ | ||
58 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}" | ||
59 | |||
60 | # This option appends to CFLAGS and LDFLAGS from OE | ||
61 | # This is causing [textrel] QA warning | ||
62 | EXTRA_OECONF += "--disable-harden" | ||
63 | |||
64 | # musl does not implement wtmp/logwtmp APIs | ||
65 | EXTRA_OECONF:append:libc-musl = " --disable-wtmp --disable-lastlog" | ||
66 | |||
67 | do_install() { | ||
68 | install -d ${D}${sysconfdir} \ | ||
69 | ${D}${sysconfdir}/init.d \ | ||
70 | ${D}${sysconfdir}/default \ | ||
71 | ${D}${sysconfdir}/dropbear \ | ||
72 | ${D}${bindir} \ | ||
73 | ${D}${sbindir} \ | ||
74 | ${D}${localstatedir} | ||
75 | |||
76 | install -m 0644 ${WORKDIR}/dropbear.default ${D}${sysconfdir}/default/dropbear | ||
77 | |||
78 | install -m 0755 dropbearmulti ${D}${sbindir}/ | ||
79 | |||
80 | for i in ${BINCOMMANDS} | ||
81 | do | ||
82 | # ssh and scp symlinks are created by update-alternatives | ||
83 | if [ $i = ssh ] || [ $i = scp ]; then continue; fi | ||
84 | ln -s ${sbindir}/dropbearmulti ${D}${bindir}/$i | ||
85 | done | ||
86 | for i in ${SBINCOMMANDS} | ||
87 | do | ||
88 | ln -s ./dropbearmulti ${D}${sbindir}/$i | ||
89 | done | ||
90 | sed -e 's,/etc,${sysconfdir},g' \ | ||
91 | -e 's,/usr/sbin,${sbindir},g' \ | ||
92 | -e 's,/var,${localstatedir},g' \ | ||
93 | -e 's,/usr/bin,${bindir},g' \ | ||
94 | -e 's,/usr,${prefix},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/dropbear | ||
95 | chmod 755 ${D}${sysconfdir}/init.d/dropbear | ||
96 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then | ||
97 | install -d ${D}${sysconfdir}/pam.d | ||
98 | install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/ | ||
99 | fi | ||
100 | |||
101 | # deal with systemd unit files | ||
102 | install -d ${D}${systemd_system_unitdir} | ||
103 | install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_system_unitdir} | ||
104 | install -m 0644 ${WORKDIR}/dropbear@.service ${D}${systemd_system_unitdir} | ||
105 | install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_system_unitdir} | ||
106 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ | ||
107 | -e 's,@BINDIR@,${bindir},g' \ | ||
108 | -e 's,@SBINDIR@,${sbindir},g' \ | ||
109 | ${D}${systemd_system_unitdir}/dropbear.socket ${D}${systemd_system_unitdir}/*.service | ||
110 | } | ||
111 | |||
112 | inherit update-alternatives | ||
113 | |||
114 | ALTERNATIVE_PRIORITY = "20" | ||
115 | ALTERNATIVE:${PN} = "${@bb.utils.filter('BINCOMMANDS', 'scp ssh', d)}" | ||
116 | |||
117 | ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti" | ||
118 | |||
119 | pkg_postrm:${PN} () { | ||
120 | if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then | ||
121 | rm ${sysconfdir}/dropbear/dropbear_rsa_host_key | ||
122 | fi | ||
123 | if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then | ||
124 | rm ${sysconfdir}/dropbear/dropbear_dss_host_key | ||
125 | fi | ||
126 | } | ||
127 | |||
128 | CONFFILES:${PN} = "${sysconfdir}/default/dropbear" | ||
129 | |||
130 | FILES:${PN} += "${bindir}" | ||