mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] kernel: Ignore config difference when using rootfs in kernel option
Date: Wed, 30 May 2012 18:23:05 +0200	[thread overview]
Message-ID: <20120530162305.GE31687@pengutronix.de> (raw)
In-Reply-To: <1338208981-8681-11-git-send-email-bartvdrmeulen@gmail.com>

On Mon, May 28, 2012 at 02:42:37PM +0200, Bart vdr. Meulen wrote:
> From: "Bart vdr. Meulen" <bartvdrmeulen@gmail.com>
> 
> When using a rootfs inside the kernel the config option CONFIG_INITRAMFS_SOURCE
> is changed build time, ignore this when checking for differences
> after running oldconfig.
> 
> This prevents a make failure when the source kernel.config is read-only,
> preventing the copy back action that normally takes place when a
> difference is detected.
> 
> Signed-off-by: Bart vdr. Meulen <bartvdrmeulen@gmail.com>
> ---
>  rules/kernel.make |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/rules/kernel.make b/rules/kernel.make
> index 4a45a3f..e1e3a6a 100644
> --- a/rules/kernel.make
> +++ b/rules/kernel.make
> @@ -111,16 +111,19 @@ ifdef KERNEL_INITRAMFS_SOURCE_y
>  endif
>  
>  	@$(call ptx/oldconfig, KERNEL)
> -	@diff -q -I "# [^C]" "$(KERNEL_DIR)/.config" "$(<)" > /dev/null || cp "$(KERNEL_DIR)/.config" "$(<)"
> -
>  #
> +# CONFIG_INITRAMFS_SOURCE has been changed in .config, ignore when taking diff.
>  # Don't keep the expanded path to INITRAMS_SOURCE in $(KERNEL_CONFIG),
>  # because it contains local workdir path which is not relevant to
>  # other developers.
>  #
>  ifdef KERNEL_INITRAMFS_SOURCE_y
> +	@diff -q -I "# [^C]" -I "^CONFIG_INITRAMFS_SOURCE=[^C]" "$(KERNEL_DIR)/.config" "$(<)" > /dev/null || \
> +		cp "$(KERNEL_DIR)/.config" "$(<)"
>  	@sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"# Automatically set by PTXDist\",g' \
>  		"$(<)"
> +else
> +	@diff -q -I "# [^C]" "$(KERNEL_DIR)/.config" "$(<)" > /dev/null || cp "$(KERNEL_DIR)/.config" "$(<)"
>  endif

This is getting rather complex. Maybe like this (untested):

	@cp "$(KERNEL_DIR)/.config" "$(KERNEL_DIR)/.config.ptx"
ifdef KERNEL_INITRAMFS_SOURCE_y
	@sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"# Automatically set by PTXDist\",g' \
		"$(KERNEL_DIR)/.config.ptx"
endif
	@diff -q -I "# [^C]" "$(KERNEL_DIR)/.config.ptx" "$(<)" > /dev/null || cp "$(KERNEL_DIR)/.config.ptx" "$(<)"


Michael

>  	@$(call touch)
>  
> -- 
> 1.7.9.5
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

      reply	other threads:[~2012-05-30 16:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-28 12:42 Bart vdr. Meulen
2012-05-30 16:23 ` Michael Olbrich [this message]

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=20120530162305.GE31687@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox