History

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 69ef0920bdd3 ("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.

Masahiro Yamada committed 1 year ago

Commit 82a19781 parent fd2a1184 files · +3 −19Browse files

Showing the changes to scripts/package (2 of 4 files). Show all

Unified · Split

2 files
  1. scripts/package/PKGBUILD +0 −1
  2. scripts/package/mkdebian +1 −1
scripts/package/PKGBUILD+0−1
@@ -22,7 +22,6 @@ license=(GPL-2.0-only) · 21 unmodified lines
2222 makedepends=(
2323 bc
2424 bison
25− cpio
2625 flex
2726 gettext
2827 kmod
scripts/package/mkdebian+1−1
@@ -205,7 +205,7 @@ Priority: optional · 204 unmodified lines
205205 Maintainer: $maintainer
206206 Rules-Requires-Root: no
207207 Build-Depends: debhelper-compat (= 12)
208−Build-Depends-Arch: bc, bison, cpio, flex,
208+Build-Depends-Arch: bc, bison, flex,
209209 gcc-${host_gnu} <!pkg.${sourcename}.nokernelheaders>,
210210 kmod, libelf-dev:native,
211211 libssl-dev:native, libssl-dev <!pkg.${sourcename}.nokernelheaders>,