summaryrefslogtreecommitdiffstats
path: root/recipes-containers/lxc/files/make-some-OpenSSH-tools-optional.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-containers/lxc/files/make-some-OpenSSH-tools-optional.patch')
-rw-r--r--recipes-containers/lxc/files/make-some-OpenSSH-tools-optional.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/recipes-containers/lxc/files/make-some-OpenSSH-tools-optional.patch b/recipes-containers/lxc/files/make-some-OpenSSH-tools-optional.patch
new file mode 100644
index 00000000..2d287885
--- /dev/null
+++ b/recipes-containers/lxc/files/make-some-OpenSSH-tools-optional.patch
@@ -0,0 +1,49 @@
1From 34be0d3cd8c4eaca9929470bc8bce5e74975bccf Mon Sep 17 00:00:00 2001
2From: Bogdan Purcareata <bogdan.purcareata@freescale.com>
3Date: Thu, 23 Apr 2015 08:33:00 +0000
4Subject: [PATCH] lxc-busybox: make some OpenSSH tools optional
5
6Currently, when installing OpenSSH in a Busybox container, the template searches
7for all the OpenSSH client binaries available in the Debian distro package. The
8included tools might differ from distro to distro, so make part of the tools
9optional. The mandatory tools, without which installing OpenSSH fails, are
10"sshd" for the server and "ssh" and "scp" for the client.
11
12Upstream-Status: Submitted
13[https://lists.linuxcontainers.org/pipermail/lxc-devel/2015-April/011696.html]
14
15Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
16---
17 templates/lxc-busybox.in | 9 +++++++++
18 1 file changed, 9 insertions(+)
19
20diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
21index 95961a3..17a3006 100644
22--- a/templates/lxc-busybox.in
23+++ b/templates/lxc-busybox.in
24@@ -197,6 +197,8 @@ install_openssh()
25 client_utils="\
26 ssh \
27 scp \
28+ "
29+ client_optional_utils="\
30 sftp \
31 ssh-add \
32 ssh-agent \
33@@ -230,6 +232,13 @@ $rootfs/var/run/sshd \
34 fi
35 done
36
37+ for bin in $client_optional_utils; do
38+ tool_path=`which $bin`
39+ if [ $? -eq 0 ]; then
40+ cp $tool_path $rootfs/$tool_path
41+ fi
42+ done
43+
44 # add user and group
45 cat <<EOF >> $rootfs/etc/passwd
46 sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
47--
482.1.4
49