[lxc-devel] [lxc/master] templates: Fix busybox template

monstermunchkin on Github lxc-bot at linuxcontainers.org
Wed Jun 20 14:59:57 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 427 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180620/d83ae658/attachment.bin>
-------------- next part --------------
From 8b7681f354c0d22e35a3c13f98ab0e28cdc5e1f8 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Wed, 20 Jun 2018 16:21:31 +0200
Subject: [PATCH] templates: Fix busybox template

Use `busybox --list`, and exclude the `busybox` applet if necessary.

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 templates/lxc-busybox.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
index 82666b1cb..c283b00cb 100644
--- a/templates/lxc-busybox.in
+++ b/templates/lxc-busybox.in
@@ -187,9 +187,7 @@ configure_busybox()
   # but that only works right in a chroot with busybox >= 1.19.0
   (
     cd "${rootfs}/bin" || return 1
-    ./busybox --help | grep 'Currently defined functions:' -A300 | \
-      grep -v 'Currently defined functions:' | tr , '\n' | \
-      xargs -n1 ln -s busybox
+    ./busybox --list | grep -v busybox | xargs -n1 ln -s busybox
   )
 
   # relink /sbin/init
@@ -232,7 +230,7 @@ EOF
     usr/lib \
     lib64 \
     usr/lib64"
-  
+
   for dir in ${libdirs}; do
     if [ -d "/${dir}" ] && [ -d "${rootfs}/${dir}" ]; then
       echo "lxc.mount.entry = /${dir} ${dir} none ro,bind 0 0" >> "${path}/config"


More information about the lxc-devel mailing list