All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] initramfs: Fix spurious rebuilds
@ 2017-01-04  1:37 Florian Fainelli
  2017-01-04 13:34 ` klondike
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2017-01-04  1:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: torvalds, pebolle, ppandit, mmarek, Florian Fainelli,
	Francisco Blas Izquierdo Riera (klondike),
	Andrew Morton

Commit 35e669e1a254 ("initramfs: select builtin initram
compression algorithm on KConfig instead of Makefile") makes suffix_y be
a quote variable, which can be illustrated looking at the build output:

  GEN     usr/initramfs_data.cpio".gz"

Make sure that we do strip off double quotes from
CONFIG_INITRAMFS_COMPRESSION, since the Makefile tracks targets with
unquoted suffixes.

Fixes: 35e669e1a254 ("initramfs: select builtin initram compression algorithm on KConfig instead of Makefile")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
This is against v4.10-rc2, thanks!

 usr/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr/Makefile b/usr/Makefile
index 17a513268325..a9ae8b493e2b 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -5,7 +5,7 @@
 klibcdirs:;
 PHONY += klibcdirs
 
-suffix_y = $(CONFIG_INITRAMFS_COMPRESSION)
+suffix_y = $(subst ",,$(CONFIG_INITRAMFS_COMPRESSION))
 AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)"
 
 # Generate builtin.o based on initramfs_data.o
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] initramfs: Fix spurious rebuilds
  2017-01-04  1:37 [PATCH] initramfs: Fix spurious rebuilds Florian Fainelli
@ 2017-01-04 13:34 ` klondike
  2017-01-04 14:39   ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: klondike @ 2017-01-04 13:34 UTC (permalink / raw)
  To: Florian Fainelli, linux-kernel
  Cc: torvalds, pebolle, ppandit, mmarek, Andrew Morton, npiggin


[-- Attachment #1.1: Type: text/plain, Size: 1800 bytes --]

El 04/01/17 a las 02:37, Florian Fainelli escribió:
> Commit 35e669e1a254 ("initramfs: select builtin initram
> compression algorithm on KConfig instead of Makefile") makes suffix_y be
> a quote variable, which can be illustrated looking at the build output:
>
>   GEN     usr/initramfs_data.cpio".gz"
>
> Make sure that we do strip off double quotes from
> CONFIG_INITRAMFS_COMPRESSION, since the Makefile tracks targets with
> unquoted suffixes.
>
> Fixes: 35e669e1a254 ("initramfs: select builtin initram compression algorithm on KConfig instead of Makefile")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> This is against v4.10-rc2, thanks!
>
>  usr/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/usr/Makefile b/usr/Makefile
> index 17a513268325..a9ae8b493e2b 100644
> --- a/usr/Makefile
> +++ b/usr/Makefile
> @@ -5,7 +5,7 @@
>  klibcdirs:;
>  PHONY += klibcdirs
>  
> -suffix_y = $(CONFIG_INITRAMFS_COMPRESSION)
> +suffix_y = $(subst ",,$(CONFIG_INITRAMFS_COMPRESSION))
>  AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)"
>  
>  # Generate builtin.o based on initramfs_data.o

Hello,

Thanks for the fix, when I tested the patch I checked that the correct
file was created and embedded but didn't check for spurious rebuilds.

I'm CCing Nicholas Piggin as he sent another (larger version) of the
patch which also addresses a few other hacks in the Makefile, see
"[PATCH] kbuild: Fix dependency checking for initramfs build". I haven't
had time to check that second patch.

I have run the tests I ran for my own patches and they all passed, so 
feel free to add Reviewed-by and Tested-by if you want :)

Sincerely,
Francisco Blas Izquierdo Riera (klondike)



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] initramfs: Fix spurious rebuilds
  2017-01-04 13:34 ` klondike
@ 2017-01-04 14:39   ` Florian Fainelli
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2017-01-04 14:39 UTC (permalink / raw)
  To: klondike, linux-kernel, npiggin
  Cc: torvalds, pebolle, ppandit, mmarek, Andrew Morton



On 01/04/2017 05:34 AM, klondike wrote:
> El 04/01/17 a las 02:37, Florian Fainelli escribió:
>> Commit 35e669e1a254 ("initramfs: select builtin initram
>> compression algorithm on KConfig instead of Makefile") makes suffix_y be
>> a quote variable, which can be illustrated looking at the build output:
>>
>>   GEN     usr/initramfs_data.cpio".gz"
>>
>> Make sure that we do strip off double quotes from
>> CONFIG_INITRAMFS_COMPRESSION, since the Makefile tracks targets with
>> unquoted suffixes.
>>
>> Fixes: 35e669e1a254 ("initramfs: select builtin initram compression algorithm on KConfig instead of Makefile")
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>> This is against v4.10-rc2, thanks!
>>
>>  usr/Makefile | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/usr/Makefile b/usr/Makefile
>> index 17a513268325..a9ae8b493e2b 100644
>> --- a/usr/Makefile
>> +++ b/usr/Makefile
>> @@ -5,7 +5,7 @@
>>  klibcdirs:;
>>  PHONY += klibcdirs
>>  
>> -suffix_y = $(CONFIG_INITRAMFS_COMPRESSION)
>> +suffix_y = $(subst ",,$(CONFIG_INITRAMFS_COMPRESSION))
>>  AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)"
>>  
>>  # Generate builtin.o based on initramfs_data.o
> 
> Hello,
> 
> Thanks for the fix, when I tested the patch I checked that the correct
> file was created and embedded but didn't check for spurious rebuilds.
> 
> I'm CCing Nicholas Piggin as he sent another (larger version) of the
> patch which also addresses a few other hacks in the Makefile, see
> "[PATCH] kbuild: Fix dependency checking for initramfs build". I haven't
> had time to check that second patch.

Nick's patch [1] is a more elegant way to solve this, although it
introduces more changes, so may be less suitable for a -rc fix? There
are also some potential things that may or may not be relevant:

+AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE=usr/$(datafile_y)

INITRAMFS_IMAGE now gets defined without quotes, which may not be a
problem, but does not seem necessary.

-targets := initramfs_data.cpio.gz initramfs_data.cpio.bz2 \
-	initramfs_data.cpio.lzma initramfs_data.cpio.xz \
-	initramfs_data.cpio.lzo initramfs_data.cpio.lz4 \
-	initramfs_data.cpio
+targets := $(datafile_y)

Humm that could actually cause some additional rebuild if you kept your
initramfs image unchanged, but you are switching between compression
algorithms selection, but that may fall under the premature optimization
case.

[1]: https://www.spinics.net/lists/linux-kbuild/msg14078.html
-- 
Florian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-04 14:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-04  1:37 [PATCH] initramfs: Fix spurious rebuilds Florian Fainelli
2017-01-04 13:34 ` klondike
2017-01-04 14:39   ` Florian Fainelli

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.