summaryrefslogtreecommitdiffstats
path: root/recipes-containers/lxc/files/template-make-busybox-template-compatible-with-core-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-containers/lxc/files/template-make-busybox-template-compatible-with-core-.patch')
-rw-r--r--recipes-containers/lxc/files/template-make-busybox-template-compatible-with-core-.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/recipes-containers/lxc/files/template-make-busybox-template-compatible-with-core-.patch b/recipes-containers/lxc/files/template-make-busybox-template-compatible-with-core-.patch
new file mode 100644
index 00000000..1c6022b7
--- /dev/null
+++ b/recipes-containers/lxc/files/template-make-busybox-template-compatible-with-core-.patch
@@ -0,0 +1,59 @@
1From 0990db9b9723589606104d42ac2cf865b78e50a1 Mon Sep 17 00:00:00 2001
2From: Mark Asselstine <mark.asselstine@windriver.com>
3Date: Thu, 31 May 2018 11:44:44 -0400
4Subject: [PATCH] template: make busybox template compatible with
5 core-image-minimal
6
7The busybox template makes a lot of assumptions about how the busybox
8binary found on the host was configured. Building core-image-minimal
9"out of the box" does not configure busybox's 'passwd' or 'init'
10applets so we need to work around this.
11
12Chances are if you attempt to use the busybox template with a host
13which is note core-image-minimal it will fail but we are making these
14changes here to at least have the template work with
15core-image-minimal to be able to demonstrate that it can work as well
16as to have it available for the ptests.
17
18Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
19---
20 templates/lxc-busybox.in | 16 +++++++++++++---
21 1 file changed, 13 insertions(+), 3 deletions(-)
22
23diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
24index 7d00bf5..5a99103 100644
25--- a/templates/lxc-busybox.in
26+++ b/templates/lxc-busybox.in
27@@ -181,6 +181,19 @@ configure_busybox()
28 return 1
29 fi
30
31+ # copy host passwd
32+ if ! cp "$(which passwd)" "${rootfs}/bin"; then
33+ echo "ERROR: Failed to copy passwd binary"
34+ return 1
35+ fi
36+
37+ # copy bash binary as the container init
38+ if ! cp "$(which bash)" "${rootfs}/sbin/init"; then
39+ echo "ERROR: Failed to copy bash binary"
40+ return 1
41+ fi
42+
43+
44 # symlink busybox for the commands it supports
45 # it would be nice to just use "chroot $rootfs busybox --install -s /bin"
46 # but that only works right in a chroot with busybox >= 1.19.0
47@@ -191,9 +204,6 @@ configure_busybox()
48 xargs -n1 ln -s busybox
49 )
50
51- # relink /sbin/init
52- ln "${rootfs}/bin/busybox" "${rootfs}/sbin/init"
53-
54 # /etc/fstab must exist for "mount -a"
55 touch "${rootfs}/etc/fstab"
56
57--
582.7.4
59