diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-08-11 21:58:00 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-14 08:13:32 +0100 |
commit | 85437a157e80df7ee210a94d1887777ad4eac657 (patch) | |
tree | 1aeac58b1e5b4263928117b4c1d489bc2b864b81 /meta/recipes-core/dropbear | |
parent | 6f892f5384ff21977325834ffe4a0ea8e28b2425 (diff) | |
download | poky-85437a157e80df7ee210a94d1887777ad4eac657.tar.gz |
dropbear: merge .inc into .bb
(From OE-Core rev: e4e21f272a897bd89ffbc9d057db56eae944c70b)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/dropbear')
-rw-r--r-- | meta/recipes-core/dropbear/dropbear.inc | 128 | ||||
-rw-r--r-- | meta/recipes-core/dropbear/dropbear_2022.82.bb | 129 |
2 files changed, 128 insertions, 129 deletions
diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc deleted file mode 100644 index e170587d08..0000000000 --- a/meta/recipes-core/dropbear/dropbear.inc +++ /dev/null | |||
@@ -1,128 +0,0 @@ | |||
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)} " | ||
26 | |||
27 | PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \ | ||
28 | file://0006-dropbear-configuration-file.patch \ | ||
29 | file://dropbear" | ||
30 | |||
31 | PAM_PLUGINS = "libpam-runtime \ | ||
32 | pam-plugin-deny \ | ||
33 | pam-plugin-permit \ | ||
34 | pam-plugin-unix \ | ||
35 | " | ||
36 | RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}" | ||
37 | |||
38 | inherit autotools update-rc.d systemd | ||
39 | |||
40 | CVE_PRODUCT = "dropbear_ssh" | ||
41 | |||
42 | INITSCRIPT_NAME = "dropbear" | ||
43 | INITSCRIPT_PARAMS = "defaults 10" | ||
44 | |||
45 | SYSTEMD_SERVICE:${PN} = "dropbear.socket" | ||
46 | |||
47 | SBINCOMMANDS = "dropbear dropbearkey dropbearconvert" | ||
48 | BINCOMMANDS = "dbclient ssh scp" | ||
49 | EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"' | ||
50 | |||
51 | PACKAGECONFIG ?= "disable-weak-ciphers" | ||
52 | PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt" | ||
53 | PACKAGECONFIG[disable-weak-ciphers] = "" | ||
54 | |||
55 | EXTRA_OECONF += "\ | ||
56 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}" | ||
57 | |||
58 | # This option appends to CFLAGS and LDFLAGS from OE | ||
59 | # This is causing [textrel] QA warning | ||
60 | EXTRA_OECONF += "--disable-harden" | ||
61 | |||
62 | # musl does not implement wtmp/logwtmp APIs | ||
63 | EXTRA_OECONF:append:libc-musl = " --disable-wtmp --disable-lastlog" | ||
64 | |||
65 | do_install() { | ||
66 | install -d ${D}${sysconfdir} \ | ||
67 | ${D}${sysconfdir}/init.d \ | ||
68 | ${D}${sysconfdir}/default \ | ||
69 | ${D}${sysconfdir}/dropbear \ | ||
70 | ${D}${bindir} \ | ||
71 | ${D}${sbindir} \ | ||
72 | ${D}${localstatedir} | ||
73 | |||
74 | install -m 0644 ${WORKDIR}/dropbear.default ${D}${sysconfdir}/default/dropbear | ||
75 | |||
76 | install -m 0755 dropbearmulti ${D}${sbindir}/ | ||
77 | |||
78 | for i in ${BINCOMMANDS} | ||
79 | do | ||
80 | # ssh and scp symlinks are created by update-alternatives | ||
81 | if [ $i = ssh ] || [ $i = scp ]; then continue; fi | ||
82 | ln -s ${sbindir}/dropbearmulti ${D}${bindir}/$i | ||
83 | done | ||
84 | for i in ${SBINCOMMANDS} | ||
85 | do | ||
86 | ln -s ./dropbearmulti ${D}${sbindir}/$i | ||
87 | done | ||
88 | sed -e 's,/etc,${sysconfdir},g' \ | ||
89 | -e 's,/usr/sbin,${sbindir},g' \ | ||
90 | -e 's,/var,${localstatedir},g' \ | ||
91 | -e 's,/usr/bin,${bindir},g' \ | ||
92 | -e 's,/usr,${prefix},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/dropbear | ||
93 | chmod 755 ${D}${sysconfdir}/init.d/dropbear | ||
94 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then | ||
95 | install -d ${D}${sysconfdir}/pam.d | ||
96 | install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/ | ||
97 | fi | ||
98 | |||
99 | # deal with systemd unit files | ||
100 | install -d ${D}${systemd_system_unitdir} | ||
101 | install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_system_unitdir} | ||
102 | install -m 0644 ${WORKDIR}/dropbear@.service ${D}${systemd_system_unitdir} | ||
103 | install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_system_unitdir} | ||
104 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ | ||
105 | -e 's,@BINDIR@,${bindir},g' \ | ||
106 | -e 's,@SBINDIR@,${sbindir},g' \ | ||
107 | ${D}${systemd_system_unitdir}/dropbear.socket ${D}${systemd_system_unitdir}/*.service | ||
108 | } | ||
109 | |||
110 | inherit update-alternatives | ||
111 | |||
112 | ALTERNATIVE_PRIORITY = "20" | ||
113 | ALTERNATIVE:${PN} = "${@bb.utils.filter('BINCOMMANDS', 'scp ssh', d)}" | ||
114 | |||
115 | ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti" | ||
116 | |||
117 | pkg_postrm:${PN} () { | ||
118 | if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then | ||
119 | rm ${sysconfdir}/dropbear/dropbear_rsa_host_key | ||
120 | fi | ||
121 | if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then | ||
122 | rm ${sysconfdir}/dropbear/dropbear_dss_host_key | ||
123 | fi | ||
124 | } | ||
125 | |||
126 | CONFFILES:${PN} = "${sysconfdir}/default/dropbear" | ||
127 | |||
128 | FILES:${PN} += "${bindir}" | ||
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}" | ||