Commit 7a42391f authored by Alessandro Rubini's avatar Alessandro Rubini

userspace: new dot-config directory; allow 'make config' in target

This factorized configuration stuff out of wrap_rootfs into a build
target.  It also adds building and installing "conf" so to allow the
following commands in the target (in /wr/etc):

	  make config

	  make oldconfig     (likely after editing dot-config)

	  make defconfig

I'm unable to build menuconfig at this time, because of missing
symbols in the target's libncurses. I hope to fix this when we
bump buildroot up (thanks Adam for that!)
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent b6760017
...@@ -113,6 +113,9 @@ lua-5.1.4.tar.gz d0870f2de55d59c1c8419f36e8fac150 \ ...@@ -113,6 +113,9 @@ lua-5.1.4.tar.gz d0870f2de55d59c1c8419f36e8fac150 \
lzo-2.06.tar.gz 95380bd4081f85ef08c5209f4107e9f8 \ lzo-2.06.tar.gz 95380bd4081f85ef08c5209f4107e9f8 \
http://www.oberhumer.com/opensource/lzo/download/lzo-2.06.tar.gz http://www.oberhumer.com/opensource/lzo/download/lzo-2.06.tar.gz
make-3.81.tar.bz2 354853e0b2da90c527e35aabb8d6f1e6 \
http://ftp.gnu.org/pub/gnu/make/make-3.81.tar.bz2
m4-1.4.15.tar.bz2 c7c32540bc3842d5550f88d47ef551d8 \ m4-1.4.15.tar.bz2 c7c32540bc3842d5550f88d47ef551d8 \
http://ftp.gnu.org/pub/gnu/m4/m4-1.4.15.tar.bz2 http://ftp.gnu.org/pub/gnu/m4/m4-1.4.15.tar.bz2
......
...@@ -31,11 +31,7 @@ ROOTFS_USR_TGZ="$WRS_OUTPUT_DIR/images/wrs-usr.tar.gz" ...@@ -31,11 +31,7 @@ ROOTFS_USR_TGZ="$WRS_OUTPUT_DIR/images/wrs-usr.tar.gz"
ROOTFS_INITRAMFS="$WRS_OUTPUT_DIR/images/wrs-initramfs.gz" ROOTFS_INITRAMFS="$WRS_OUTPUT_DIR/images/wrs-initramfs.gz"
cat > $TMPSCRIPT << EOF cat > $TMPSCRIPT << EOF
. $WRS_BASE_DIR/../.config mkdir -p $TMPFS/wr
mkdir -p $TMPFS/wr/etc
cp $WRS_BASE_DIR/../.config $TMPFS/wr/etc/dot-config
cp $WRS_BASE_DIR/../Kconfig $TMPFS/wr/etc/Kconfig
cp -r $rootfs_vanilla/* $TMPFS cp -r $rootfs_vanilla/* $TMPFS
cp -r $WRS_OUTPUT_DIR/images/wr/* $TMPFS/wr cp -r $WRS_OUTPUT_DIR/images/wr/* $TMPFS/wr
cp -r $WRS_OUTPUT_DIR/images/lib/* $TMPFS/lib cp -r $WRS_OUTPUT_DIR/images/lib/* $TMPFS/lib
......
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# Buildroot 2011.11 Configuration # Buildroot 2011.11 Configuration
# Mon Dec 15 17:19:45 2014 # Wed Jul 29 20:48:17 2015
# #
BR2_HAVE_DOT_CONFIG=y BR2_HAVE_DOT_CONFIG=y
BR2_arm=y BR2_arm=y
...@@ -361,7 +361,7 @@ BR2_PACKAGE_STRACE=y ...@@ -361,7 +361,7 @@ BR2_PACKAGE_STRACE=y
# gperf requires a toolchain with C++ support enabled # gperf requires a toolchain with C++ support enabled
# #
# BR2_PACKAGE_GREP is not set # BR2_PACKAGE_GREP is not set
# BR2_PACKAGE_MAKE is not set BR2_PACKAGE_MAKE=y
# BR2_PACKAGE_MPC is not set # BR2_PACKAGE_MPC is not set
# BR2_PACKAGE_MPFR is not set # BR2_PACKAGE_MPFR is not set
# BR2_PACKAGE_LIBTOOL is not set # BR2_PACKAGE_LIBTOOL is not set
......
...@@ -309,6 +309,15 @@ configured. This allows customization of each installed switch ...@@ -309,6 +309,15 @@ configured. This allows customization of each installed switch
through a central server, without modifying the filesystem image in through a central server, without modifying the filesystem image in
each specimen. each specimen.
Starting with release 4.2, we added ``@t{make config}'' support at run
time, to be run in @t{/wr/etc}; the file is called @t{dot-config}, and
not @t{.config}. This is meant to be useful for developers, when
testing different configurations in the lab, rather than in
production. We also support ``@t{make config}'', ``@t{make
defconfig}'' and @t{make oldconfig}''. We are not yet able to
run ``@t{make menuconfig}'', but that may be added when we upgrade
@i{buildroot} after release 4.2.
@c ========================================================================== @c ==========================================================================
@node Dynamic WRS Configuration @node Dynamic WRS Configuration
@section Dynamic WRS Configuration @section Dynamic WRS Configuration
......
...@@ -6,7 +6,7 @@ WRDEV_DIR ?= $(WRS_BASE_DIR)/.. ...@@ -6,7 +6,7 @@ WRDEV_DIR ?= $(WRS_BASE_DIR)/..
# subdirectories we want to compile # subdirectories we want to compile
SUBDIRS = libwr mini-rpc libsdb \ SUBDIRS = libwr mini-rpc libsdb \
wrsw_hal wrsw_rtud tools snmpd \ wrsw_hal wrsw_rtud tools snmpd \
wrs_watchdog wrs_watchdog dot-config
# all variables are exported # all variables are exported
export export
......
Kconfig
dot-config
conf
wrs_release_defconfig
WR_INSTALL_ROOT ?= /usr/lib/white-rabbit
# # Standard stanza for cross-compilation (courtesy of the linux makefile)
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
CC = $(CROSS_COMPILE)gcc
CPP = $(CC) -E
AR = $(CROSS_COMPILE)ar
NM = $(CROSS_COMPILE)nm
STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
CFLAGS = -D KBUILD_NO_NLS
# most of this is just copying stuff in
RFILES = Kconfig dot-config wrs_release_defconfig
XFILES = conf
FILE = $(RFILES) $(XFILES)
all: $(FILES)
install: all
install -d $(WR_INSTALL_ROOT)/etc
install -m 644 $(RFILES) $(WR_INSTALL_ROOT)/etc
install -m 755 $(XFILES) $(WR_INSTALL_ROOT)/etc
install -m 644 Makefile-for-target $(WR_INSTALL_ROOT)/etc/Makefile
clean:
rm -f $(FILES)
dot-config: $(WRS_BASE_DIR)/../.config
cp $^ $@
Kconfig: $(WRS_BASE_DIR)/../Kconfig
cp $^ $@
conf:
$(CC) $(CFLAGS) -o $@ $(WRS_BASE_DIR)/../scripts/kconfig/conf.c \
$(WRS_BASE_DIR)/../scripts/kconfig/zconf.tab.c
wrs_release_defconfig: $(WRS_BASE_DIR)/../configs/wrs_release_defconfig
cp $^ $@
config:
cp dot-config .config
./conf Kconfig
mv .config.old dot-config.old
mv .config dot-config
defconfig:
cp dot-config .config
./conf -D wrs_release_defconfig Kconfig
mv .config.old dot-config.old
mv .config dot-config
oldconfig:
cp dot-config .config
./conf -o Kconfig
mv .config.old dot-config.old
mv .config dot-config
menuconfig:
@echo "Sorry, we don't support menuconfig on the target, yet"
@exit 1
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