diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:31:53 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:31:53 +0000 |
| commit | 8c22ff0d8b70d9b12f0487ef696a7e915b9e3173 (patch) | |
| tree | efdc32587159d0050a69009bdf2330a531727d95 /meta/recipes-core/dropbear | |
| parent | d412d2747595c1cc4a5e3ca975e3adc31b2f7891 (diff) | |
| download | poky-8c22ff0d8b70d9b12f0487ef696a7e915b9e3173.tar.gz | |
The poky repository master branch is no longer being updated.
You can either:
a) switch to individual clones of bitbake, openembedded-core, meta-yocto and yocto-docs
b) use the new bitbake-setup
You can find information about either approach in our documentation:
https://docs.yoctoproject.org/
Note that "poky" the distro setting is still available in meta-yocto as
before and we continue to use and maintain that.
Long live Poky!
Some further information on the background of this change can be found
in: https://lists.openembedded.org/g/openembedded-architecture/message/2179
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/dropbear')
11 files changed, 0 insertions, 419 deletions
diff --git a/meta/recipes-core/dropbear/dropbear/0001-Fix-proxycmd-without-netcat.patch b/meta/recipes-core/dropbear/dropbear/0001-Fix-proxycmd-without-netcat.patch deleted file mode 100644 index 967b66322f..0000000000 --- a/meta/recipes-core/dropbear/dropbear/0001-Fix-proxycmd-without-netcat.patch +++ /dev/null | |||
| @@ -1,74 +0,0 @@ | |||
| 1 | From 5cc0127000db5f7567b54d0495fb91a8e452fe09 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Konstantin Demin <rockdrilla@gmail.com> | ||
| 3 | Date: Fri, 9 May 2025 22:39:35 +0300 | ||
| 4 | Subject: [PATCH] Fix proxycmd without netcat | ||
| 5 | |||
| 6 | fixes e5a0ef27c2 "Execute multihop commands directly, no shell" | ||
| 7 | |||
| 8 | Signed-off-by: Konstantin Demin <rockdrilla@gmail.com> | ||
| 9 | |||
| 10 | Upstream-Status: Backport [https://github.com/mkj/dropbear/commit/5cc0127000db5f7567b54d0495fb91a8e452fe09] | ||
| 11 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 12 | --- | ||
| 13 | src/cli-main.c | 12 +++++++++++- | ||
| 14 | 1 file changed, 11 insertions(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/src/cli-main.c b/src/cli-main.c | ||
| 17 | index 2fafa88..0a052a3 100644 | ||
| 18 | --- a/src/cli-main.c | ||
| 19 | +++ b/src/cli-main.c | ||
| 20 | @@ -77,7 +77,11 @@ int main(int argc, char ** argv) { | ||
| 21 | } | ||
| 22 | |||
| 23 | #if DROPBEAR_CLI_PROXYCMD | ||
| 24 | - if (cli_opts.proxycmd || cli_opts.proxyexec) { | ||
| 25 | + if (cli_opts.proxycmd | ||
| 26 | +#if DROPBEAR_CLI_MULTIHOP | ||
| 27 | + || cli_opts.proxyexec | ||
| 28 | +#endif | ||
| 29 | + ) { | ||
| 30 | cli_proxy_cmd(&sock_in, &sock_out, &proxy_cmd_pid); | ||
| 31 | if (signal(SIGINT, kill_proxy_sighandler) == SIG_ERR || | ||
| 32 | signal(SIGTERM, kill_proxy_sighandler) == SIG_ERR || | ||
| 33 | @@ -110,11 +114,13 @@ static void shell_proxy_cmd(const void *user_data_cmd) { | ||
| 34 | dropbear_exit("Failed to run '%s'\n", cmd); | ||
| 35 | } | ||
| 36 | |||
| 37 | +#if DROPBEAR_CLI_MULTIHOP | ||
| 38 | static void exec_proxy_cmd(const void *unused) { | ||
| 39 | (void)unused; | ||
| 40 | run_command(cli_opts.proxyexec[0], cli_opts.proxyexec, ses.maxfd); | ||
| 41 | dropbear_exit("Failed to run '%s'\n", cli_opts.proxyexec[0]); | ||
| 42 | } | ||
| 43 | +#endif | ||
| 44 | |||
| 45 | static void cli_proxy_cmd(int *sock_in, int *sock_out, pid_t *pid_out) { | ||
| 46 | char * cmd_arg = NULL; | ||
| 47 | @@ -145,9 +151,11 @@ static void cli_proxy_cmd(int *sock_in, int *sock_out, pid_t *pid_out) { | ||
| 48 | cmd_arg = m_malloc(shell_cmdlen); | ||
| 49 | snprintf(cmd_arg, shell_cmdlen, "exec %s", cli_opts.proxycmd); | ||
| 50 | exec_fn = shell_proxy_cmd; | ||
| 51 | +#if DROPBEAR_CLI_MULTIHOP | ||
| 52 | } else { | ||
| 53 | /* No shell */ | ||
| 54 | exec_fn = exec_proxy_cmd; | ||
| 55 | +#endif | ||
| 56 | } | ||
| 57 | |||
| 58 | ret = spawn_command(exec_fn, cmd_arg, sock_out, sock_in, NULL, pid_out); | ||
| 59 | @@ -159,6 +167,7 @@ static void cli_proxy_cmd(int *sock_in, int *sock_out, pid_t *pid_out) { | ||
| 60 | cleanup: | ||
| 61 | m_free(cli_opts.proxycmd); | ||
| 62 | m_free(cmd_arg); | ||
| 63 | +#if DROPBEAR_CLI_MULTIHOP | ||
| 64 | if (cli_opts.proxyexec) { | ||
| 65 | char **a = NULL; | ||
| 66 | for (a = cli_opts.proxyexec; *a; a++) { | ||
| 67 | @@ -166,6 +175,7 @@ cleanup: | ||
| 68 | } | ||
| 69 | m_free(cli_opts.proxyexec); | ||
| 70 | } | ||
| 71 | +#endif | ||
| 72 | } | ||
| 73 | |||
| 74 | static void kill_proxy_sighandler(int UNUSED(signo)) { | ||
diff --git a/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch b/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch deleted file mode 100644 index 0687e5dab1..0000000000 --- a/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch +++ /dev/null | |||
| @@ -1,23 +0,0 @@ | |||
| 1 | From cdc6a4a57a86d8116a92a5d905993e65cf723556 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Richard Purdie <richard@openedhand.com> | ||
| 3 | Date: Wed, 31 Aug 2005 10:45:47 +0000 | ||
| 4 | Subject: [PATCH] urandom-xauth-changes-to-options.h | ||
| 5 | |||
| 6 | Upstream-Status: Inappropriate [configuration] | ||
| 7 | --- | ||
| 8 | src/default_options.h | 2 +- | ||
| 9 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 10 | |||
| 11 | diff --git a/src/default_options.h b/src/default_options.h | ||
| 12 | index 6e970bb..ccc8b47 100644 | ||
| 13 | --- a/src/default_options.h | ||
| 14 | +++ b/src/default_options.h | ||
| 15 | @@ -317,7 +317,7 @@ group1 in Dropbear server too */ | ||
| 16 | |||
| 17 | /* The command to invoke for xauth when using X11 forwarding. | ||
| 18 | * "-q" for quiet */ | ||
| 19 | -#define XAUTH_COMMAND "/usr/bin/xauth -q" | ||
| 20 | +#define XAUTH_COMMAND "xauth -q" | ||
| 21 | |||
| 22 | |||
| 23 | /* If you want to enable running an sftp server (such as the one included with | ||
diff --git a/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch b/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch deleted file mode 100644 index 6743f506e9..0000000000 --- a/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch +++ /dev/null | |||
| @@ -1,38 +0,0 @@ | |||
| 1 | From 253ca01f0fc50dbaeb2ff8bcece0c34256eba94f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jussi Kukkonen <jussi.kukkonen@intel.com> | ||
| 3 | Date: Wed, 2 Dec 2015 11:36:02 +0200 | ||
| 4 | Subject: [PATCH] Enable pam | ||
| 5 | |||
| 6 | We need modify file default_options.h besides enabling pam in | ||
| 7 | configure if we want dropbear to support pam. | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | |||
| 11 | Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com> | ||
| 12 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> | ||
| 13 | --- | ||
| 14 | src/default_options.h | 4 ++-- | ||
| 15 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/src/default_options.h b/src/default_options.h | ||
| 18 | index ccc8b47..12768d1 100644 | ||
| 19 | --- a/src/default_options.h | ||
| 20 | +++ b/src/default_options.h | ||
| 21 | @@ -228,7 +228,7 @@ group1 in Dropbear server too */ | ||
| 22 | |||
| 23 | /* Authentication Types - at least one required. | ||
| 24 | RFC Draft requires pubkey auth, and recommends password */ | ||
| 25 | -#define DROPBEAR_SVR_PASSWORD_AUTH 1 | ||
| 26 | +#define DROPBEAR_SVR_PASSWORD_AUTH 0 | ||
| 27 | |||
| 28 | /* Note: PAM auth is quite simple and only works for PAM modules which just do | ||
| 29 | * a simple "Login: " "Password: " (you can edit the strings in svr-authpam.c). | ||
| 30 | @@ -236,7 +236,7 @@ group1 in Dropbear server too */ | ||
| 31 | * but there's an interface via a PAM module. It won't work for more complex | ||
| 32 | * PAM challenge/response. | ||
| 33 | * You can't enable both PASSWORD and PAM. */ | ||
| 34 | -#define DROPBEAR_SVR_PAM_AUTH 0 | ||
| 35 | +#define DROPBEAR_SVR_PAM_AUTH 1 | ||
| 36 | |||
| 37 | /* ~/.ssh/authorized_keys authentication. | ||
| 38 | * You must define DROPBEAR_SVR_PUBKEY_AUTH in order to use plugins. */ | ||
diff --git a/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch b/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch deleted file mode 100644 index 44861088cc..0000000000 --- a/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | From 16b147f97f0938cddb55ec1c90bc919c13f26fc0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mingli Yu <Mingli.Yu@windriver.com> | ||
| 3 | Date: Thu, 6 Sep 2018 15:54:00 +0800 | ||
| 4 | Subject: [PATCH] dropbear configuration file | ||
| 5 | |||
| 6 | dropbear: Change the path ("/etc/pam.d/sshd" as default) to find a pam configuration file \ | ||
| 7 | to "/etc/pam.d/dropbear for dropbear when enabling pam supporting" | ||
| 8 | |||
| 9 | Upstream-Status: Inappropriate [configuration] | ||
| 10 | |||
| 11 | Signed-off-by: Maxin B. John <maxin.john@enea.com> | ||
| 12 | Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com> | ||
| 13 | Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> | ||
| 14 | --- | ||
| 15 | src/svr-authpam.c | 2 +- | ||
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/src/svr-authpam.c b/src/svr-authpam.c | ||
| 19 | index ec14632..026102f 100644 | ||
| 20 | --- a/src/svr-authpam.c | ||
| 21 | +++ b/src/svr-authpam.c | ||
| 22 | @@ -224,7 +224,7 @@ void svr_auth_pam(int valid_user) { | ||
| 23 | } | ||
| 24 | |||
| 25 | /* Init pam */ | ||
| 26 | - if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) { | ||
| 27 | + if ((rc = pam_start("dropbear", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) { | ||
| 28 | dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s", | ||
| 29 | rc, pam_strerror(pamHandlep, rc)); | ||
| 30 | goto cleanup; | ||
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear b/meta/recipes-core/dropbear/dropbear/dropbear deleted file mode 100644 index 47e787fb10..0000000000 --- a/meta/recipes-core/dropbear/dropbear/dropbear +++ /dev/null | |||
| @@ -1,4 +0,0 @@ | |||
| 1 | #%PAM-1.0 | ||
| 2 | |||
| 3 | auth include common-auth | ||
| 4 | account include common-account | ||
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear.default b/meta/recipes-core/dropbear/dropbear/dropbear.default deleted file mode 100644 index 522453a86c..0000000000 --- a/meta/recipes-core/dropbear/dropbear/dropbear.default +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | # Disallow root logins by default | ||
| 2 | DROPBEAR_EXTRA_ARGS="-w" | ||
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear.socket b/meta/recipes-core/dropbear/dropbear/dropbear.socket deleted file mode 100644 index e5c61b755e..0000000000 --- a/meta/recipes-core/dropbear/dropbear/dropbear.socket +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | [Unit] | ||
| 2 | Conflicts=dropbear.service | ||
| 3 | |||
| 4 | [Socket] | ||
| 5 | ListenStream=22 | ||
| 6 | Accept=yes | ||
| 7 | |||
| 8 | [Install] | ||
| 9 | WantedBy=sockets.target | ||
| 10 | Also=dropbearkey.service | ||
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear@.service b/meta/recipes-core/dropbear/dropbear/dropbear@.service deleted file mode 100644 index b420bcddcb..0000000000 --- a/meta/recipes-core/dropbear/dropbear/dropbear@.service +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=SSH Per-Connection Server | ||
| 3 | Wants=dropbearkey.service | ||
| 4 | After=syslog.target dropbearkey.service | ||
| 5 | |||
| 6 | [Service] | ||
| 7 | Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear" | ||
| 8 | EnvironmentFile=-/etc/default/dropbear | ||
| 9 | ExecStart=-@SBINDIR@/dropbear -i -r ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key $DROPBEAR_EXTRA_ARGS | ||
| 10 | ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID | ||
| 11 | StandardInput=socket | ||
| 12 | KillMode=process | ||
diff --git a/meta/recipes-core/dropbear/dropbear/dropbearkey.service b/meta/recipes-core/dropbear/dropbear/dropbearkey.service deleted file mode 100644 index 501e47124f..0000000000 --- a/meta/recipes-core/dropbear/dropbear/dropbearkey.service +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=SSH Key Generation | ||
| 3 | RequiresMountsFor=/var /var/lib | ||
| 4 | ConditionPathExists=!/etc/dropbear/dropbear_rsa_host_key | ||
| 5 | ConditionPathExists=!/var/lib/dropbear/dropbear_rsa_host_key | ||
| 6 | |||
| 7 | [Service] | ||
| 8 | Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear" | ||
| 9 | EnvironmentFile=-/etc/default/dropbear | ||
| 10 | Type=oneshot | ||
| 11 | ExecStart=@BASE_BINDIR@/mkdir -p ${DROPBEAR_RSAKEY_DIR} | ||
| 12 | ExecStart=@SBINDIR@/dropbearkey -t rsa -f ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key $DROPBEAR_RSAKEY_ARGS | ||
| 13 | RemainAfterExit=yes | ||
| 14 | Nice=10 | ||
diff --git a/meta/recipes-core/dropbear/dropbear/init b/meta/recipes-core/dropbear/dropbear/init deleted file mode 100755 index ffab7a2362..0000000000 --- a/meta/recipes-core/dropbear/dropbear/init +++ /dev/null | |||
| @@ -1,79 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | ### BEGIN INIT INFO | ||
| 3 | # Provides: sshd | ||
| 4 | # Required-Start: $remote_fs $syslog $networking | ||
| 5 | # Required-Stop: $remote_fs $syslog | ||
| 6 | # Default-Start: 2 3 4 5 | ||
| 7 | # Default-Stop: 1 | ||
| 8 | # Short-Description: Dropbear Secure Shell server | ||
| 9 | ### END INIT INFO | ||
| 10 | # | ||
| 11 | # Do not configure this file. Edit /etc/default/dropbear instead! | ||
| 12 | # | ||
| 13 | |||
| 14 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
| 15 | DAEMON=/usr/sbin/dropbear | ||
| 16 | NAME=dropbear | ||
| 17 | DESC="Dropbear SSH server" | ||
| 18 | PIDFILE=/var/run/dropbear.pid | ||
| 19 | |||
| 20 | # These values may be replaced by those from /etc/default/dropbear | ||
| 21 | DROPBEAR_RSAKEY_DIR="/etc/dropbear" | ||
| 22 | DROPBEAR_PORT=22 | ||
| 23 | DROPBEAR_EXTRA_ARGS= | ||
| 24 | DROPBEAR_RSAKEY_ARGS= | ||
| 25 | NO_START=0 | ||
| 26 | |||
| 27 | set -e | ||
| 28 | |||
| 29 | test ! -r /etc/default/dropbear || . /etc/default/dropbear | ||
| 30 | test "$NO_START" = "0" || exit 0 | ||
| 31 | test -x "$DAEMON" || exit 0 | ||
| 32 | test ! -h /var/service/dropbear || exit 0 | ||
| 33 | |||
| 34 | test -z "$DROPBEAR_BANNER" || \ | ||
| 35 | DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER" | ||
| 36 | test -n "$DROPBEAR_RSAKEY" || \ | ||
| 37 | DROPBEAR_RSAKEY="${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key" | ||
| 38 | |||
| 39 | gen_keys() { | ||
| 40 | if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then | ||
| 41 | rm $DROPBEAR_RSAKEY || true | ||
| 42 | fi | ||
| 43 | if [ ! -f "$DROPBEAR_RSAKEY" ]; then | ||
| 44 | mkdir -p ${DROPBEAR_RSAKEY%/*} | ||
| 45 | dropbearkey -t rsa -f $DROPBEAR_RSAKEY $DROPBEAR_RSAKEY_ARGS | ||
| 46 | fi | ||
| 47 | } | ||
| 48 | |||
| 49 | case "$1" in | ||
| 50 | start) | ||
| 51 | echo -n "Starting $DESC: " | ||
| 52 | gen_keys | ||
| 53 | start-stop-daemon -S -p $PIDFILE \ | ||
| 54 | -x "$DAEMON" -- -r $DROPBEAR_RSAKEY \ | ||
| 55 | -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS | ||
| 56 | echo "$NAME." | ||
| 57 | ;; | ||
| 58 | stop) | ||
| 59 | echo -n "Stopping $DESC: " | ||
| 60 | start-stop-daemon -K -x "$DAEMON" -p $PIDFILE | ||
| 61 | echo "$NAME." | ||
| 62 | ;; | ||
| 63 | restart|force-reload) | ||
| 64 | echo -n "Restarting $DESC: " | ||
| 65 | start-stop-daemon -K -x "$DAEMON" -p $PIDFILE | ||
| 66 | sleep 1 | ||
| 67 | start-stop-daemon -S -p $PIDFILE \ | ||
| 68 | -x "$DAEMON" -- -r $DROPBEAR_RSAKEY \ | ||
| 69 | -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS | ||
| 70 | echo "$NAME." | ||
| 71 | ;; | ||
| 72 | *) | ||
| 73 | N=/etc/init.d/$NAME | ||
| 74 | echo "Usage: $N {start|stop|restart|force-reload}" >&2 | ||
| 75 | exit 1 | ||
| 76 | ;; | ||
| 77 | esac | ||
| 78 | |||
| 79 | exit 0 | ||
diff --git a/meta/recipes-core/dropbear/dropbear_2025.88.bb b/meta/recipes-core/dropbear/dropbear_2025.88.bb deleted file mode 100644 index 72a886d907..0000000000 --- a/meta/recipes-core/dropbear/dropbear_2025.88.bb +++ /dev/null | |||
| @@ -1,133 +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 | SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \ | ||
| 16 | file://0001-urandom-xauth-changes-to-options.h.patch \ | ||
| 17 | file://init \ | ||
| 18 | file://dropbearkey.service \ | ||
| 19 | file://dropbear@.service \ | ||
| 20 | file://dropbear.socket \ | ||
| 21 | file://dropbear.default \ | ||
| 22 | file://0001-Fix-proxycmd-without-netcat.patch \ | ||
| 23 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ | ||
| 24 | " | ||
| 25 | |||
| 26 | SRC_URI[sha256sum] = "783f50ea27b17c16da89578fafdb6decfa44bb8f6590e5698a4e4d3672dc53d4" | ||
| 27 | MIRRORS += "http://matt.ucc.asn.au/dropbear/releases/ https://dropbear.nl/mirror/releases/" | ||
| 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 | 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 ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam x11', d)}" | ||
| 52 | PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam,${PAM_PLUGINS}" | ||
| 53 | PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt" | ||
| 54 | PACKAGECONFIG[x11] = ",,,,xauth" | ||
| 55 | |||
| 56 | # This option appends to CFLAGS and LDFLAGS from OE | ||
| 57 | # This is causing [textrel] QA warning | ||
| 58 | EXTRA_OECONF += "--disable-harden" | ||
| 59 | |||
| 60 | # musl does not implement wtmp/logwtmp APIs | ||
| 61 | EXTRA_OECONF:append:libc-musl = " --disable-wtmp --disable-lastlog" | ||
| 62 | |||
| 63 | do_configure:append() { | ||
| 64 | echo "/* Dropbear features */" > ${B}/localoptions.h | ||
| 65 | if ${@bb.utils.contains('PACKAGECONFIG', 'x11', 'true', 'false', d)}; then | ||
| 66 | echo "#define DROPBEAR_X11FWD 1" >> ${B}/localoptions.h | ||
| 67 | fi | ||
| 68 | } | ||
| 69 | |||
| 70 | do_install() { | ||
| 71 | install -d ${D}${sysconfdir} \ | ||
| 72 | ${D}${sysconfdir}/init.d \ | ||
| 73 | ${D}${sysconfdir}/default \ | ||
| 74 | ${D}${sysconfdir}/dropbear \ | ||
| 75 | ${D}${bindir} \ | ||
| 76 | ${D}${sbindir} \ | ||
| 77 | ${D}${localstatedir} | ||
| 78 | |||
| 79 | install -m 0644 ${UNPACKDIR}/dropbear.default ${D}${sysconfdir}/default/dropbear | ||
| 80 | |||
| 81 | install -m 0755 dropbearmulti ${D}${sbindir}/ | ||
| 82 | |||
| 83 | for i in ${BINCOMMANDS} | ||
| 84 | do | ||
| 85 | # ssh and scp symlinks are created by update-alternatives | ||
| 86 | if [ $i = ssh ] || [ $i = scp ]; then continue; fi | ||
| 87 | ln -s ${sbindir}/dropbearmulti ${D}${bindir}/$i | ||
| 88 | done | ||
| 89 | for i in ${SBINCOMMANDS} | ||
| 90 | do | ||
| 91 | ln -s ./dropbearmulti ${D}${sbindir}/$i | ||
| 92 | done | ||
| 93 | sed -e 's,/etc,${sysconfdir},g' \ | ||
| 94 | -e 's,/usr/sbin,${sbindir},g' \ | ||
| 95 | -e 's,/var,${localstatedir},g' \ | ||
| 96 | -e 's,/usr/bin,${bindir},g' \ | ||
| 97 | -e 's,/usr,${prefix},g' ${UNPACKDIR}/init > ${D}${sysconfdir}/init.d/dropbear | ||
| 98 | chmod 755 ${D}${sysconfdir}/init.d/dropbear | ||
| 99 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then | ||
| 100 | install -d ${D}${sysconfdir}/pam.d | ||
| 101 | install -m 0644 ${UNPACKDIR}/dropbear ${D}${sysconfdir}/pam.d/ | ||
| 102 | fi | ||
| 103 | |||
| 104 | # deal with systemd unit files | ||
| 105 | install -d ${D}${systemd_system_unitdir} | ||
| 106 | install -m 0644 ${UNPACKDIR}/dropbearkey.service ${D}${systemd_system_unitdir} | ||
| 107 | install -m 0644 ${UNPACKDIR}/dropbear@.service ${D}${systemd_system_unitdir} | ||
| 108 | install -m 0644 ${UNPACKDIR}/dropbear.socket ${D}${systemd_system_unitdir} | ||
| 109 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ | ||
| 110 | -e 's,@BINDIR@,${bindir},g' \ | ||
| 111 | -e 's,@SBINDIR@,${sbindir},g' \ | ||
| 112 | ${D}${systemd_system_unitdir}/dropbear.socket ${D}${systemd_system_unitdir}/*.service | ||
| 113 | } | ||
| 114 | |||
| 115 | inherit update-alternatives | ||
| 116 | |||
| 117 | ALTERNATIVE_PRIORITY = "20" | ||
| 118 | ALTERNATIVE:${PN} = "${@bb.utils.filter('BINCOMMANDS', 'scp ssh', d)}" | ||
| 119 | |||
| 120 | ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti" | ||
| 121 | |||
| 122 | pkg_postrm:${PN} () { | ||
| 123 | if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then | ||
| 124 | rm ${sysconfdir}/dropbear/dropbear_rsa_host_key | ||
| 125 | fi | ||
| 126 | if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then | ||
| 127 | rm ${sysconfdir}/dropbear/dropbear_dss_host_key | ||
| 128 | fi | ||
| 129 | } | ||
| 130 | |||
| 131 | CONFFILES:${PN} = "${sysconfdir}/default/dropbear" | ||
| 132 | |||
| 133 | FILES:${PN} += "${systemd_system_unitdir}/dropbearkey.service" | ||
