[lxc-devel] [lxc/master] Adaptation to latest busybox

Rachid-Koucha on Github lxc-bot at linuxcontainers.org
Fri Dec 27 07:58:42 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 714 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191226/1ef2d42c/attachment.bin>
-------------- next part --------------
From e76e315c1111d8361093c24ff5fabb5e3e292e26 Mon Sep 17 00:00:00 2001
From: Rachid Koucha <47061324+Rachid-Koucha at users.noreply.github.com>
Date: Fri, 27 Dec 2019 08:49:00 +0100
Subject: [PATCH] Adaptation to latest busybox

In busybox 1.30, the help of udhcpc for "-s" option changed:
--> busybox v1.27.2: -s,--script PROG	Run PROG at DHCP events (default /usr/share/udhcpc/default.script)
--> busybox v1.30.1: -s PROG		Run PROG at DHCP events (default /etc/udhcpc/default.script)
So, I changed the command line which extracts the script name to make it work for both versions

Signed-off-by: Rachid Koucha <rachid.koucha at gmail.com>
---
 templates/lxc-busybox.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
index 2e59064408..23ec9df793 100644
--- a/templates/lxc-busybox.in
+++ b/templates/lxc-busybox.in
@@ -140,7 +140,7 @@ EOF
   chmod 644 "${rootfs}/etc/inittab" || return 1
 
   # Look for the pathname of "default.script" from the help of udhcpc
-  DEF_SCRIPT=`${BUSYBOX_EXE} udhcpc -h 2>&1 | grep -- '-s,--script PROG' | cut -d'/' -f2- | cut -d')' -f1`
+  DEF_SCRIPT=`${BUSYBOX_EXE} udhcpc --help 2>&1 | egrep -- '-s.*Run PROG' | cut -d'/' -f2- | cut -d')' -f1`
   DEF_SCRIPT_DIR=`dirname /${DEF_SCRIPT}`
   mkdir -p ${rootfs}/${DEF_SCRIPT_DIR}
   chmod 644 ${rootfs}/${DEF_SCRIPT_DIR} || return 1


More information about the lxc-devel mailing list