From 74d51c8c3e18a8b6738aff0c6f7ff706fd70eaa6 Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Thu, 26 Jun 2014 13:57:02 +0200 Subject: initial commit for Enea Linux 4.0 Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau --- recipes-containers/lxc/files/init-lxc-mount | 12 +++++ .../lxc-busybox-support-enea-linux-init.patch | 51 ++++++++++++++++++++++ .../lxc-test-attach-replace-cmp-with-grep.patch | 24 ++++++++++ 3 files changed, 87 insertions(+) create mode 100755 recipes-containers/lxc/files/init-lxc-mount create mode 100644 recipes-containers/lxc/files/lxc-busybox-support-enea-linux-init.patch create mode 100644 recipes-containers/lxc/files/lxc-test-attach-replace-cmp-with-grep.patch (limited to 'recipes-containers/lxc/files') 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 @@ +#!/bin/sh -e + +mkdir -p /sys/fs/cgroup/cpuset +mkdir -p /sys/fs/cgroup/cpu,cpuacct +mkdir -p /sys/fs/cgroup/devices +mkdir -p /sys/fs/cgroup/freezer +mkdir -p /sys/fs/cgroup/memory +mount cpuset +mount cpuacct +mount devices +mount freezer +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 @@ +lxc: Modify lxc-busybox to support Enea Linux + +In Enea Linux, the busybox commands are split between busybox.nosuid (symlinked +as /bin/busybox) and busybox.suid. This patch enables the commands provided by +the latter and also replaces the busybox init with the SysV counterpart. + +Upstream-Status: Pending + +Signed-off-by: Petre Pircalabu + +--- a/templates/lxc-busybox.in ++++ b/templates/lxc-busybox.in +@@ -129,6 +129,7 @@ EOF + # and propose a shell on the tty, the last one is + # not needed + cat <> $rootfs/etc/inittab ++id:5:initdefault: + ::sysinit:/etc/init.d/rcS + tty1::respawn:/bin/getty -L tty1 115200 vt100 + console::askfirst:/bin/sh +@@ -209,8 +210,28 @@ configure_busybox() + xargs -n1 ln -s busybox + popd > /dev/null + +- # relink /sbin/init +- ln $rootfs/bin/busybox $rootfs/sbin/init ++ which busybox.suid >/dev/null 2>&1 ++ ++ if [ $? -eq 0 ]; then ++ # copy busybox.suid in the rootfs ++ cp $(which busybox.suid) $rootfs/bin ++ if [ $? -ne 0 ]; then ++ echo "failed to copy busybox.suid in the rootfs" ++ return 1 ++ fi ++ ++ pushd $rootfs/bin > /dev/null || return 1 ++ ./busybox.suid --help | grep 'Currently defined functions:' -A300 | \ ++ grep -v 'Currently defined functions:' | tr , '\n' | \ ++ xargs -n1 ln -s busybox.suid ++ popd > /dev/null ++ fi ++ ++ # use SysV init ++ pushd $rootfs/sbin > /dev/null || return 1 ++ cp /sbin/init.sysvinit . ++ ln -s init.sysvinit init ++ popd > /dev/null + + # passwd exec must be setuid + 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 @@ +lxc: Update lxc-test-attach + +For Enea Linux, the SysV init file is different from busybox, causing cmp to +return an error. In order to preserve the test's logic it was replaced with a +command which succeeds in every situation: +(e.g. search for root in /etc/passwd using grep). + +Upstream-Status: Pending + +Signed-off-by: Petre Pircalabu + +--- a/src/tests/attach.c ++++ b/src/tests/attach.c +@@ -237,8 +237,8 @@ static int test_attach_cmd(struct lxc_co + { + int ret; + pid_t pid; +- char *argv[] = {"cmp", "-s", "/sbin/init", "/bin/busybox", NULL}; +- lxc_attach_command_t command = {"cmp", argv}; ++ char *argv[] = {"grep", "-q", "root", "/etc/passwd", NULL}; ++ lxc_attach_command_t command = {"grep", argv}; + lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; + + TSTOUT("Testing attach with success command...\n"); -- cgit v1.2.3-54-g00ecf