summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-containers/lxc/files/lxc-0.9.0-always-strdup-rootfs-mount.patch27
-rw-r--r--recipes-containers/lxc/files/lxc-0.9.0-check-when-bind-mounting-libdirs.patch44
-rw-r--r--recipes-containers/lxc/files/lxc-0.9.0-configure-allow-subdir-objects.patch35
-rw-r--r--recipes-containers/lxc/files/lxc-0.9.0-don-t-let-LXC_PATH-end-in-failure.patch29
-rw-r--r--recipes-containers/lxc/files/lxc-0.9.0-enable-chroot-chpasswd-functionality-for-busybox-hosts.patch70
-rw-r--r--recipes-containers/lxc/files/lxc-0.9.0-setup_netdev-re-read-ifindex-in-LXC_NET_PHYS-case.patch49
-rw-r--r--recipes-containers/lxc/files/lxc-0.9.0-use-susv3-head-arguments.patch46
-rw-r--r--recipes-containers/lxc/files/lxc-1.0.0-disable-udhcp-from-busybox-template.patch (renamed from recipes-containers/lxc/files/lxc-0.9.0-disable-udhcp-from-busybox-template.patch)0
-rw-r--r--recipes-containers/lxc/lxc_1.0.0.bb (renamed from recipes-containers/lxc/lxc_0.9.0.bb)13
9 files changed, 3 insertions, 310 deletions
diff --git a/recipes-containers/lxc/files/lxc-0.9.0-always-strdup-rootfs-mount.patch b/recipes-containers/lxc/files/lxc-0.9.0-always-strdup-rootfs-mount.patch
deleted file mode 100644
index 3e299d2f..00000000
--- a/recipes-containers/lxc/files/lxc-0.9.0-always-strdup-rootfs-mount.patch
+++ /dev/null
@@ -1,27 +0,0 @@
1diff --git a/src/lxc/conf.c b/src/lxc/conf.c
2index 6b3f318..2f8b9e6 100644
3--- a/src/lxc/conf.c
4+++ b/src/lxc/conf.c
5@@ -2072,7 +2072,12 @@ struct lxc_conf *lxc_conf_init(void)
6 new->console.slave = -1;
7 new->console.name[0] = '\0';
8 new->maincmd_fd = -1;
9- new->rootfs.mount = default_rootfs_mount;
10+ new->rootfs.mount = strdup(default_rootfs_mount);
11+ if (!new->rootfs.mount) {
12+ ERROR("lxc_conf_init : %m");
13+ free(new);
14+ return NULL;
15+ }
16 new->kmsg = 1;
17 lxc_list_init(&new->cgroup);
18 lxc_list_init(&new->network);
19@@ -3084,7 +3089,7 @@ void lxc_conf_free(struct lxc_conf *conf)
20 return;
21 if (conf->console.path)
22 free(conf->console.path);
23- if (conf->rootfs.mount != default_rootfs_mount)
24+ if (conf->rootfs.mount)
25 free(conf->rootfs.mount);
26 if (conf->rootfs.path)
27 free(conf->rootfs.path);
diff --git a/recipes-containers/lxc/files/lxc-0.9.0-check-when-bind-mounting-libdirs.patch b/recipes-containers/lxc/files/lxc-0.9.0-check-when-bind-mounting-libdirs.patch
deleted file mode 100644
index 4d21a02d..00000000
--- a/recipes-containers/lxc/files/lxc-0.9.0-check-when-bind-mounting-libdirs.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1From 9e74f8161b8db05365fde0646b0c29c852afc3a0 Mon Sep 17 00:00:00 2001
2From: Bogdan Purcareata <bogdan.purcareata@freescale.com>
3Date: Tue, 14 May 2013 11:54:23 +0300
4Subject: [PATCH] lxc-busybox: check when bind-mounting host libdirs
5
6The patch changes the busybox template behavior to automatically
7mount /lib and /usr/lib. In case one of these folders does not exist,
8starting the container will fail. Also, if there are other lib entries
9on the host - e.g. /usr/lib64 - mount them as well.
10
11Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
12---
13 templates/lxc-busybox.in | 8 +-------
14 1 file changed, 1 insertion(+), 7 deletions(-)
15
16diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
17index cb425ec..49effae 100644
18--- a/templates/lxc-busybox.in
19+++ b/templates/lxc-busybox.in
20@@ -240,13 +240,6 @@ lxc.pts = 1
21 #lxc.aa_profile = unconfined
22 EOF
23
24-if [ -d "$rootfs/lib" ]; then
25-cat <<EOF >> $path/config
26-lxc.mount.entry = /lib $rootfs/lib none ro,bind 0 0
27-lxc.mount.entry = /usr/lib $rootfs/usr/lib none ro,bind 0 0
28-EOF
29-fi
30-
31 libdirs="\
32 lib \
33 usr/lib \
34@@ -255,6 +248,7 @@ fi
35
36 for dir in $libdirs; do
37 if [ -d "/$dir" ] && [ -d "$rootfs/$dir" ]; then
38+ echo "lxc.mount.entry = /$dir $rootfs/$dir none ro,bind 0 0" >> $path/config
39 echo "lxc.mount.entry = /$dir $dir none ro,bind 0 0" >> $path/config
40 fi
41 done
42--
431.7.11.7
44
diff --git a/recipes-containers/lxc/files/lxc-0.9.0-configure-allow-subdir-objects.patch b/recipes-containers/lxc/files/lxc-0.9.0-configure-allow-subdir-objects.patch
deleted file mode 100644
index 3b4dd845..00000000
--- a/recipes-containers/lxc/files/lxc-0.9.0-configure-allow-subdir-objects.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From f3b86b0704cb62b77d80b90b40c1df68289d3558 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@windriver.com>
3Date: Fri, 31 Jan 2014 15:37:24 -0500
4Subject: [PATCH] configure: allow subdir objects
5
6autoconf-1.14 will fail to configure lxc with the following warning (and
7hence error):
8
9 | automake: warnings are treated as errors
10 | src/lxc/Makefile.am:79: warning: source file '../include/openpty.c' is in a subdirectory,
11 | src/lxc/Makefile.am:79: but option 'subdir-objects' is disabled
12
13So we tell autoconf that subdir objects are fine .. and the issue is solved.
14
15Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
16---
17 configure.ac | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/configure.ac b/configure.ac
21index 7dc82cfbcb8d..27ba250df3ac 100644
22--- a/configure.ac
23+++ b/configure.ac
24@@ -6,7 +6,7 @@ AC_INIT([lxc], [0.9.0])
25 AC_CONFIG_SRCDIR([configure.ac])
26 AC_CONFIG_AUX_DIR([config])
27 AC_CONFIG_HEADERS([src/config.h])
28-AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability])
29+AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability subdir-objects])
30 AC_CANONICAL_HOST
31 AM_PROG_CC_C_O
32 AC_GNU_SOURCE
33--
341.7.10.4
35
diff --git a/recipes-containers/lxc/files/lxc-0.9.0-don-t-let-LXC_PATH-end-in-failure.patch b/recipes-containers/lxc/files/lxc-0.9.0-don-t-let-LXC_PATH-end-in-failure.patch
deleted file mode 100644
index fe9f8cc5..00000000
--- a/recipes-containers/lxc/files/lxc-0.9.0-don-t-let-LXC_PATH-end-in-failure.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From fd95f2402dc70ad41fa2db8fb101f950196458a9 Mon Sep 17 00:00:00 2001
2From: Serge Hallyn <serge.hallyn@ubuntu.com>
3Date: Tue, 9 Apr 2013 16:23:05 -0500
4Subject: [PATCH] lxc.functions: don't let LXC_PATH= line end in failure
5
6Otherwise if called from dash with set -e, dash will exit. This
7causes lxc-clone to fail.
8
9Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10---
11 src/lxc/lxc.functions.in | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/src/lxc/lxc.functions.in b/src/lxc/lxc.functions.in
15index b41f9b8..aa5717d 100644
16--- a/src/lxc/lxc.functions.in
17+++ b/src/lxc/lxc.functions.in
18@@ -26,7 +26,7 @@ templatedir=@LXCTEMPLATEDIR@
19 lxcinitdir=@LXCINITDIR@
20
21 get_default_lxcpath() {
22- LXC_PATH=$(grep -v "^#" "$globalconf" 2>/dev/null | grep "[ \t]*lxcpath[ \t]*=")
23+ LXC_PATH=$(grep -v "^#" "$globalconf" 2>/dev/null | grep "[ \t]*lxcpath[ \t]*=") || true
24 if [ -n "$LXC_PATH" ]; then
25 echo $LXC_PATH | awk -F= '{ print $2 }'
26 else
27--
281.7.11.7
29
diff --git a/recipes-containers/lxc/files/lxc-0.9.0-enable-chroot-chpasswd-functionality-for-busybox-hosts.patch b/recipes-containers/lxc/files/lxc-0.9.0-enable-chroot-chpasswd-functionality-for-busybox-hosts.patch
deleted file mode 100644
index d07c6580..00000000
--- a/recipes-containers/lxc/files/lxc-0.9.0-enable-chroot-chpasswd-functionality-for-busybox-hosts.patch
+++ /dev/null
@@ -1,70 +0,0 @@
1From 4ddc14bd0866ff769421857044dd14867f1944d5 Mon Sep 17 00:00:00 2001
2From: Bogdan Purcareata <bogdan.purcareata@freescale.com>
3Date: Thu, 11 Apr 2013 16:15:43 +0300
4Subject: [PATCH v2] lxc-template: enable chroot + chpasswd functionality for
5 Busybox hosts
6
7This patch supports the scenario where a user wants to install a
8busybox container on a busybox host.
9
10When running the template, in order to change the root password,
11the template needs to do the chroot. On busybox-powered hosts, chroot
12is not part of the coreutils package - it's part of busybox. And the
13busybox implementation or chroot only works if it has /lib in the new
14root populated with the right binaries (or at least that's the
15solution I found to make it work).
16
17The temporarily bind-mounts /lib in the NEWROOT, chroots there,
18changes the password, goes back and unmounts. This set of operations
19is contained in a new MOUNT namespace, using the lxc-unshare call.
20
21Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
22---
23 templates/lxc-busybox.in | 30 ++++++++++++++++++++++++++++--
24 1 file changed, 28 insertions(+), 2 deletions(-)
25
26diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
27index cb425ec..2ca2bfd 100644
28--- a/templates/lxc-busybox.in
29+++ b/templates/lxc-busybox.in
30@@ -189,9 +189,35 @@ configure_busybox()
31 # passwd exec must be setuid
32 chmod +s $rootfs/bin/passwd
33 touch $rootfs/etc/shadow
34- echo "setting root passwd to root"
35- echo "root:root" | chroot $rootfs chpasswd
36
37+ # setting passwd for root
38+ CHPASSWD_FILE=$rootfs/root/chpasswd.sh
39+
40+ cat <<EOF >$CHPASSWD_FILE
41+echo "setting root password to \"root\""
42+
43+mount --bind /lib $rootfs/lib
44+if [ \$? -ne 0 ]; then
45+ echo "Failed bind-mounting /lib at $rootfs/lib"
46+ exit 1
47+fi
48+
49+chroot $rootfs chpasswd <<EOFF 2>/dev/null
50+root:root
51+EOFF
52+
53+
54+if [ \$? -ne 0 ]; then
55+ echo "Failed to change root password"
56+ exit 1
57+fi
58+
59+umount $rootfs/lib
60+
61+EOF
62+
63+ lxc-unshare -s MOUNT -- /bin/sh < $CHPASSWD_FILE
64+ rm $CHPASSWD_FILE
65
66 # add ssh functionality if dropbear package available on host
67 which dropbear >/dev/null 2>&1
68--
691.7.11.7
70
diff --git a/recipes-containers/lxc/files/lxc-0.9.0-setup_netdev-re-read-ifindex-in-LXC_NET_PHYS-case.patch b/recipes-containers/lxc/files/lxc-0.9.0-setup_netdev-re-read-ifindex-in-LXC_NET_PHYS-case.patch
deleted file mode 100644
index 767e3894..00000000
--- a/recipes-containers/lxc/files/lxc-0.9.0-setup_netdev-re-read-ifindex-in-LXC_NET_PHYS-case.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1From 8712c58ab896f072cf95e3ffa3ceac1fa10f6295 Mon Sep 17 00:00:00 2001
2From: Bogdan Purcareata <bogdan.purcareata@freescale.com>
3Date: Thu, 14 Nov 2013 12:31:55 +0200
4Subject: [PATCH] setup_netdev: re-read ifindex in LXC_NET_PHYS case
5
6When moving an interface from the host netns to a container's,
7the ifindex might not remain the same. This happens when the
8index of the host interface is already assigned to another interface
9in the new netns.
10
11For veth/vlan/macvlan, virtual interfaces are first created on the host,
12and then moved in the container. Since they are created after all other
13interfaces are discovered, there is no chance for its assigned ifindex
14to be already present in a freshly created netns, since its a greater
15number.
16
17However, when moving a physical interface, there is a chance that its
18ifindex in the host netns is not free in the new netns. The patch
19forces ifindex re-read for the LXC_NET_PHYS case to update the
20lxc_netdev structure.
21
22Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
23Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
24---
25 src/lxc/conf.c | 8 ++++++++
26 1 file changed, 8 insertions(+)
27
28diff --git a/src/lxc/conf.c b/src/lxc/conf.c
29index 6b3f318..08b0d0f 100644
30--- a/src/lxc/conf.c
31+++ b/src/lxc/conf.c
32@@ -1846,6 +1846,14 @@ static int setup_netdev(struct lxc_netdev *netdev)
33 return 0;
34 }
35
36+ /* get the new ifindex in case of physical netdev */
37+ if (netdev->type == LXC_NET_PHYS)
38+ if (!(netdev->ifindex = if_nametoindex(netdev->link))) {
39+ ERROR("failed to get ifindex for %s",
40+ netdev->link);
41+ return -1;
42+ }
43+
44 /* retrieve the name of the interface */
45 if (!if_indextoname(netdev->ifindex, current_ifname)) {
46 ERROR("no interface corresponding to index '%d'",
47--
481.7.11.7
49
diff --git a/recipes-containers/lxc/files/lxc-0.9.0-use-susv3-head-arguments.patch b/recipes-containers/lxc/files/lxc-0.9.0-use-susv3-head-arguments.patch
deleted file mode 100644
index 86ed7d25..00000000
--- a/recipes-containers/lxc/files/lxc-0.9.0-use-susv3-head-arguments.patch
+++ /dev/null
@@ -1,46 +0,0 @@
1Upstream-status: Pending
2
3--- lxc-0.9.0.orig/src/lxc/lxc-checkconfig.in
4+++ lxc-0.9.0/src/lxc/lxc-checkconfig.in
5@@ -67,7 +67,7 @@ print_cgroups() {
6 awk '$1 !~ /#/ && $3 == mp { print $2; } ; END { exit(0); } ' "mp=$1" "$2" ;
7 }
8
9-CGROUP_MNT_PATH=`print_cgroups cgroup /proc/self/mounts | head -1`
10+CGROUP_MNT_PATH=`print_cgroups cgroup /proc/self/mounts | head -n 1`
11 KVER_MAJOR=$($GREP '^# Linux' $CONFIG | \
12 sed -r 's/.* ([0-9])\.[0-9]{1,2}\.[0-9]{1,3}.*/\1/')
13 if [ "$KVER_MAJOR" = "2" ]; then
14--- lxc-0.9.0.orig/src/lxc/lxc-netstat.in
15+++ lxc-0.9.0/src/lxc/lxc-netstat.in
16@@ -107,7 +107,7 @@ if [ ! -d "$parent_cgroup" ]; then
17 exit 1
18 fi
19
20-pid=$(head -1 $parent_cgroup/$name/tasks)
21+pid=$(head -n 1 $parent_cgroup/$name/tasks)
22
23 if [ -z "$pid" ]; then
24 echo "$(basename $0): no process found for '$name'" >&2
25--- lxc-0.9.0.orig/templates/lxc-alpine.in
26+++ lxc-0.9.0/templates/lxc-alpine.in
27@@ -99,7 +99,7 @@ EOF
28 if [ "$nics" -eq 1 ] && ! grep -q "^lxc.network.hwaddr" $path/config; then
29 # see http://sourceforge.net/tracker/?func=detail&aid=3411497&group_id=163076&atid=826303
30 hwaddr="fe:$(dd if=/dev/urandom bs=8 count=1 2>/dev/null |od -t x8 | \
31- head -1 |awk '{print $2}' | cut -c1-10 |\
32+ head -n 1 |awk '{print $2}' | cut -c1-10 |\
33 sed 's/\(..\)/\1:/g; s/.$//')"
34 echo "lxc.network.hwaddr = $hwaddr" >> $path/config
35 fi
36--- lxc-0.9.0.orig/templates/lxc-oracle.in
37+++ lxc-0.9.0/templates/lxc-oracle.in
38@@ -327,7 +327,7 @@ container_config_create()
39 # generate a hwaddr for the container with a high mac address
40 # see http://sourceforge.net/tracker/?func=detail&aid=3411497&group_id=163076&atid=826303
41 local hwaddr="fe:`dd if=/dev/urandom bs=8 count=1 2>/dev/null |od -t x8 | \
42- head -1 |awk '{print $2}' | cut -c1-10 |\
43+ head -n 1 |awk '{print $2}' | cut -c1-10 |\
44 sed 's/\(..\)/\1:/g; s/.$//'`"
45 mkdir -p $cfg_dir || die "unable to create config dir $cfg_dir"
46 cat <<EOF >> $cfg_dir/config || die "unable to create $cfg_dir/config"
diff --git a/recipes-containers/lxc/files/lxc-0.9.0-disable-udhcp-from-busybox-template.patch b/recipes-containers/lxc/files/lxc-1.0.0-disable-udhcp-from-busybox-template.patch
index 723be277..723be277 100644
--- a/recipes-containers/lxc/files/lxc-0.9.0-disable-udhcp-from-busybox-template.patch
+++ b/recipes-containers/lxc/files/lxc-1.0.0-disable-udhcp-from-busybox-template.patch
diff --git a/recipes-containers/lxc/lxc_0.9.0.bb b/recipes-containers/lxc/lxc_1.0.0.bb
index e1de3c73..36ac78df 100644
--- a/recipes-containers/lxc/lxc_0.9.0.bb
+++ b/recipes-containers/lxc/lxc_1.0.0.bb
@@ -22,17 +22,10 @@ RDEPENDS_${PN} = " \
22" 22"
23 23
24SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \ 24SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \
25 file://lxc-0.9.0-disable-udhcp-from-busybox-template.patch \ 25 file://lxc-1.0.0-disable-udhcp-from-busybox-template.patch \
26 file://lxc-0.9.0-enable-chroot-chpasswd-functionality-for-busybox-hosts.patch \
27 file://lxc-0.9.0-check-when-bind-mounting-libdirs.patch \
28 file://lxc-0.9.0-don-t-let-LXC_PATH-end-in-failure.patch \
29 file://lxc-0.9.0-always-strdup-rootfs-mount.patch \
30 file://lxc-0.9.0-setup_netdev-re-read-ifindex-in-LXC_NET_PHYS-case.patch \
31 file://lxc-0.9.0-use-susv3-head-arguments.patch \
32 file://lxc-0.9.0-configure-allow-subdir-objects.patch \
33 " 26 "
34SRC_URI[md5sum] = "8552a4479090616f4bc04d8473765fc9" 27SRC_URI[md5sum] = "87a9d168a6e55326303cce3b2cb7f82e"
35SRC_URI[sha256sum] = "1e1767eae6cc5fbf892c0e193d25da420ba19f2db203716c38f7cdea3b654120" 28SRC_URI[sha256sum] = "0992212ddaad01dfe8c048e130566b73dd5f34191585f36bdac07a4f8a91f3bd"
36 29
37S = "${WORKDIR}/${BPN}-${PV}" 30S = "${WORKDIR}/${BPN}-${PV}"
38 31