All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Hoffmann <sho@relinux.de>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] Linux: save a copy of the config file
Date: Thu, 14 Feb 2013 18:51:51 +0100	[thread overview]
Message-ID: <511D2437.3010403@relinux.de> (raw)
In-Reply-To: <1359303072-1947-2-git-send-email-sho@relinux.de>

Hi,

since this patch is obsolete I removed it from patchwork.

Regards

Stephan

Am 27.01.2013 17:11, schrieb Stephan Hoffmann:
> "make linux-xconfig" stores the changes made in the build
> directory. Calling "make clean && make" later discards and
> replaces them with the default values. This is not what a
> user expects.
>
> This patch saves a copy of the modified config file as
> $(TOPDIR)/linux-config and retrieves it from there after
> "make clean". $(TOPDIR)/linux-config is removed when a new
> defconfig is made.
>
> For convenience we also copy the defconfig file to
> $(TOPDIR)/linux-defconfig after a "make linux-savedefconfig"
>
> Signed-off-by: Stephan Hoffmann <sho@relinux.de>
> ---
>  Makefile       |    2 ++
>  linux/linux.mk |   15 ++++++++++++++-
>  2 files changed, 16 insertions(+), 1 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 95ed683..af820ce 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -674,11 +674,13 @@ silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
>  defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
>  	@mkdir -p $(BUILD_DIR)/buildroot-config
>  	rm -f $(TOPDIR)/busybox-config
> +	rm -f $(TOPDIR)/linux-config
>  	@$(COMMON_CONFIG_ENV) $< --defconfig$(if $(BR2_DEFCONFIG),=$(BR2_DEFCONFIG)) $(CONFIG_CONFIG_IN)
>  
>  %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile
>  	@mkdir -p $(BUILD_DIR)/buildroot-config
>  	rm -f $(TOPDIR)/busybox-config
> +	rm -f $(TOPDIR)/linux-config
>  	@$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
>  
>  savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
> diff --git a/linux/linux.mk b/linux/linux.mk
> index 91a9f50..18609b5 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -155,8 +155,17 @@ else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
>  KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)
>  endif
>  
> +# If we have a seved config file from a prevuios run we use this instead of the default one
> +define LINUX_GET_SAVED_CONFIG
> +	if [ -f $(TOPDIR)/linux-config ] ; then \
> +		cp $(TOPDIR)/linux-config $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig; \
> +	else \
> +		cp $(KERNEL_SOURCE_CONFIG) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig; \
> +	fi
> +endef
> +
>  define LINUX_CONFIGURE_CMDS
> -	cp $(KERNEL_SOURCE_CONFIG) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
> +	$(call LINUX_GET_SAVED_CONFIG)
>  	$(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) buildroot_defconfig
>  	rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
>  	$(if $(BR2_ARM_EABI),
> @@ -184,6 +193,7 @@ define LINUX_CONFIGURE_CMDS
>  	$(if $(BR2_LINUX_KERNEL_APPENDED_DTB),
>  		$(call KCONFIG_ENABLE_OPT,CONFIG_ARM_APPENDED_DTB,$(@D)/.config))
>  	yes '' | $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) oldconfig
> +	cp $(@D)/.config $(TOPDIR)/linux-config
>  endef
>  
>  ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT),y)
> @@ -272,11 +282,14 @@ ifeq ($(BR2_LINUX_KERNEL),y)
>  linux-menuconfig linux-xconfig linux-gconfig linux-nconfig linux26-menuconfig linux26-xconfig linux26-gconfig linux26-nconfig: dirs linux-configure
>  	$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) \
>  		$(subst linux-,,$(subst linux26-,,$@))
> +	# copy the config file for later reference
> +	cp $(LINUX_DIR)/.config $(TOPDIR)/linux-config
>  	rm -f $(LINUX_DIR)/.stamp_{built,target_installed,images_installed}
>  
>  linux-savedefconfig linux26-savedefconfig: dirs linux-configure
>  	$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) \
>  		$(subst linux-,,$(subst linux26-,,$@))
> +	cp $(LINUX_DIR)/defconfig $(TOPDIR)/linux-defconfig
>  
>  ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
>  linux-update-config linux26-update-config: linux-configure $(LINUX_DIR)/.config


-- 
reLinux     -    Stephan Hoffmann
Am Schmidtgrund 124    50765 K?ln
Tel. +49.221.95595-19    Fax: -64
www.reLinux.de     sho at reLinux.de

  reply	other threads:[~2013-02-14 17:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-27 16:08 [Buildroot] Linux and busybox-configfiles Stephan Hoffmann
2013-01-27 16:11 ` [Buildroot] [PATCH 1/2] Busybox: save a copy of the config file Stephan Hoffmann
2013-02-14 17:53   ` Stephan Hoffmann
2013-01-27 16:11 ` [Buildroot] [PATCH 2/2] Linux: " Stephan Hoffmann
2013-02-14 17:51   ` Stephan Hoffmann [this message]
2013-01-27 22:36 ` [Buildroot] Linux and busybox-configfiles Arnout Vandecappelle
2013-01-28  7:59   ` Jeremy Rosen
2013-01-28  8:47   ` Stephan Hoffmann
2013-01-29  0:16   ` Shawn J. Goff
2013-01-29  7:57     ` Stephan Hoffmann
2013-01-29 13:45       ` Shawn J. Goff
2013-01-29 17:33   ` Arnout Vandecappelle
2013-01-30  7:50     ` Jeremy Rosen
2013-01-30  9:54       ` Arnout Vandecappelle
2013-01-30 10:01         ` Jeremy Rosen
2013-01-30 10:41           ` Stephan Hoffmann
2013-01-28  9:16 ` Willy Lambert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=511D2437.3010403@relinux.de \
    --to=sho@relinux.de \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.