<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/usr/gen_initramfs.sh, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-08-20T23:02:56+00:00</updated>
<entry>
<title>gen_initramfs.sh: use gen_init_cpio -o parameter</title>
<updated>2025-08-20T23:02:56+00:00</updated>
<author>
<name>David Disseldorp</name>
<email>ddiss@suse.de</email>
</author>
<published>2025-08-19T03:05:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9135564db4904e82a3207bd2d134ca64ce618047'/>
<id>urn:sha1:9135564db4904e82a3207bd2d134ca64ce618047</id>
<content type='text'>
gen_init_cpio can now write to a file directly, so use it when
gen_initramfs.sh is called with -o (e.g. usr/Makefile invocation).

Signed-off-by: David Disseldorp &lt;ddiss@suse.de&gt;
Reviewed-by: Nicolas Schier &lt;nsc@kernel.org&gt;
Link: https://lore.kernel.org/r/20250819032607.28727-6-ddiss@suse.de
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
</content>
</entry>
<entry>
<title>initramfs: Encode dependency on KBUILD_BUILD_TIMESTAMP</title>
<updated>2023-06-06T08:54:49+00:00</updated>
<author>
<name>Benjamin Gray</name>
<email>bgray@linux.ibm.com</email>
</author>
<published>2023-06-06T06:17:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7f8256ae0efba344a9b113036b1d545a1f6cdaa7'/>
<id>urn:sha1:7f8256ae0efba344a9b113036b1d545a1f6cdaa7</id>
<content type='text'>
gen_initramfs.sh has an internal dependency on KBUILD_BUILD_TIMESTAMP
for generating file mtimes that is not exposed to make, so changing
KBUILD_BUILD_TIMESTAMP will not trigger a rebuild of the archive.

Declare the mtime date as a new parameter to gen_initramfs.sh to encode
KBUILD_BUILD_TIMESTAMP in the shell command, thereby making make aware
of the dependency.

It will rebuild if KBUILD_BUILD_TIMESTAMP changes or is newly set/unset.
It will _not_ rebuild if KBUILD_BUILD_TIMESTAMP is unset before and
after. This should be fine for anyone who doesn't care about setting
specific build times in the first place.

Reviewed-by: Andrew Donnellan &lt;ajd@linux.ibm.com&gt;
Tested-by: Andrew Donnellan &lt;ajd@linux.ibm.com&gt;
Signed-off-by: Benjamin Gray &lt;bgray@linux.ibm.com&gt;
Reviewed-by: Nicolas Schier &lt;n.schier@avm.de&gt;
Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>kbuild: replace LANG=C with LC_ALL=C</title>
<updated>2021-05-01T15:43:35+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2021-04-30T01:56:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=77a88274dc1a2cf3a775161d9a3242bc798ee680'/>
<id>urn:sha1:77a88274dc1a2cf3a775161d9a3242bc798ee680</id>
<content type='text'>
LANG gives a weak default to each LC_* in case it is not explicitly
defined. LC_ALL, if set, overrides all other LC_* variables.

  LANG  &lt;  LC_CTYPE, LC_COLLATE, LC_MONETARY, LC_NUMERIC, ...  &lt;  LC_ALL

This is why documentation such as [1] suggests to set LC_ALL in build
scripts to get the deterministic result.

LANG=C is not strong enough to override LC_* that may be set by end
users.

[1]: https://reproducible-builds.org/docs/locales/

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt; (powerpc)
Reviewed-by: Matthias Maennich &lt;maennich@google.com&gt;
Acked-by: Matthieu Baerts &lt;matthieu.baerts@tessares.net&gt; (mptcp)
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>gen_initramfs.sh: remove intermediate cpio_list on errors</title>
<updated>2020-01-15T15:26:22+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2020-01-04T15:02:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7168965ec7b10b8a2c7dea1f82f1ebadf44d64ba'/>
<id>urn:sha1:7168965ec7b10b8a2c7dea1f82f1ebadf44d64ba</id>
<content type='text'>
This script sets the -e option, so it exits on any error, in which
case it exits without cleaning up the intermediate cpio_list.

