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