diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:19:54 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:19:54 +0200 |
commit | c158582c0fc7f4bd73980fe9adad446855f4d61b (patch) | |
tree | 31b701a2367cb983e76e76cd7c2ba176ad33e5ac /recipes-containers | |
download | meta-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')
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 | |||
3 | mkdir -p /sys/fs/cgroup/cpuset | ||
4 | mkdir -p /sys/fs/cgroup/cpu,cpuacct | ||
5 | mkdir -p /sys/fs/cgroup/devices | ||
6 | mkdir -p /sys/fs/cgroup/freezer | ||
7 | mkdir -p /sys/fs/cgroup/memory | ||
8 | mount cpuset | ||
9 | mount cpuacct | ||
10 | mount devices | ||
11 | mount freezer | ||
12 | mount 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 @@ | |||
1 | lxc: Modify lxc-busybox to support Enea Linux | ||
2 | |||
3 | In Enea Linux, the busybox commands are split between busybox.nosuid (symlinked | ||
4 | as /bin/busybox) and busybox.suid. This patch enables the commands provided by | ||
5 | the latter and also replaces the busybox init with the SysV counterpart. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-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 @@ | |||
1 | lxc: Update lxc-test-attach | ||
2 | |||
3 | For Enea Linux, the SysV init file is different from busybox, causing cmp to | ||
4 | return an error. In order to preserve the test's logic it was replaced with a | ||
5 | command which succeeds in every situation: | ||
6 | (e.g. search for root in /etc/passwd using grep). | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-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 @@ | |||
1 | FILESEXTRAPATHS_append := ":${THISDIR}/files" | ||
2 | SRC_URI_append = " file://init-lxc-mount" | ||
3 | SRC_URI_append = " file://lxc-busybox-support-enea-linux-init.patch" | ||
4 | SRC_URI_append = " file://lxc-test-attach-replace-cmp-with-grep.patch" | ||
5 | |||
6 | inherit update-rc.d | ||
7 | |||
8 | INITSCRIPT_NAME = "init-lxc-mount" | ||
9 | |||
10 | EXTRA_OEMAKE_append_imx6qsabrelite = " CFLAGS=-D_FILE_OFFSET_BITS=64" | ||
11 | |||
12 | do_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 | |||
17 | FILES_${PN} += "${sysconfdir}/init.d/init-lxc-mount" | ||