-
Notifications
You must be signed in to change notification settings - Fork 0
/
dropbear.sh
executable file
·58 lines (42 loc) · 1.12 KB
/
dropbear.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
# Script coppied from rust-embedded/cross to rework their Dockerfiles
set -x
set -euo pipefail
# shellcheck disable=SC1091
. lib.sh
main() {
local version=2022.82
install_packages \
autoconf \
automake \
bzip2 \
curl \
make
if_centos install_packages zlib-devel
if_ubuntu install_packages zlib1g-dev
local td
td="$(mktemp -d)"
pushd "${td}"
curl --retry 3 -sSfL "https://matt.ucc.asn.au/dropbear/releases/dropbear-${version}.tar.bz2" -O
tar --strip-components=1 -xjf "dropbear-${version}.tar.bz2"
# Remove some unwanted message
sed -i '/skipping hostkey/d' cli-kex.c
sed -i '/failed to identify current user/d' cli-runopts.c
./configure \
--disable-syslog \
--disable-shadow \
--disable-lastlog \
--disable-utmp \
--disable-utmpx \
--disable-wtmp \
--disable-wtmpx \
--disable-pututline \
--disable-pututxline
make "-j$(nproc)" PROGRAMS=dbclient
cp dbclient /usr/local/bin/
purge_packages
popd
rm -rf "${td}"
rm "${0}"
}
main "${@}"