2020-01-04 15:06:53

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH v2 00/13] initramfs: a lot of cleanups



Masahiro Yamada (13):
initramfs: replace klibcdirs in Makefile with FORCE
gen_initramfs_list.sh: remove unused variable 'default_list'
gen_initramfs_list.sh: fix the tool name in the comment
initramfs: rename gen_initramfs_list.sh to gen_initramfs.sh
initramfs: remove redundant dependency on BLK_DEV_INITRD
initramfs: make compression options not depend on INITRAMFS_SOURCE
initramfs: make initramfs compression choice non-optional
initramfs: specify $(src)/gen_initramfs.sh as a prerequisite in
Makefile
initramfs: generate dependency list and cpio at the same time
initramfs: add default_cpio_list, and delete -d option support
gen_initramfs.sh: always output cpio even without -o option
initramfs: refactor the initramfs build rules
gen_initramfs.sh: remove intermediate cpio_list on errors

usr/.gitignore | 8 +-
usr/Kconfig | 26 ---
usr/Makefile | 97 ++++++----
usr/default_cpio_list | 6 +
...gen_initramfs_list.sh => gen_initramfs.sh} | 167 +++++-------------
usr/initramfs_data.S | 5 +-
6 files changed, 112 insertions(+), 197 deletions(-)
create mode 100644 usr/default_cpio_list
rename usr/{gen_initramfs_list.sh => gen_initramfs.sh} (53%)

--
2.17.1


2020-01-04 15:07:25

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH v2 04/13] initramfs: rename gen_initramfs_list.sh to gen_initramfs.sh

The comments in usr/Makefile wrongly refer to the script name (twice).

Line 37:
# The dependency list is generated by gen_initramfs.sh -l

Line 54:
# 4) Arguments to gen_initramfs.sh changes

There does not exist such a script.

I was going to fix the comments, but after some consideration, I thought
"gen_initramfs.sh" would be more suitable than "gen_initramfs_list.sh"
because it generates an initramfs image in the common usage.

The script generates a list that can be fed to gen_init_cpio only when
it is directly run without -o or -l option.

Signed-off-by: Masahiro Yamada <[email protected]>
---

Changes in v2: None

usr/Makefile | 2 +-
usr/{gen_initramfs_list.sh => gen_initramfs.sh} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename usr/{gen_initramfs_list.sh => gen_initramfs.sh} (100%)

diff --git a/usr/Makefile b/usr/Makefile
index 55c942da01cd..e44a66b8c051 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -24,7 +24,7 @@ $(obj)/initramfs_data.o: $(obj)/$(datafile_y) FORCE
# Generate the initramfs cpio archive

hostprogs-y := gen_init_cpio
-initramfs := $(CONFIG_SHELL) $(srctree)/$(src)/gen_initramfs_list.sh
+initramfs := $(CONFIG_SHELL) $(srctree)/$(src)/gen_initramfs.sh
ramfs-input := $(if $(filter-out "",$(CONFIG_INITRAMFS_SOURCE)), \
$(shell echo $(CONFIG_INITRAMFS_SOURCE)),-d)
ramfs-args := \
diff --git a/usr/gen_initramfs_list.sh b/usr/gen_initramfs.sh
similarity index 100%
rename from usr/gen_initramfs_list.sh
rename to usr/gen_initramfs.sh
--
2.17.1

2020-01-06 07:44:25

by Greg Thelen

[permalink] [raw]
Subject: Re: [PATCH v2 04/13] initramfs: rename gen_initramfs_list.sh to gen_initramfs.sh

Masahiro Yamada <[email protected]> wrote:

> The comments in usr/Makefile wrongly refer to the script name (twice).
>
> Line 37:
> # The dependency list is generated by gen_initramfs.sh -l
>
> Line 54:
> # 4) Arguments to gen_initramfs.sh changes
>
> There does not exist such a script.
>
> I was going to fix the comments, but after some consideration, I thought
> "gen_initramfs.sh" would be more suitable than "gen_initramfs_list.sh"
> because it generates an initramfs image in the common usage.
>
> The script generates a list that can be fed to gen_init_cpio only when
> it is directly run without -o or -l option.
>
> Signed-off-by: Masahiro Yamada <[email protected]>
> ---
>
> Changes in v2: None
>
> usr/Makefile | 2 +-
> usr/{gen_initramfs_list.sh => gen_initramfs.sh} | 0
> 2 files changed, 1 insertion(+), 1 deletion(-)
> rename usr/{gen_initramfs_list.sh => gen_initramfs.sh} (100%)

