From patchwork Mon Apr 22 09:07:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Dawson X-Patchwork-Id: 238366 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id E77092C0120 for ; Mon, 22 Apr 2013 19:07:16 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 429533168F; Mon, 22 Apr 2013 09:07:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4kn+DWJh3np3; Mon, 22 Apr 2013 09:07:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id A7BD731779; Mon, 22 Apr 2013 09:07:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 300708F7A0 for ; Mon, 22 Apr 2013 09:07:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6E12D8C3B8 for ; Mon, 22 Apr 2013 09:07:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IhAITZTHs+P6 for ; Mon, 22 Apr 2013 09:07:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f170.google.com (mail-we0-f170.google.com [74.125.82.170]) by whitealder.osuosl.org (Postfix) with ESMTPS id AA9408C35D for ; Mon, 22 Apr 2013 09:07:13 +0000 (UTC) Received: by mail-we0-f170.google.com with SMTP id z2so5992986wey.15 for ; Mon, 22 Apr 2013 02:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:x-mailer; bh=1URnnS8Rja+EXzLLyOzNRO/0Onlk8CAQVxCi53okRy4=; b=U6/CusWJVWidoJ29rcPCw0EkP5bGmnj1B7GTT0cTVi7gOea7ey0QeLizixYmbC1Wy2 seYQa4lsiDUQq8aGgBkjnH0qYaoEzbwM8FlauniMOO5p+jq/PzDUtuXn/+E5Oi98xSPp ZJLpoEWFiOGorcmyxH/styXtKEj5c60nDK0VpwwfaGz1sNYYVHj317P+6tFVhpOK2R/v 96g2lgucXSZEk+t/doXdiXvl8vSycJzWCHjduFcbxGlxNbzzrYJy3eP8lsCimE+SnfY3 pCOmFr3HOW9Bo3S64Ejyuch8mlhZoGc5r8S/reZH7PV3X9ooarnMFr/5AuazxtNB6bMe njnA== X-Received: by 10.194.7.68 with SMTP id h4mr50311046wja.49.1366621626151; Mon, 22 Apr 2013 02:07:06 -0700 (PDT) Received: from localhost.localdomain (88-105-230-36.dynamic.dsl.as9105.com. [88.105.230.36]) by mx.google.com with ESMTPSA id fp2sm18719374wib.7.2013.04.22.02.07.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Apr 2013 02:07:05 -0700 (PDT) From: spdawson@gmail.com To: buildroot@busybox.net Date: Mon, 22 Apr 2013 10:07:02 +0100 Message-Id: <1366621622-7953-1-git-send-email-spdawson@gmail.com> X-Mailer: git-send-email 1.7.10.4 Subject: [Buildroot] [RFC] permit menu customization X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net From: Simon Dawson This patch is a first attempt at providing a mechanism by which the user can specify a local menu configuration file, for extending the Buildroot menu system. The main use case I have in mind is the selection and configuration of local packages. One problem with what is proposed here is that it is necessary to "bootstrap" the system by providing an empty Config.in.user file; ideally, this file should be touched somewhere in the top-level Makefile, and added to .gitignore, as it is really a build artefact. Signed-off-by: Simon Dawson --- Config.in | 9 +++++++++ Makefile | 20 ++++++++++++++++++++ docs/manual/customize-menu.txt | 16 ++++++++++++++++ docs/manual/customize.txt | 2 ++ 4 files changed, 47 insertions(+) create mode 100644 Config.in.user create mode 100644 docs/manual/customize-menu.txt diff --git a/Config.in b/Config.in index bbb9885..7b92d67 100644 --- a/Config.in +++ b/Config.in @@ -437,6 +437,13 @@ config BR2_PACKAGE_OVERRIDE_FILE as the source directory for a particular package. See the Buildroot documentation for more details on this feature. +config BR2_LOCAL_MENUCONFIG_FILE + string "location of a local menu configuration file" + default "$(TOPDIR)/Config.in.local" + help + A local menu configuration file can be used to add custom + entries to the Buildroot configuration menu. + config BR2_GLOBAL_PATCH_DIR string "global patch directory" help @@ -469,3 +476,5 @@ source "boot/Config.in" source "linux/Config.in" source "Config.in.legacy" + +source "Config.in.user" diff --git a/Config.in.user b/Config.in.user new file mode 100644 index 0000000..e69de29 diff --git a/Makefile b/Makefile index 0a91658..2235403 100644 --- a/Makefile +++ b/Makefile @@ -711,6 +711,26 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile --savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \ $(CONFIG_CONFIG_IN) +# Update the user menu configuration file +.PHONY: update-user-config +menuconfig nconfig gconfig xconfig config oldconfig randconfig allyesconfig allnoconfig silentoldconfig release randpackageconfig allyespackageconfig allnopackageconfig source-check print-version olddefconfig: update-user-config +%_defconfig: update-user-config +CONFIG_USER_IN=Config.in.user +CONFIG_LOCAL_IN:=$(shell grep -E '^BR2_LOCAL_MENUCONFIG_FILE=' $(BUILDROOT_CONFIG) | sed -r -e 's/^BR2_LOCAL_MENUCONFIG_FILE=\"//' -e 's/\"$$//' -e 's,\$$\(TOPDIR\),$(TOPDIR),g') +update-user-config: $(CONFIG_USER_IN) + @echo "# Buildroot auto-generated file: DO NOT EDIT" >$< +ifeq ($(CONFIG_LOCAL_IN),) + @echo "# No user menu configuration file specified" >>$< +else + $(call MESSAGE,"Updating user configuration file") + @if test -e $(CONFIG_LOCAL_IN); then \ + echo "# User menu configuration" >>$< ; \ + echo "source \"$(CONFIG_LOCAL_IN)\"" >>$< ; \ + else \ + echo "# User menu configuration file does not exist: $(CONFIG_LOCAL_IN)" >>$<; \ + fi +endif + # check if download URLs are outdated source-check: $(MAKE) DL_MODE=SOURCE_CHECK $(EXTRAMAKEARGS) source diff --git a/docs/manual/customize-menu.txt b/docs/manual/customize-menu.txt new file mode 100644 index 0000000..f4825b7 --- /dev/null +++ b/docs/manual/customize-menu.txt @@ -0,0 +1,16 @@ +// -*- mode:doc -*- ; + +[[menu-custom]] +Customizing the menu +~~~~~~~~~~~~~~~~~~~~ + +A local menu configuration file can be used to add custom entries to the +Buildroot configuration menu. + +The +BR2_LOCAL_MENUCONFIG_FILE+ configuration file option can be +used to specify the location of a local menu configuration file. + +A knowledge of the Kconfig configuration language syntax will be required +in order to write a local menu configuration file. The documentation for this +syntax is available at +http://kernel.org/doc/Documentation/kbuild/kconfig-language.txt[] diff --git a/docs/manual/customize.txt b/docs/manual/customize.txt index 0456ef1..61cb9fa 100644 --- a/docs/manual/customize.txt +++ b/docs/manual/customize.txt @@ -17,3 +17,5 @@ include::customize-toolchain.txt[] include::customize-store.txt[] include::customize-packages.txt[] + +include::customize-menu.txt[]