[v2,01/13] initramfs: replace klibcdirs in Makefile with FORCE
diff mbox series

Message ID 20200104150238.19834-2-masahiroy@kernel.org
State New
Headers show
Series
  • initramfs: a lot of cleanups
Related show

Commit Message

Masahiro Yamada Jan. 4, 2020, 3:02 p.m. UTC
'klibcdirs' was added by commit d39a206bc35d ("kbuild: rebuild initramfs
if content of initramfs changes"). If this is just a matter of forcing
execution of the recipe line, we can replace it with FORCE.

I do not understand the purpose of

   $(deps_initramfs): klibcdirs

Remove it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

Changes in v2:
  - New patch (I forgot to submit this in v1 series)

 usr/Makefile | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Greg Thelen Jan. 6, 2020, 7:33 a.m. UTC | #1
Masahiro Yamada <masahiroy@kernel.org> wrote:

> 'klibcdirs' was added by commit d39a206bc35d ("kbuild: rebuild initramfs
> if content of initramfs changes"). If this is just a matter of forcing
> execution of the recipe line, we can replace it with FORCE.
>
> I do not understand the purpose of
>
>    $(deps_initramfs): klibcdirs
>
> Remove it.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Greg Thelen <gthelen@google.com>
Masahiro Yamada Jan. 7, 2020, 10:46 a.m. UTC | #2
(+CC: Ben Hutchings, H. Peter Anvin)

On Sun, Jan 5, 2020 at 12:03 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> 'klibcdirs' was added by commit d39a206bc35d ("kbuild: rebuild initramfs
> if content of initramfs changes"). If this is just a matter of forcing
> execution of the recipe line, we can replace it with FORCE.
>
> I do not understand the purpose of
>
>    $(deps_initramfs): klibcdirs


Perhaps, the 'klibcdirs' target might be intended
to control the directory descending
in case klibc is dropped in the kernel tree.

Anyway, klibc is built independently
of Linux kernel, and this 'klibcdirs' target
is just a no-op stub as far as the kernel tree is concerned.

Clean it up.


> Remove it.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
> Changes in v2:
>   - New patch (I forgot to submit this in v1 series)
>
>  usr/Makefile | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/usr/Makefile b/usr/Makefile
> index e6f7cb2f81db..55c942da01cd 100644
> --- a/usr/Makefile
> +++ b/usr/Makefile
> @@ -3,9 +3,6 @@
>  # kbuild file for usr/ - including initramfs image
>  #
>
> -klibcdirs:;
> -PHONY += klibcdirs
> -
>  suffix_y = $(subst $\",,$(CONFIG_INITRAMFS_COMPRESSION))
>  datafile_y = initramfs_data.cpio$(suffix_y)
>  datafile_d_y = .$(datafile_y).d
> @@ -50,13 +47,12 @@ targets := $(datafile_y)
>  # do not try to update files included in initramfs
>  $(deps_initramfs): ;
>
> -$(deps_initramfs): klibcdirs
>  # We rebuild initramfs_data.cpio if:
>  # 1) Any included file is newer than initramfs_data.cpio
>  # 2) There are changes in which files are included (added or deleted)
>  # 3) If gen_init_cpio are newer than initramfs_data.cpio
>  # 4) Arguments to gen_initramfs.sh changes
> -$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs
> +$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) FORCE
>         $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/$(datafile_d_y)
>         $(call if_changed,initfs)
>
> --
> 2.17.1
>
H. Peter Anvin Jan. 7, 2020, 5:13 p.m. UTC | #3
On January 7, 2020 2:46:29 AM PST, Masahiro Yamada <masahiroy@kernel.org> wrote:
>(+CC: Ben Hutchings, H. Peter Anvin)
>
>On Sun, Jan 5, 2020 at 12:03 AM Masahiro Yamada <masahiroy@kernel.org>
>wrote:
>>
>> 'klibcdirs' was added by commit d39a206bc35d ("kbuild: rebuild
>initramfs
>> if content of initramfs changes"). If this is just a matter of
>forcing
>> execution of the recipe line, we can replace it with FORCE.
>>
>> I do not understand the purpose of
>>
>>    $(deps_initramfs): klibcdirs
>
>
>Perhaps, the 'klibcdirs' target might be intended
>to control the directory descending
>in case klibc is dropped in the kernel tree.
>
>Anyway, klibc is built independently
>of Linux kernel, and this 'klibcdirs' target
>is just a no-op stub as far as the kernel tree is concerned.
>
>Clean it up.
>
>
>> Remove it.
>>
>> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>> ---
>>
>> Changes in v2:
>>   - New patch (I forgot to submit this in v1 series)
>>
>>  usr/Makefile | 6 +-----
>>  1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/usr/Makefile b/usr/Makefile
>> index e6f7cb2f81db..55c942da01cd 100644
>> --- a/usr/Makefile
>> +++ b/usr/Makefile
>> @@ -3,9 +3,6 @@
>>  # kbuild file for usr/ - including initramfs image
>>  #
>>
>> -klibcdirs:;
>> -PHONY += klibcdirs
>> -
>>  suffix_y = $(subst $\",,$(CONFIG_INITRAMFS_COMPRESSION))
>>  datafile_y = initramfs_data.cpio$(suffix_y)
>>  datafile_d_y = .$(datafile_y).d
>> @@ -50,13 +47,12 @@ targets := $(datafile_y)
>>  # do not try to update files included in initramfs
>>  $(deps_initramfs): ;
>>
>> -$(deps_initramfs): klibcdirs
>>  # We rebuild initramfs_data.cpio if:
>>  # 1) Any included file is newer than initramfs_data.cpio
>>  # 2) There are changes in which files are included (added or
>deleted)
>>  # 3) If gen_init_cpio are newer than initramfs_data.cpio
>>  # 4) Arguments to gen_initramfs.sh changes
>> -$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs)
>klibcdirs
>> +$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) FORCE
>>         $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/$(datafile_d_y)
>>         $(call if_changed,initfs)
>>
>> --
>> 2.17.1
>>

Yes, it is/was a hook for the klibc integration tree.

Patch
diff mbox series

diff --git a/usr/Makefile b/usr/Makefile
index e6f7cb2f81db..55c942da01cd 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -3,9 +3,6 @@ 
 # kbuild file for usr/ - including initramfs image
 #
 
-klibcdirs:;
-PHONY += klibcdirs
-
 suffix_y = $(subst $\",,$(CONFIG_INITRAMFS_COMPRESSION))
 datafile_y = initramfs_data.cpio$(suffix_y)
 datafile_d_y = .$(datafile_y).d
@@ -50,13 +47,12 @@  targets := $(datafile_y)
 # do not try to update files included in initramfs
 $(deps_initramfs): ;
 
-$(deps_initramfs): klibcdirs
 # We rebuild initramfs_data.cpio if:
 # 1) Any included file is newer than initramfs_data.cpio
 # 2) There are changes in which files are included (added or deleted)
 # 3) If gen_init_cpio are newer than initramfs_data.cpio
 # 4) Arguments to gen_initramfs.sh changes
-$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs
+$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) FORCE
 	$(Q)$(initramfs) -l $(ramfs-input) > $(obj)/$(datafile_d_y)
 	$(call if_changed,initfs)