Commit cd464b4d authored by Alessandro Rubini's avatar Alessandro Rubini

build: new configs/buildroot/ directory; use Kconfig to ask for cfg file

Both the buildroot and busybox config files are not hosted in
configs/buildroot/ within wr-switch-sw, where I expect to place
several such configuration files, at least to try different setups.

The name of the buildroot configuration file is not chosen using
Kconfig (but the default is silently applied.  If the user
provides a relative pathname, it is expanded to
wr-switch-sw/configs/buildroot .
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 9a54fa10
mainmenu "White Rabbit Switch configuration"
config BR2_CONFIGFILE
string "Configuration file for Buildroot"
default "wrs_release_br2_config"
help
The configuration file selects which packages are to be
included in the WRS filesystem and which are not. If
you pass a relative pathname, the build procedure will
look for it in wr-switch-sw/configs/buildroot, while
absolute pathnames are used unchanged.
If the string being passed doesn't refer to a file, the
scripts print a warning and use the default file. Incorrect
files lead to unpredicatable results.
......@@ -24,23 +24,34 @@ wrs_echo "Uncompressing buildroot"
rm -rf $dirname
tar xjf ${WRS_DOWNLOAD_DIR}/$zipname || wrs_die "untar $zipname"
# copy the config and replace "-j" level. First remove it in case it's left in
cd $WRS_OUTPUT_DIR/build/${dirname}
CFG="$WRS_BASE_DIR/../patches/buildroot/buildroot-config-wrswitch"
# select configuration: old default, overridden by Kconfig and environment
CFG_DEFAULT="$WRS_BASE_DIR/../configs/buildroot/wrs_release_br2_config"
CFG="$CONFIG_BR2_CONFIGFILE"
if [ "x$WRS_BUILDROOT_CONFIG" != "x" ]; then
if [ -f $WRS_BUILDROOT_CONFIG ]; then
CFG=$WRS_BUILDROOT_CONFIG
else
wrs_warn "WRS_BUILDROOT_CONFIG is not a regular file: ignoring it"
sleep 3
fi
fi
# turn a relative CFG pathname into an absolute name
if echo $CFG | grep -q '^/'; then
true
else
CFG="$WRS_BASE_DIR/../configs/buildroot/$CFG"
fi
# check, and revert to default if needed
if [ ! -f "$CFG" ]; then
wrs_warn "Ignoring \"$CFG\" (not a regular file)"
CFG="$CFG_DEFAULT"
fi
wrs_echo "Configuring with \"$CFG\""
cd $WRS_OUTPUT_DIR/build/${dirname}
cp $CFG .config
# If busybox configuration is inside wr-switch-sw (currently it is),
# fix the config filename
sed -i "s,__WR_SWITCH_SW__,$WRS_BASE_DIR/..," .config
sed -i "s,__WR_SWITCH_SW__,$WRS_BASE_DIR/../configs/buildroot," .config
# replace "-j" level. First remove it in case it's left in
sed -i /^BR2_JLEVEL/d .config
# make 3.82 splits the work differently, and compilation fails. So no -j
makefails=$(make -v | awk 'NR==1 {if ($NF > 3.81) print "fail"}')
......
......@@ -222,7 +222,7 @@ BR2_PACKAGE_BUSYBOX=y
BR2_BUSYBOX_VERSION_1_19_X=y
# BR2_PACKAGE_BUSYBOX_SNAPSHOT is not set
BR2_BUSYBOX_VERSION="1.19.3"
BR2_PACKAGE_BUSYBOX_CONFIG="__WR_SWITCH_SW__/patches/buildroot/busybox-config-wrswitch"
BR2_PACKAGE_BUSYBOX_CONFIG="__WR_SWITCH_SW__/wrs_release_busybox_config"
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_CUSTOMIZE=y
......
#
# Automatically generated make config: don't edit
#
CONFIG_BR2_CONFIGFILE="wrs_release_br2_config"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment