busybox: Enable building a minimal configuration
This starts with "make allnoconfig" rather than "make defconfig", making it easier to turn on only the needed features. Also, fix broken .config generation (the presence of "#" lines confused parseconfig).
This commit is contained in:
parent
dc0d68ffc3
commit
423e923182
@ -1,4 +1,4 @@
|
|||||||
{stdenv, fetchurl, enableStatic ? false, extraConfig ? ""}:
|
{ stdenv, fetchurl, enableStatic ? false, enableMinimal ? false, extraConfig ? "" }:
|
||||||
|
|
||||||
let
|
let
|
||||||
configParser = ''
|
configParser = ''
|
||||||
@ -7,14 +7,7 @@ let
|
|||||||
NAME=`echo "$LINE" | cut -d \ -f 1`
|
NAME=`echo "$LINE" | cut -d \ -f 1`
|
||||||
OPTION=`echo "$LINE" | cut -d \ -f 2`
|
OPTION=`echo "$LINE" | cut -d \ -f 2`
|
||||||
|
|
||||||
if test -z "$NAME"; then
|
if ! [[ "$NAME" =~ ^CONFIG_ ]]; then continue; fi
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$NAME" == "CLEAR"; then
|
|
||||||
echo "parseconfig: CLEAR"
|
|
||||||
echo > .config
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "parseconfig: removing $NAME"
|
echo "parseconfig: removing $NAME"
|
||||||
sed -i /$NAME'\(=\| \)'/d .config
|
sed -i /$NAME'\(=\| \)'/d .config
|
||||||
@ -25,19 +18,6 @@ let
|
|||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nixConfig = ''
|
|
||||||
CONFIG_PREFIX "$out"
|
|
||||||
CONFIG_INSTALL_NO_USR y
|
|
||||||
|
|
||||||
# Use the external mount.cifs program.
|
|
||||||
CONFIG_FEATURE_MOUNT_CIFS n
|
|
||||||
CONFIG_FEATURE_MOUNT_HELPERS y
|
|
||||||
'';
|
|
||||||
|
|
||||||
staticConfig = stdenv.lib.optionalString enableStatic ''
|
|
||||||
CONFIG_STATIC y
|
|
||||||
'';
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -50,14 +30,27 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
export KCONFIG_NOTIMESTAMP=1
|
export KCONFIG_NOTIMESTAMP=1
|
||||||
make defconfig
|
make ${if enableMinimal then "allnoconfig" else "defconfig"}
|
||||||
|
|
||||||
${configParser}
|
${configParser}
|
||||||
|
|
||||||
cat << EOF | parseconfig
|
cat << EOF | parseconfig
|
||||||
${staticConfig}
|
|
||||||
${nixConfig}
|
CONFIG_PREFIX "$out"
|
||||||
|
CONFIG_INSTALL_NO_USR y
|
||||||
|
|
||||||
|
${stdenv.lib.optionalString enableStatic ''
|
||||||
|
CONFIG_STATIC y
|
||||||
|
''}
|
||||||
|
|
||||||
|
# Use the external mount.cifs program.
|
||||||
|
CONFIG_FEATURE_MOUNT_CIFS n
|
||||||
|
CONFIG_FEATURE_MOUNT_HELPERS y
|
||||||
|
|
||||||
${extraConfig}
|
${extraConfig}
|
||||||
$extraCrossConfig
|
$extraCrossConfig
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
make oldconfig
|
make oldconfig
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user