From 9ce07e778f05719115f354d4907f51295fb3fd1a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 29 Aug 2010 14:36:11 +0200 Subject: bbconfig: add COMPRESS_BBCONFIG option function old new delta bbconfig_config_bz2 - 4905 +4905 bbconfig_main 13 70 +57 bbconfig_config 21811 - -21811 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 1/0 up/down: 4962/-21811) Total: -16849 bytes Signed-off-by: Denys Vlasenko --- scripts/mkconfigs | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mkconfigs b/scripts/mkconfigs index 65dd44179..38d7ac054 100755 --- a/scripts/mkconfigs +++ b/scripts/mkconfigs @@ -26,12 +26,9 @@ # - Retain lines that begin with "# CONFIG_" # - lines that use double-quotes must \\-escape-quote them -config="$1" -if [ $# -lt 1 ] -then - config=.config -fi +config=.config +{ echo "\ #ifndef _BBCONFIGOPTS_H #define _BBCONFIGOPTS_H @@ -43,9 +40,36 @@ echo "\ * This file is generated automatically by scripts/mkconfigs. * Do not edit. */ -static const char bbconfig_config[] =" +static const char bbconfig_config[] ALIGN1 =" -sed 's/\"/\\\"/g' $config | grep "^#\? \?CONFIG_" | awk '{print "\"" $0 "\\n\"";}' +grep '^#\? \?CONFIG_' "$config" \ +| sed -e 's/\"/\\\"/g' -e 's/^/"/' -e 's/$/\\n"/' echo ";" -echo "#endif /* _BBCONFIGOPTS_H */" +echo "#endif" +} >"$1" + +{ +echo "\ +#ifndef _BBCONFIGOPTS_BZ2_H +#define _BBCONFIGOPTS_BZ2_H +/* + * busybox configuration settings. + * + * Licensed under GPLv2 or later, see file LICENSE in this source tree. + * + * This file is generated automatically by scripts/mkconfigs. + * Do not edit. + */ +static const char bbconfig_config_bz2[] ALIGN1 = {" + +grep '^#\? \?CONFIG_' "$config" \ +| bzip2 -1 | tee z.bz2 | dd bs=2 skip=1 2>/dev/null | od -v -t x1 \ +| sed -e 's/^[^ ]*//' \ + -e 's/ //g' \ + -e '/^$/d' \ + -e 's/\(..\)/0x\1,/g' + +echo "};" +echo "#endif" +} >"$2" -- cgit v1.2.3