From 28fa7afc424f3dc53358c0e9b080433d78f0cd54 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 15 Jun 2023 14:10:14 -0700 Subject: [PATCH] FROMLIST: kheaders: dereferences the source tree When the kernel is built inside a sandbox container, a forest of symlinks to the source files may be created in the container. In this case, the generated kheaders.tar.xz should follow these symlinks to access the source files, instead of packing the symlinks themselves. Test: manual (add kheaders_data.tar.xz to the output, then examine the contents) Bug: 276339429 Fixes: b0acbba3f489 ("Revert "Revert "Revert "FROMLIST: kheaders: Follow symlinks to source files."""") Link: https://lore.kernel.org/lkml/20230420010029.2702543-1-elsk@google.com/ Change-Id: Ie4db22dfa13d05fdccb3ad8f4fae2fe3fead994e Signed-off-by: Yifan Hong --- kernel/gen_kheaders.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh index 1ef9a87511f5..baaa906640b9 100755 --- a/kernel/gen_kheaders.sh +++ b/kernel/gen_kheaders.sh @@ -68,7 +68,7 @@ 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 -L -pd $cpio_dir ) fi @@ -76,7 +76,7 @@ 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 -L -pdu $cpio_dir >/dev/null 2>&1 # Remove comments except SDPX lines find $cpio_dir -type f -print0 |