summaryrefslogtreecommitdiffstats
path: root/recipes-containers
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-10 03:19:54 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-10 03:19:54 +0200
commitc158582c0fc7f4bd73980fe9adad446855f4d61b (patch)
tree31b701a2367cb983e76e76cd7c2ba176ad33e5ac /recipes-containers
downloadmeta-vt-c158582c0fc7f4bd73980fe9adad446855f4d61b.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'recipes-containers')
-rwxr-xr-xrecipes-containers/lxc/files/init-lxc-mount12
-rw-r--r--recipes-containers/lxc/files/lxc-busybox-support-enea-linux-init.patch51
-rw-r--r--recipes-containers/lxc/files/lxc-test-attach-replace-cmp-with-grep.patch24
-rw-r--r--recipes-containers/lxc/lxc_1.0.1.bbappend17
4 files changed, 104 insertions, 0 deletions
diff --git a/recipes-containers/lxc/files/init-lxc-mount b/recipes-containers/lxc/files/init-lxc-mount
new file mode 100755
index 0000000..c4c77df
--- /dev/null
+++ b/recipes-containers/lxc/files/init-lxc-mount
@@ -0,0 +1,12 @@
1#!/bin/sh -e
2
3mkdir -p /sys/fs/cgroup/cpuset
4mkdir -p /sys/fs/cgroup/cpu,cpuacct
5mkdir -p /sys/fs/cgroup/devices
6mkdir -p /sys/fs/cgroup/freezer
7mkdir -p /sys/fs/cgroup/memory
8mount cpuset
9mount cpuacct
10mount devices
11mount freezer
12mount memory
diff --git a/recipes-containers/lxc/files/lxc-busybox-support-enea-linux-init.patch b/recipes-containers/lxc/files/lxc-busybox-support-enea-linux-init.patch
new file mode 100644
index 0000000..4eecfaa
--- /dev/null
+++ b/recipes-containers/lxc/files/lxc-busybox-support-enea-linux-init.patch
@@ -0,0 +1,51 @@
1lxc: Modify lxc-busybox to support Enea Linux
2
3In Enea Linux, the busybox commands are split between busybox.nosuid (symlinked
4as /bin/busybox) and busybox.suid. This patch enables the commands provided by
5the latter and also replaces the busybox init with the SysV counterpart.
6
7Upstream-Status: Pending
8
9Signed-off-by: Petre Pircalabu <petre.pircalabu@enea.com>
10
11--- a/templates/lxc-busybox.in
12+++ b/templates/lxc-busybox.in
13@@ -129,6 +129,7 @@ EOF
14 # and propose a shell on the tty, the last one is
15 # not needed
16 cat <<EOF >> $rootfs/etc/inittab
17+id:5:initdefault:
18 ::sysinit:/etc/init.d/rcS
19 tty1::respawn:/bin/getty -L tty1 115200 vt100
20 console::askfirst:/bin/sh
21@@ -209,8 +210,28 @@ configure_busybox()
22 xargs -n1 ln -s busybox
23 popd > /dev/null
24
25- # relink /sbin/init
26- ln $rootfs/bin/busybox $rootfs/sbin/init
27+ which busybox.suid >/dev/null 2>&1
28+
29+ if [ $? -eq 0 ]; then
30+ # copy busybox.suid in the rootfs
31+ cp $(which busybox.suid) $rootfs/bin
32+ if [ $? -ne 0 ]; then
33+ echo "failed to copy busybox.suid in the rootfs"
34+ return 1
35+ fi
36+
37+ pushd $rootfs/bin > /dev/null || return 1
38+ ./busybox.suid --help | grep 'Currently defined functions:' -A300 | \
39+ grep -v 'Currently defined functions:' | tr , '\n' | \
40+ xargs -n1 ln -s busybox.suid
41+ popd > /dev/null
42+ fi
43+
44+ # use SysV init
45+ pushd $rootfs/sbin > /dev/null || return 1
46+ cp /sbin/init.sysvinit .
47+ ln -s init.sysvinit init
48+ popd > /dev/null
49
50 # passwd exec must be setuid
51 chmod +s $rootfs/bin/passwd
diff --git a/recipes-containers/lxc/files/lxc-test-attach-replace-cmp-with-grep.patch b/recipes-containers/lxc/files/lxc-test-attach-replace-cmp-with-grep.patch
new file mode 100644
index 0000000..88d2450
--- /dev/null
+++ b/recipes-containers/lxc/files/lxc-test-attach-replace-cmp-with-grep.patch
@@ -0,0 +1,24 @@
1lxc: Update lxc-test-attach
2
3For Enea Linux, the SysV init file is different from busybox, causing cmp to
4return an error. In order to preserve the test's logic it was replaced with a
5command which succeeds in every situation:
6(e.g. search for root in /etc/passwd using grep).
7
8Upstream-Status: Pending
9
10Signed-off-by: Petre Pircalabu <petre.pircalabu@enea.com>
11
12--- a/src/tests/attach.c
13+++ b/src/tests/attach.c
14@@ -237,8 +237,8 @@ static int test_attach_cmd(struct lxc_co
15 {
16 int ret;
17 pid_t pid;
18- char *argv[] = {"cmp", "-s", "/sbin/init", "/bin/busybox", NULL};
19- lxc_attach_command_t command = {"cmp", argv};
20+ char *argv[] = {"grep", "-q", "root", "/etc/passwd", NULL};
21+ lxc_attach_command_t command = {"grep", argv};
22 lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT;
23
24 TSTOUT("Testing attach with success command...\n");
diff --git a/recipes-containers/lxc/lxc_1.0.1.bbappend b/recipes-containers/lxc/lxc_1.0.1.bbappend
new file mode 100644
index 0000000..c3311d6
--- /dev/null
+++ b/recipes-containers/lxc/lxc_1.0.1.bbappend
@@ -0,0 +1,17 @@
1FILESEXTRAPATHS_append := ":${THISDIR}/files"
2SRC_URI_append = " file://init-lxc-mount"
3SRC_URI_append = " file://lxc-busybox-support-enea-linux-init.patch"
4SRC_URI_append = " file://lxc-test-attach-replace-cmp-with-grep.patch"
5
6inherit update-rc.d
7
8INITSCRIPT_NAME = "init-lxc-mount"
9
10EXTRA_OEMAKE_append_imx6qsabrelite = " CFLAGS=-D_FILE_OFFSET_BITS=64"
11
12do_install_append() {
13 install -d ${D}${sysconfdir}/init.d
14 install -m 0755 ${WORKDIR}/init-lxc-mount ${D}${sysconfdir}/init.d/init-lxc-mount
15}
16
17FILES_${PN} += "${sysconfdir}/init.d/init-lxc-mount"