Will this break klibc? It might have a ref to the old name.
https://git.kernel.org/pub/scm/libs/klibc/klibc.git/tree/usr/Kbuild#n55

> diff --git a/usr/Makefile b/usr/Makefile
> index 55c942da01cd..e44a66b8c051 100644
> --- a/usr/Makefile
> +++ b/usr/Makefile
> @@ -24,7 +24,7 @@ $(obj)/initramfs_data.o: $(obj)/$(datafile_y) FORCE
> # Generate the initramfs cpio archive
>
> hostprogs-y := gen_init_cpio
> -initramfs := $(CONFIG_SHELL) $(srctree)/$(src)/gen_initramfs_list.sh
> +initramfs := $(CONFIG_SHELL) $(srctree)/$(src)/gen_initramfs.sh
> ramfs-input := $(if $(filter-out "",$(CONFIG_INITRAMFS_SOURCE)), \
> $(shell echo $(CONFIG_INITRAMFS_SOURCE)),-d)
> ramfs-args := \
> diff --git a/usr/gen_initramfs_list.sh b/usr/gen_initramfs.sh
> similarity index 100%
> rename from usr/gen_initramfs_list.sh
> rename to usr/gen_initramfs.sh

2020-01-06 10:28:13

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH v2 04/13] initramfs: rename gen_initramfs_list.sh to gen_initramfs.sh

(+CC Ben Hutchings, H. Peter Anvin)

In my understanding, the klibc build system is standalone.
So, the change in Linux kernel does not affect klibc at all.
Only the depending part is UAPI headers (make headers_install).