Make sure to delete it on exit.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>initramfs: refactor the initramfs build rules</title>
<updated>2020-01-15T15:26:21+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2020-01-04T15:02:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=65e00e04e5aea34b256814cfa21b32e3b94a2402'/>
<id>urn:sha1:65e00e04e5aea34b256814cfa21b32e3b94a2402</id>
<content type='text'>
Currently, usr/gen_initramfs.sh takes care of all the use-cases:

 [1] generates a cpio file unless CONFIG_INITRAMFS_SOURCE points to
     a single cpio archive

 [2] If CONFIG_INITRAMFS_SOURCE is the path to a cpio archive,
     use it as-is.

 [3] Compress the cpio file according to CONFIG_INITRAMFS_COMPRESSION_*
     unless it is passed a compressed archive.

To simplify the script, move [2] and [3] to usr/Makefile.

If CONFIG_INITRAMFS_SOURCE is the path to a cpio archive, there is
no need to run this shell script.

For the cpio archive compression, you can re-use the rules from
scripts/Makefile.lib .

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>gen_initramfs.sh: always output cpio even without -o option</title>
<updated>2020-01-15T15:25:22+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2020-01-04T15:02:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=469e87e89fd61de804bd29f6dd0380a399b567a7'/>
<id>urn:sha1:469e87e89fd61de804bd29f6dd0380a399b567a7</id>
<content type='text'>
Currently, this script outputs a cpio file when -o option is
given, but otherwise a text file in the format recognized by
gen_init_cpio.

This behavior is unclear. Make it always output a cpio file.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>initramfs: add default_cpio_list, and delete -d option support</title>
<updated>2020-01-15T15:25:22+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2020-01-04T15:02:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4538f41305c3f2c35463c996663dbf6307030ad7'/>
<id>urn:sha1:4538f41305c3f2c35463c996663dbf6307030ad7</id>
<content type='text'>
When CONFIG_INITRAMFS_SOURCE is empty, the Makefile passes the -d
option to gen_initramfs.sh to create the default initramfs, which
contains /dev, /dev/console, and /root.

This commit simplifies the default behavior; remove the -d option,
and add the default cpio list.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>initramfs: generate dependency list and cpio at the same time</title>
<updated>2020-01-15T15:25:21+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2020-01-04T15:02:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9668097599aa5fb87351bc2263e06a1c24718d40'/>
<id>urn:sha1:9668097599aa5fb87351bc2263e06a1c24718d40</id>
<content type='text'>
Currently, this script is run twice, for the dependency list, and then
for the cpio archive.

The first one is re-run every time although its build log is suppressed
so nobody notices it.

Make it work more efficiently by generating the cpio and the dependency
list at the same time.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>initramfs: specify $(src)/gen_initramfs.sh as a prerequisite in Makefile</title>
<updated>2020-01-15T15:24:38+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2020-01-04T15:02:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3e176683634cfc53dfc04366510d2989804554df'/>
<id>urn:sha1:3e176683634cfc53dfc04366510d2989804554df</id>
<content type='text'>
Specify the dependency directly in the Makefile.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Reviewed-by: Greg Thelen &lt;gthelen@google.com&gt;
</content>
</entry>
<entry>
<title>initramfs: rename gen_initramfs_list.sh to gen_initramfs.sh</title>
<updated>2020-01-14T01:42:44+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2020-01-04T15:02:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=80e715a06c2d0a24dbb818bb1dba2ef0f20d7068'/>
<id>urn:sha1:80e715a06c2d0a24dbb818bb1dba2ef0f20d7068</id>
<content type='text'>
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 &lt;masahiroy@kernel.org&gt;
</content>
</entry>
</feed>
