packages/utils/lxc/patches/020-lxc-checkconfig.patch
luka 7e3fe08e7f [packages] lxc: update to latest git version
Signed-off-by: Luka Perkov <luka@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@38798 3c298f89-4303-0410-b956-a3cf2f4a3e73
2013-11-14 00:08:53 +00:00

21 lines
538 B
Diff

--- a/src/lxc/lxc-checkconfig.in
+++ b/src/lxc/lxc-checkconfig.in
@@ -4,6 +4,17 @@
: ${CONFIG:=/proc/config.gz}
: ${GREP:=zgrep}
: ${MODNAME:=configs}
+: ${ZGREP:=zgrep}
+: ${GUNZIP:=gunzip}
+
+if [ -z $(which $ZGREP) ] && ! [ -z $(which $GUNZIP) ] && [ -x $(which $GUNZIP) ] && [ -f $CONFIG ] && [ "$CONFIG" == "/proc/config.gz" ] ; then
+
+ CONFIG_NEW="/tmp/config-$(uname -r)"
+ $GUNZIP -c $CONFIG > $CONFIG_NEW
+ CONFIG=$CONFIG_NEW
+
+ GREP=grep
+fi
SETCOLOR_SUCCESS="printf \\033[1;32m"
SETCOLOR_FAILURE="printf \\033[1;31m"