From patchwork Wed Dec 18 10:37:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13913380 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E109D50276; Wed, 18 Dec 2024 10:37:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734518241; cv=none; b=NMk9QqL5GAblUBQSwnOLdyn0beeDumeE+5cGJna2sY9KYmZfGohARnzhEwmnm4rsL0i7g6VUjiWz1scOgdtaQglpavHueTH2bCtAm3Dh+n5oulfw84PciUxdkhtIj2hcIJBlbyU0zqjR/sJ+AXi29v+vgtkLHRZcr7L83HXc17U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734518241; c=relaxed/simple; bh=YU5c6gwvgdr0VNrIgg0SvVhOcUnbXO4oTy6HqdAT8as=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=iTzhVEFkGvnhwaQ0UoWzzNPEYLQdvqvNOO8ioPknyA8lsR+AU14OxA39qvnXpJlC8zh+i0UmTMHhvnMPaJbeK4tlHPtTTP0bfl1Sj4QFBbUfY4a4HSVtTXGTYqGTpMpc1jNXuG2V9cp7nwq/UgHeLTVKLgvwuuKfa738PGMUAVI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M9uUScFZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M9uUScFZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA2A5C4CECE; Wed, 18 Dec 2024 10:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734518240; bh=YU5c6gwvgdr0VNrIgg0SvVhOcUnbXO4oTy6HqdAT8as=; h=From:To:Cc:Subject:Date:From; b=M9uUScFZKm/czI6oBqGJNhkogb5szbKH2iFIHfegrEVuvIYLql8SEbMq5OEI9QLAx mB1Jilrz6sZ3IeYh+qSuBp3AAVxw9/dsOBgo7WbQlhltQihWZrnA/Z8e9VkJDyyXqa ead6Na8xnUaoXCAHP1rGwx6Sl3+Xizl6heYq5Ryo9AJR4hNer/Un0wCC5NSff5TyNQ /9djwhgd/UkzoV8UTnouXScCRook3U2YVHZUOnOrA3H5tEAOHql3D4CerLjJJ9drIi cJ6EVMiNVvrm4fhI5GfZuCf5xxM7lAuxJajPXv/1KWjenUbihxWmTv2meRL4niK079 t0Q2PCKqGiDFg== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 1/4] kheaders: exclude include/generated/utsversion.h from kheaders_data.tar.xz Date: Wed, 18 Dec 2024 19:37:05 +0900 Message-ID: <20241218103716.137489-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 CONFIG_IKHEADERS has a reproducibility issue because the contents of kernel/kheaders_data.tar.xz can vary depending on how you build the kernel. If you build the kernel with CONFIG_IKHEADERS enabled from a pristine state, the tarball does not include include/generated/utsversion.h. $ make -s mrproper $ make -s defconfig $ scripts/config -e CONFIG_IKHEADERS $ tar Jtf kernel/kheaders_data.tar.xz | grep utsversion However, if you build the kernel with CONFIG_IKHEADERS disabled first and then enable it later, the tarball does include include/generated/utsversion.h. $ make -s mrproper $ make -s defconfig $ make -s $ scripts/config -e CONFIG_IKHEADERS $ make -s $ tar Jtf kernel/kheaders_data.tar.xz | grep utsversion ./include/generated/utsversion.h It is not predictable whether a stale include/generated/utsversion.h remains when kheaders_data.tar.xz is generated. For better reproducibility, include/generated/utsversions.h should always be omitted. It is not necessary for the kheaders anyway. Signed-off-by: Masahiro Yamada --- kernel/gen_kheaders.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh index 383fd43ac612..a0e3fbf4afa4 100755 --- a/kernel/gen_kheaders.sh +++ b/kernel/gen_kheaders.sh @@ -83,6 +83,10 @@ for f in $dir_list; do find "$f" -name "*.h"; done | cpio --quiet -pdu $cpio_dir >/dev/null 2>&1 +# Always exclude include/generated/utsversion.h +# Otherwise, the contents of the tarball may vary depending on the build steps. +rm -f "${cpio_dir}/include/generated/utsversion.h" + # Remove comments except SDPX lines find $cpio_dir -type f -print0 | xargs -0 -P8 -n1 perl -pi -e 'BEGIN {undef $/;}; s/\/\*((?!SPDX).)*?\*\///smg;' From patchwork Wed Dec 18 10:37:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13913381 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72C8319924E; Wed, 18 Dec 2024 10:37:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734518242; cv=none; b=XplAx+Df+DZKhx9gWYYMoxrNaNDpOTdtvFLMSAn/LrPUhdSOJwX+7GeKd+R4OmFhkzM9nEPfA/iBJFgYHMxp3tuXYmW9QfUAn1JaBdFEzYr47mUxjW+fkq+7pEoG8tuqRIpaIFuDvTaQrLCWFFhP2TzPOhhoYr6aHhJ8a2v68d4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734518242; c=relaxed/simple; bh=AjUu6VWPpBTc1hTsoOVKDhr3G4FHPsKqOD/7bHQl3zA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nwh6X/irRQn3zeNWfg+SIdvjIN8uvcJokR+AM4EW/9FA5hSXsn0kzn+DhT6BFsFeSq7u1B/K76GER9uoO8HpN+IPfCyJQywgLeFj0ZcyAvBGczBMSnzFbJFyr+shA6SNu61gn3+02wppkI66Y1Jq9DGnq1zbQV22UUmkitVOXUc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NUXTZ5Os; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NUXTZ5Os" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 166C8C4CECE; Wed, 18 Dec 2024 10:37:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734518242; bh=AjUu6VWPpBTc1hTsoOVKDhr3G4FHPsKqOD/7bHQl3zA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NUXTZ5OsTu2EppDOsOppM5Bvk8EOgpcBPUFYc8a+zo0OujaEUBRYXmvlDUC0RYslh RM0spyOT6BjS+EZ2IT9RylpqPNWgHDtDqcZnCBfIq0wwvrFBMrok0SvYnYhI8w2AtR iVslySn4ri8rpjrBb8bt8ZOlnohZaM/OU9kqM92IL5NYjuC4jkl6SGdNiD6ZEUSKeY pS84GCcqhMuZkl76lSdQdEBCt4elqG2KHoazjAzGxDupBkp2V3bLJXF5kYRjbJu5sS OYX/LWgjEzgwY4NeTbazBehw8qA2yk/mQ4Q3yt3uV6XYynlJUJAG4PvWgSnkYNxOC3 muByy56d9xkCw== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 2/4] kheaders: avoid unnecessary process forks of grep Date: Wed, 18 Dec 2024 19:37:06 +0900 Message-ID: <20241218103716.137489-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241218103716.137489-1-masahiroy@kernel.org> References: <20241218103716.137489-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Exclude include/generated/{utsversion.h,autoconf.h} by using the -path option to reduce the cost of forking new processes. No functional changes are intended. Signed-off-by: Masahiro Yamada --- kernel/gen_kheaders.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh index a0e3fbf4afa4..c2eba1a0d772 100755 --- a/kernel/gen_kheaders.sh +++ b/kernel/gen_kheaders.sh @@ -48,9 +48,9 @@ all_dirs="$all_dirs $dir_list" # check include/generated/autoconf.h explicitly. # # Ignore them for md5 calculation to avoid pointless regeneration. -headers_md5="$(find $all_dirs -name "*.h" | - grep -v "include/generated/utsversion.h" | - grep -v "include/generated/autoconf.h" | +headers_md5="$(find $all_dirs -name "*.h" -a \ + ! -path include/generated/utsversion.h -a \ + ! -path include/generated/autoconf.h | xargs ls -l | md5sum | cut -d ' ' -f1)" # Any changes to this script will also cause a rebuild of the archive. From patchwork Wed Dec 18 10:37:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13913382 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 838E919AD87; Wed, 18 Dec 2024 10:37:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734518243; cv=none; b=KQICHfcTPEmnP2Jog+Te4l9riuCE+EFq2W+W9SKc1wY0zhI15x/+DdlLijqdSOiTUwCSox1b0ra+RortTrj0cwZqv8xSlXaFv1CnRS2lr1nUz6rz9fhOr5y3Ll3YeNCBHqJnY7i98o+ihnFdfWfNCOi8HwC3QbarvL7pQk29bTo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734518243; c=relaxed/simple; bh=jaubFrgndVyh3y3qFbczlUUlLcDocMf5rKrIb9MfVFs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D0+OeZT8FoJDwOSYoGuhmLBN57MdlTFZoxM1XQPOiuFZzNm9aHYkJdvwYjLjLBYbbDzih4QimsCUXybgewKMww+7mOVoLLH+o50cGksTsKKbhUKRchC5X2oCDSbxX05Z0NqIvHCE4g015Q6dAX14hRbt7vrRN7w94/dPBVssIxg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BX2mtyTB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BX2mtyTB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82FE7C4CEDE; Wed, 18 Dec 2024 10:37:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734518243; bh=jaubFrgndVyh3y3qFbczlUUlLcDocMf5rKrIb9MfVFs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BX2mtyTByLJhnPAEHEebsMm1svrm7lmcQoyg345aAwjTe9jeaS6RLDf+e1C26UXGB 9TdVwqiBEUGP5aUnqfbOj9VReaTOPpsWpwX1GD6IFcwxGc+fmE379u9qkhTKwB1P+o y7ZQ3J/4thWotsLf9+pbz3U+AfkEQRqAn7inlzQ9pXseE8IBQb8dYRxS68NPPjg9aU gnioB5ZEkIkA24WQAH564J2Eu6yrMfbjs4LSkE0lFFCigt3Rvjza+5Z50a9aLoCtN3 lqlur2B4rDDHMegU7c7jksDufv5TQZ3SOZKJQcFhtsV5m6GS2a6wa1Atjiyb/X/4MG 6cCVOZcAomohA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 3/4] kheaders: rename the 'cpio_dir' variable to 'tmpdir' Date: Wed, 18 Dec 2024 19:37:07 +0900 Message-ID: <20241218103716.137489-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241218103716.137489-1-masahiroy@kernel.org> References: <20241218103716.137489-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The next commit will get rid of the use of 'cpio' command, as there is no strong reason to use it just for copying files. Before that, this commit renames the 'cpio_dir' variable to 'tmpdir'. No functional changes are intended. Signed-off-by: Masahiro Yamada --- kernel/gen_kheaders.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh index c2eba1a0d772..ddfd1177567f 100755 --- a/kernel/gen_kheaders.sh +++ b/kernel/gen_kheaders.sh @@ -7,7 +7,7 @@ set -e sfile="$(readlink -f "$0")" outdir="$(pwd)" tarfile=$1 -cpio_dir=$outdir/${tarfile%/*}/.tmp_cpio_dir +tmpdir=$outdir/${tarfile%/*}/.tmp_dir dir_list=" include/ @@ -65,15 +65,15 @@ fi echo " GEN $tarfile" -rm -rf $cpio_dir -mkdir $cpio_dir +rm -rf "${tmpdir}" +mkdir "${tmpdir}" if [ "$building_out_of_srctree" ]; then ( cd $srctree for f in $dir_list do find "$f" -name "*.h"; - done | cpio --quiet -pd $cpio_dir + done | cpio --quiet -pd "${tmpdir}" ) fi @@ -81,23 +81,23 @@ fi # of tree builds having stale headers in srctree. Just silence CPIO for now. for f in $dir_list; do find "$f" -name "*.h"; -done | cpio --quiet -pdu $cpio_dir >/dev/null 2>&1 +done | cpio --quiet -pdu "${tmpdir}" >/dev/null 2>&1 # Always exclude include/generated/utsversion.h # Otherwise, the contents of the tarball may vary depending on the build steps. -rm -f "${cpio_dir}/include/generated/utsversion.h" +rm -f "${tmpdir}/include/generated/utsversion.h" # Remove comments except SDPX lines -find $cpio_dir -type f -print0 | +find "${tmpdir}" -type f -print0 | xargs -0 -P8 -n1 perl -pi -e 'BEGIN {undef $/;}; s/\/\*((?!SPDX).)*?\*\///smg;' # Create archive and try to normalize metadata for reproducibility. tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \ --owner=0 --group=0 --sort=name --numeric-owner --mode=u=rw,go=r,a+X \ - -I $XZ -cf $tarfile -C $cpio_dir/ . > /dev/null + -I $XZ -cf $tarfile -C "${tmpdir}/" . > /dev/null echo $headers_md5 > kernel/kheaders.md5 echo "$this_file_md5" >> kernel/kheaders.md5 echo "$(md5sum $tarfile | cut -d ' ' -f1)" >> kernel/kheaders.md5 -rm -rf $cpio_dir +rm -rf "${tmpdir}" From patchwork Wed Dec 18 10:37:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13913383 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 870BE19D080; Wed, 18 Dec 2024 10:37:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734518246; cv=none; b=BVjXPUyQCrlYnPhWadCuFKoXJHxgjwlQ/lA+lUswiAKR7BcMK9W2rlEBfH5lGmArDIJtAslvhnEG7InYlAKTeF2BDZt/NkTcVngHEOkWERhczzDCbKpeIrvkwaNj5+uaFujIG+TBxW64THbjfCyaM/DfWVUB1ZdBtwvZYOacPHE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734518246; c=relaxed/simple; bh=9stzBnrUIf1cL09+/GQ5VxyuG/aOORWUlbvpH5pqI+I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B/4ZbDkb42n2EWsH6hveAWJ7kVs3GAzq5kHmcHo3lKt/6OSvkT0vM0jpVwz3z0l+4z5rBi1Tnp/Zx4OKB/YJ8+wnH+Su0cXSQ2H3MoR34D5aIGdgiIeBeDKapmhUJxBc5s3OcEztC3Tr+IwcXgUtSJvSn40FRE1oEXF993dKVco= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CD0TVQr5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CD0TVQr5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB980C4CECE; Wed, 18 Dec 2024 10:37:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734518246; bh=9stzBnrUIf1cL09+/GQ5VxyuG/aOORWUlbvpH5pqI+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CD0TVQr57oOlfv9gA/Vw78SyhJBwizgO3St5V0oyuGrhZ95gdvk8ujLT/rMkk/JA/ ztLhiuucbjGzOpdDLJddE93Igzz2cAD7qcQ7Kwg6JbCUsu3PctHoq/9sR2QPTBZjaS MQOJS4HSxoLr07TYt7TAmxynHuhmFcqrs2bzYkRnjcbyPUx9h2FmLerY1gg8wPTd1V j09hbqkYMvElFHSCpr8ApP9nonypqLzNuYLw1oBhLZOFVtAf57PxFvc8dSWvF/wZru ouc2b+8V6GZR7CQ4pMTtwf01uvp2rkXhJnZq41fQ/A8O350hJXR+k0dpfq7CmdN5+F 5stvATtLkOcXw== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Christian Heusel , Jonathan Corbet , Nathan Chancellor , Nicolas Schier , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , linux-doc@vger.kernel.org, workflows@vger.kernel.org Subject: [PATCH 4/4] kheaders: use 'tar' instead of 'cpio' for copying files Date: Wed, 18 Dec 2024 19:37:08 +0900 Message-ID: <20241218103716.137489-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241218103716.137489-1-masahiroy@kernel.org> References: <20241218103716.137489-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 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 --- Documentation/process/changes.rst | 6 ------ kernel/gen_kheaders.sh | 13 ++----------- scripts/package/PKGBUILD | 1 - scripts/package/mkdebian | 2 +- 4 files changed, 3 insertions(+), 19 deletions(-) diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst index 82b5e378eebf..a0beca805362 100644 --- a/Documentation/process/changes.rst +++ b/Documentation/process/changes.rst @@ -59,7 +59,6 @@ iptables 1.4.2 iptables -V openssl & libcrypto 1.0.0 openssl version bc 1.06.95 bc --version Sphinx\ [#f1]_ 2.4.4 sphinx-build --version -cpio any cpio --version GNU tar 1.28 tar --version gtags (optional) 6.6.5 gtags --version mkimage (optional) 2017.01 mkimage --version @@ -536,11 +535,6 @@ mcelog - -cpio ----- - -- - Networking ********** diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh index ddfd1177567f..55f493d83b8f 100755 --- a/kernel/gen_kheaders.sh +++ b/kernel/gen_kheaders.sh @@ -14,13 +14,6 @@ include/ arch/$SRCARCH/include/ " -if ! command -v cpio >/dev/null; then - echo >&2 "***" - echo >&2 "*** 'cpio' could not be found." - echo >&2 "***" - exit 1 -fi - # Support incremental builds by skipping archive generation # if timestamps of files being archived are not changed. @@ -73,15 +66,13 @@ if [ "$building_out_of_srctree" ]; then cd $srctree for f in $dir_list do find "$f" -name "*.h"; - done | cpio --quiet -pd "${tmpdir}" + done | tar -c -f - -T - | tar -xf - -C "${tmpdir}" ) fi -# The second CPIO can complain if files already exist which can happen with out -# of tree builds having stale headers in srctree. Just silence CPIO for now. for f in $dir_list; do find "$f" -name "*.h"; -done | cpio --quiet -pdu "${tmpdir}" >/dev/null 2>&1 +done | tar -c -f - -T - | tar -xf - -C "${tmpdir}" # Always exclude include/generated/utsversion.h # Otherwise, the contents of the tarball may vary depending on the build steps. diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD index f83493838cf9..b4e474c05a0a 100644 --- a/scripts/package/PKGBUILD +++ b/scripts/package/PKGBUILD @@ -22,7 +22,6 @@ license=(GPL-2.0-only) makedepends=( bc bison - cpio flex gettext kmod diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian index b038a1380b8a..b6dd98ca860b 100755 --- a/scripts/package/mkdebian +++ b/scripts/package/mkdebian @@ -205,7 +205,7 @@ Priority: optional Maintainer: $maintainer Rules-Requires-Root: no Build-Depends: debhelper-compat (= 12) -Build-Depends-Arch: bc, bison, cpio, flex, +Build-Depends-Arch: bc, bison, flex, gcc-${host_gnu} , kmod, libelf-dev:native, libssl-dev:native, libssl-dev ,