summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/dropbear
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2022-08-11 21:58:00 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-14 08:13:32 +0100
commit85437a157e80df7ee210a94d1887777ad4eac657 (patch)
tree1aeac58b1e5b4263928117b4c1d489bc2b864b81 /meta/recipes-core/dropbear
parent6f892f5384ff21977325834ffe4a0ea8e28b2425 (diff)
downloadpoky-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.inc128
-rw-r--r--meta/recipes-core/dropbear/dropbear_2022.82.bb129
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 @@
1SUMMARY = "A lightweight SSH and SCP implementation"
2HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html"
3DESCRIPTION = "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."
4SECTION = "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
8LICENSE = "MIT & BSD-3-Clause & BSD-2-Clause & PD"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=25cf44512b7bc8966a48b6b1a9b7605f"
10
11DEPENDS = "zlib virtual/crypt"
12RPROVIDES:${PN} = "ssh sshd"
13RCONFLICTS:${PN} = "openssh-sshd openssh"
14
15DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
16
17SRC_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
27PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
28 file://0006-dropbear-configuration-file.patch \
29 file://dropbear"
30
31PAM_PLUGINS = "libpam-runtime \
32 pam-plugin-deny \
33 pam-plugin-permit \
34 pam-plugin-unix \
35 "
36RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}"
37
38inherit autotools update-rc.d systemd
39
40CVE_PRODUCT = "dropbear_ssh"
41
42INITSCRIPT_NAME = "dropbear"
43INITSCRIPT_PARAMS = "defaults 10"
44
45SYSTEMD_SERVICE:${PN} = "dropbear.socket"
46
47SBINCOMMANDS = "dropbear dropbearkey dropbearconvert"
48BINCOMMANDS = "dbclient ssh scp"
49EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"'
50
51PACKAGECONFIG ?= "disable-weak-ciphers"
52PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt"
53PACKAGECONFIG[disable-weak-ciphers] = ""
54
55EXTRA_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
60EXTRA_OECONF += "--disable-harden"
61
62# musl does not implement wtmp/logwtmp APIs
63EXTRA_OECONF:append:libc-musl = " --disable-wtmp --disable-lastlog"
64
65do_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
110inherit update-alternatives
111
112ALTERNATIVE_PRIORITY = "20"
113ALTERNATIVE:${PN} = "${@bb.utils.filter('BINCOMMANDS', 'scp ssh', d)}"
114
115ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti"
116
117pkg_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
126CONFFILES:${PN} = "${sysconfdir}/default/dropbear"
127
128FILES:${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 @@
1require dropbear.inc 1SUMMARY = "A lightweight SSH and SCP implementation"
2HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html"
3DESCRIPTION = "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."
4SECTION = "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
8LICENSE = "MIT & BSD-3-Clause & BSD-2-Clause & PD"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=25cf44512b7bc8966a48b6b1a9b7605f"
10
11DEPENDS = "zlib virtual/crypt"
12RPROVIDES:${PN} = "ssh sshd"
13RCONFLICTS:${PN} = "openssh-sshd openssh"
14
15DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
16
17SRC_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
3SRC_URI[sha256sum] = "3a038d2bbc02bf28bbdd20c012091f741a3ec5cbe460691811d714876aad75d1" 27SRC_URI[sha256sum] = "3a038d2bbc02bf28bbdd20c012091f741a3ec5cbe460691811d714876aad75d1"
28
29PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
30 file://0006-dropbear-configuration-file.patch \
31 file://dropbear"
32
33PAM_PLUGINS = "libpam-runtime \
34 pam-plugin-deny \
35 pam-plugin-permit \
36 pam-plugin-unix \
37 "
38RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}"
39
40inherit autotools update-rc.d systemd
41
42CVE_PRODUCT = "dropbear_ssh"
43
44INITSCRIPT_NAME = "dropbear"
45INITSCRIPT_PARAMS = "defaults 10"
46
47SYSTEMD_SERVICE:${PN} = "dropbear.socket"
48
49SBINCOMMANDS = "dropbear dropbearkey dropbearconvert"
50BINCOMMANDS = "dbclient ssh scp"
51EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"'
52
53PACKAGECONFIG ?= "disable-weak-ciphers"
54PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt"
55PACKAGECONFIG[disable-weak-ciphers] = ""
56
57EXTRA_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
62EXTRA_OECONF += "--disable-harden"
63
64# musl does not implement wtmp/logwtmp APIs
65EXTRA_OECONF:append:libc-musl = " --disable-wtmp --disable-lastlog"
66
67do_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
112inherit update-alternatives
113
114ALTERNATIVE_PRIORITY = "20"
115ALTERNATIVE:${PN} = "${@bb.utils.filter('BINCOMMANDS', 'scp ssh', d)}"
116
117ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti"
118
119pkg_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
128CONFFILES:${PN} = "${sysconfdir}/default/dropbear"
129
130FILES:${PN} += "${bindir}"