So, this patch
(https://lore.kernel.org/patchwork/patch/1175336/)
should be OK.

Please correct me if I am wrong.


On Mon, Jan 6, 2020 at 4:43 PM Greg Thelen <[email protected]> wrote:
>
> Masahiro Yamada <[email protected]> wrote:
>
> > The comments in usr/Makefile wrongly refer to the script name (twice).
> >
> > Line 37:
> > # The dependency list is generated by gen_initramfs.sh -l
> >
> > Line 54:
> > # 4) Arguments to gen_initramfs.sh changes
> >
> > There does not exist such a script.
> >
> > I was going to fix the comments, but after some consideration, I thought
> > "gen_initramfs.sh" would be more suitable than "gen_initramfs_list.sh"
> > because it generates an initramfs image in the common usage.
> >
> > The script generates a list that can be fed to gen_init_cpio only when
> > it is directly run without -o or -l option.
> >
> > Signed-off-by: Masahiro Yamada <[email protected]>
> > ---
> >
> > Changes in v2: None
> >
> > usr/Makefile | 2 +-
> > usr/{gen_initramfs_list.sh => gen_initramfs.sh} | 0
> > 2 files changed, 1 insertion(+), 1 deletion(-)
> > rename usr/{gen_initramfs_list.sh => gen_initramfs.sh} (100%)
>
> Will this break klibc? It might have a ref to the old name.
> https://git.kernel.org/pub/scm/libs/klibc/klibc.git/tree/usr/Kbuild#n55

I do not think so.

As I stated above, the klibc build system is independent of
any script in the Linux kernel.

The klibc Makefile refers to
scripts/gen_initramfs_list.sh, which does not exist.

My path is renaming
usr/gen_initramfs_list.sh to usr/gen_initramfs.sh


If the renaming had been problematic for klibc,
commit f6f57a46435d7253a52a1a07a58183678ad266a0
("initramfs: move gen_initramfs_list.sh from scripts/ to usr/")
would have already caused a problem.



Ben, Hans,
Is usr/Kbuild in klibc used?
If it is not used, is it better to delete it to avoid confusion?


Masahiro Yamada




> > diff --git a/usr/Makefile b/usr/Makefile
> > index 55c942da01cd..e44a66b8c051 100644
> > --- a/usr/Makefile
> > +++ b/usr/Makefile
> > @@ -24,7 +24,7 @@ $(obj)/initramfs_data.o: $(obj)/$(datafile_y) FORCE
> > # Generate the initramfs cpio archive
> >
> > hostprogs-y := gen_init_cpio
> > -initramfs := $(CONFIG_SHELL) $(srctree)/$(src)/gen_initramfs_list.sh
> > +initramfs := $(CONFIG_SHELL) $(srctree)/$(src)/gen_initramfs.sh
> > ramfs-input := $(if $(filter-out "",$(CONFIG_INITRAMFS_SOURCE)), \
> > $(shell echo $(CONFIG_INITRAMFS_SOURCE)),-d)
> > ramfs-args := \
> > diff --git a/usr/gen_initramfs_list.sh b/usr/gen_initramfs.sh
> > similarity index 100%
> > rename from usr/gen_initramfs_list.sh
> > rename to usr/gen_initramfs.sh



--
Best Regards
Masahiro Yamada

2020-01-07 03:03:56

by Ben Hutchings

[permalink] [raw]
Subject: Re: [PATCH v2 04/13] initramfs: rename gen_initramfs_list.sh to gen_initramfs.sh

On Mon, 2020-01-06 at 19:26 +0900, Masahiro Yamada wrote:
> (+CC Ben Hutchings, H. Peter Anvin)
>
> In my understanding, the klibc build system is standalone.
> So, the change in Linux kernel does not affect klibc at all.
> Only the depending part is UAPI headers (make headers_install).
>
> So, this patch
> (https://lore.kernel.org/patchwork/patch/1175336/)
> should be OK.
>
> Please correct me if I am wrong.

I think you're right.

[...]
> I do not think so.
>
> As I stated above, the klibc build system is independent of
> any script in the Linux kernel.
>
> The klibc Makefile refers to
> scripts/gen_initramfs_list.sh, which does not exist.
[...]

Right. I believe the original intent was to include klibc in the
kernel tree, so this would have existed because of that.

There's no sign of that in the current klibc.git, but I think it might
have gone through "git filter-branch" at some point after it was
decided not to include it upstream. In any case, this was already
broken for as long as klibc has been separate.

Ben.

--
Ben Hutchings
Larkinson's Law: All laws are basically false.



Attachments:
signature.asc (849.00 B)
This is a digitally signed message part

2020-01-07 03:23:04

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [PATCH v2 04/13] initramfs: rename gen_initramfs_list.sh to gen_initramfs.sh

On January 6, 2020 2:26:22 AM PST, Masahiro Yamada <[email protected]> wrote:
>(+CC Ben Hutchings, H. Peter Anvin)
>
>In my understanding, the klibc build system is standalone.
>So, the change in Linux kernel does not affect klibc at all.
>Only the depending part is UAPI headers (make headers_install).
>
>So, this patch
>(https://lore.kernel.org/patchwork/patch/1175336/)
>should be OK.
>
>Please correct me if I am wrong.
>
>
>On Mon, Jan 6, 2020 at 4:43 PM Greg Thelen <[email protected]> wrote:
>>
>> Masahiro Yamada <[email protected]> wrote:
>>
>> > The comments in usr/Makefile wrongly refer to the script name
>(twice).
>> >
>> > Line 37:
>> > # The dependency list is generated by gen_initramfs.sh -l
>> >
>> > Line 54:
>> > # 4) Arguments to gen_initramfs.sh changes
>> >
>> > There does not exist such a script.
>> >
>> > I was going to fix the comments, but after some consideration, I
>thought
>> > "gen_initramfs.sh" would be more suitable than
>"gen_initramfs_list.sh"
>> > because it generates an initramfs image in the common usage.
>> >
>> > The script generates a list that can be fed to gen_init_cpio only
>when
>> > it is directly run without -o or -l option.
>> >
>> > Signed-off-by: Masahiro Yamada <[email protected]>
>> > ---
>> >
>> > Changes in v2: None
>> >
>> > usr/Makefile | 2 +-
>> > usr/{gen_initramfs_list.sh => gen_initramfs.sh} | 0
>> > 2 files changed, 1 insertion(+), 1 deletion(-)
>> > rename usr/{gen_initramfs_list.sh => gen_initramfs.sh} (100%)
>>
>> Will this break klibc? It might have a ref to the old name.
>>
>https://git.kernel.org/pub/scm/libs/klibc/klibc.git/tree/usr/Kbuild#n55
>
>I do not think so.
>
>As I stated above, the klibc build system is independent of
>any script in the Linux kernel.
>
>The klibc Makefile refers to
>scripts/gen_initramfs_list.sh, which does not exist.
>
>My path is renaming
>usr/gen_initramfs_list.sh to usr/gen_initramfs.sh
>
>
>If the renaming had been problematic for klibc,
>commit f6f57a46435d7253a52a1a07a58183678ad266a0
>("initramfs: move gen_initramfs_list.sh from scripts/ to usr/")
>would have already caused a problem.
>
>
>
>Ben, Hans,
>Is usr/Kbuild in klibc used?
>If it is not used, is it better to delete it to avoid confusion?
>
>
>Masahiro Yamada
>
>
>
>
>> > diff --git a/usr/Makefile b/usr/Makefile
>> > index 55c942da01cd..e44a66b8c051 100644
>> > --- a/usr/Makefile
>> > +++ b/usr/Makefile
>> > @@ -24,7 +24,7 @@ $(obj)/initramfs_data.o: $(obj)/$(datafile_y)
>FORCE
>> > # Generate the initramfs cpio archive
>> >
>> > hostprogs-y := gen_init_cpio
>> > -initramfs := $(CONFIG_SHELL)
>$(srctree)/$(src)/gen_initramfs_list.sh
>> > +initramfs := $(CONFIG_SHELL) $(srctree)/$(src)/gen_initramfs.sh
>> > ramfs-input := $(if $(filter-out "",$(CONFIG_INITRAMFS_SOURCE)), \
>> > $(shell echo $(CONFIG_INITRAMFS_SOURCE)),-d)
>> > ramfs-args := \
>> > diff --git a/usr/gen_initramfs_list.sh b/usr/gen_initramfs.sh
>> > similarity index 100%
>> > rename from usr/gen_initramfs_list.sh
>> > rename to usr/gen_initramfs.sh

That is correct.

The klibc integration work was mainly fine in an actual kernel tree, which pulled the klibc tree.

It has obviously bitrotted somewhat, but it wouldn't be all that hard to resurrect it if there is ever interest.

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

2020-01-21 16:02:45

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH v2 00/13] initramfs: a lot of cleanups

On Sun, Jan 5, 2020 at 12:03 AM Masahiro Yamada <[email protected]> wrote:
>
>
>
> Masahiro Yamada (13):
> initramfs: replace klibcdirs in Makefile with FORCE
> gen_initramfs_list.sh: remove unused variable 'default_list'
> gen_initramfs_list.sh: fix the tool name in the comment
> initramfs: rename gen_initramfs_list.sh to gen_initramfs.sh
> initramfs: remove redundant dependency on BLK_DEV_INITRD
> initramfs: make compression options not depend on INITRAMFS_SOURCE
> initramfs: make initramfs compression choice non-optional
> initramfs: specify $(src)/gen_initramfs.sh as a prerequisite in
> Makefile
> initramfs: generate dependency list and cpio at the same time
> initramfs: add default_cpio_list, and delete -d option support
> gen_initramfs.sh: always output cpio even without -o option
> initramfs: refactor the initramfs build rules
> gen_initramfs.sh: remove intermediate cpio_list on errors

All, applied to linux-kbuild.


> usr/.gitignore | 8 +-
> usr/Kconfig | 26 ---
> usr/Makefile | 97 ++++++----
> usr/default_cpio_list | 6 +
> ...gen_initramfs_list.sh => gen_initramfs.sh} | 167 +++++-------------
> usr/initramfs_data.S | 5 +-
> 6 files changed, 112 insertions(+), 197 deletions(-)
> create mode 100644 usr/default_cpio_list
> rename usr/{gen_initramfs_list.sh => gen_initramfs.sh} (53%)
>
> --
> 2.17.1
>


--
Best Regards
Masahiro Yamada