Skip to contentSkip to conversation

kheaders: Follow symlinks to source files.

PATCH Superseded Yifan Hong 2 participants 2 messages Apr 19, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yifan Hong

author
#0 lore raw

PATCH 1/1 kheaders: Follow symlinks to source files.

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.

---
 kernel/gen_kheaders.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/gen_kheaders.sh +1 -1
index 1ef9a87511f5..183d9a44aa39 100755
@@ -87,7 +87,7 @@ find $cpio_dir -type f -print0 |
 # pre-sorted, as --sort=name might not be available.
 find $cpio_dir -printf "./%P\n" | LC_ALL=C sort | \
     tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \
-    --owner=0 --group=0 --numeric-owner --no-recursion \
+    --owner=0 --group=0 --numeric-owner --no-recursion -h \
     -I $XZ -cf $tarfile -C $cpio_dir/ -T - > /dev/null
 
 echo $headers_md5 > kernel/kheaders.md5
Signature · 1 line
2.40.0.634.g4ca3ef3211-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Android Kernel Team

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.

---
kernel/gen_kheaders.sh | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
kernel/gen_kheaders.sh +0 -0
index 1ef9a87511f5..183d9a44aa39 100755

kernel/gen_kheaders.sh find $cpio_dir -type f -print0 | · line 90

Quoted 5 lines
kernel/gen_kheaders.sh +1 -1
@@ -87,7 +87,7 @@ find $cpio_dir -type f -print0 |
 # pre-sorted, as --sort=name might not be available.
 find $cpio_dir -printf "./%P\n" | LC_ALL=C sort | \
    tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \
-    --owner=0 --group=0 --numeric-owner --no-recursion \
+    --owner=0 --group=0 --numeric-owner --no-recursion -h \

I would have a preference for the long form --dereference as it is more descriptive.

With that, feel free to add

Cheers,
Matthias

Quoted 9 lines
kernel/gen_kheaders.sh +0 -0
    -I $XZ -cf $tarfile -C $cpio_dir/ -T - > /dev/null
 

echo $headers_md5 > kernel/kheaders.md5

Signature · 4 lines
2.40.0.634.g4ca3ef3211-goog

-- 
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].