1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/scripts/package
Masahiro Yamada 82a1978d0f kheaders: use 'tar' instead of 'cpio' for copying files
The 'cpio' command is used solely for copying header files to the
temporary directory. However, there is no strong reason to use 'cpio'
for this purpose. For example, scripts/package/install-extmod-build
uses the 'tar' command to copy files.

This commit replaces the use of 'cpio' with 'tar' because 'tar' is
already used in this script to generate kheaders_data.tar.xz anyway.

Performance-wide, there is no significant difference between 'cpio'
and 'tar'.

[Before]

  $ rm -fr kheaders; mkdir kheaders
  $ time sh -c '
  for f in include arch/x86/include
  do
          find "$f" -name "*.h"
  done | cpio --quiet -pd kheaders
  '
  real    0m0.148s
  user    0m0.021s
  sys     0m0.140s

[After]

  $ rm -fr kheaders; mkdir kheaders
  $ time sh -c '
  for f in include arch/x86/include
  do
          find "$f" -name "*.h"
  done | tar -c -f - -T - | tar -xf - -C kheaders
  '
  real    0m0.098s
  user    0m0.024s
  sys     0m0.131s

Revert commit 69ef0920bd ("Docs: Add cpio requirement to changes.rst")
because 'cpio' is not used anywhere else during the kernel build.
Please note that the built-in initramfs is created by the in-tree tool,
usr/gen_init_cpio, so it does not rely on the external 'cpio' command
at all.

Remove 'cpio' from the package build dependencies as well.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-01-10 23:01:22 +09:00
..
debian kbuild: deb-pkg: call more misc debhelper commands 2024-02-19 18:20:39 +09:00
builddeb kbuild: deb-pkg: allow hooks also in /usr/share/kernel 2025-01-10 23:01:21 +09:00
buildtar kbuild: package: add -e and -u options to some shell scripts 2024-07-16 16:06:18 +09:00
gen-diff-patch kbuild: package: add -e and -u options to some shell scripts 2024-07-16 16:06:18 +09:00
install-extmod-build kbuild: refactor cross-compiling linux-headers package 2025-01-10 23:01:21 +09:00
kernel.spec kbuild: rpm-pkg: ghost modules.weakdep file 2024-07-28 17:07:03 +09:00
mkdebian kheaders: use 'tar' instead of 'cpio' for copying files 2025-01-10 23:01:22 +09:00
mkspec kbuild: rpm-pkg: Fix C locale setup 2024-07-24 19:26:44 +09:00
PKGBUILD kheaders: use 'tar' instead of 'cpio' for copying files 2025-01-10 23:01:22 +09:00
snapcraft.template kbuild: remove the last use of old cmd_src_tar rule in packaging 2023-11-28 11:38:32 +09:00