Skip to contentSkip to conversation

scripts/update-linux-headers.sh: Remove temporary directory inbetween

PATCH In review Thomas Huth 3 participants 6 messages May 27, 2024 – May 28, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/update-linux-headers.sh: Remove temporary directory inbetween

We are reusing the same temporary directory for installing the headers of all targets, so there could be stale files here when switching from one target to another. Make sure to delete the folder before installing a new set of target headers into it.

---
 scripts/update-linux-headers.sh | 1 +
 1 file changed, 1 insertion(+)
scripts/update-linux-headers.sh +1 -0
index 8963c39189..fbf7e119bc 100755
@@ -112,6 +112,7 @@ for arch in $ARCHLIST; do
         arch_var=ARCH
     fi
 
+    rm -rf "$hdrdir"
     make -C "$linux" O="$blddir" INSTALL_HDR_PATH="$hdrdir" $arch_var=$arch headers_install
 
     rm -rf "$output/linux-headers/asm-$arch"
Signature · 1 line
2.45.1
#1 lore raw
Quoted 15 lines · Thomas Huth

We are reusing the same temporary directory for installing the headers of all targets, so there could be stale files here when switching from one target to another. Make sure to delete the folder before installing a new set of target headers into it.

---
 scripts/update-linux-headers.sh | 1 +
 1 file changed, 1 insertion(+)
scripts/update-linux-headers.sh +0 -0
index 8963c39189..fbf7e119bc 100755

scripts/update-linux-headers.sh for arch in $ARCHLIST; do · line 118

Quoted 7 lines
scripts/update-linux-headers.sh +1 -0
@@ -112,6 +112,7 @@ for arch in $ARCHLIST; do
         arch_var=ARCH
     fi
 
+    rm -rf "$hdrdir"
     make -C "$linux" O="$blddir" INSTALL_HDR_PATH="$hdrdir" $arch_var=$arch headers_install
 
     rm -rf "$output/linux-headers/asm-$arch"

Hm. I presume that headers-install gives us the same set of headers outside include/asm for every arch?

#2 lore raw
Quoted 20 lines · Cornelia Huck
Quoted 18 lines · Thomas Huth

We are reusing the same temporary directory for installing the headers of all targets, so there could be stale files here when switching from one target to another. Make sure to delete the folder before installing a new set of target headers into it.

---
  scripts/update-linux-headers.sh | 1 +
  1 file changed, 1 insertion(+)
scripts/update-linux-headers.sh +0 -0
index 8963c39189..fbf7e119bc 100755
@@ -112,6 +112,7 @@ for arch in $ARCHLIST; do
          arch_var=ARCH
      fi
 
Quoted 7 lines

scripts/update-linux-headers.sh for arch in $ARCHLIST; do · line 118

Quoted 4 lines
scripts/update-linux-headers.sh +1 -0
+    rm -rf "$hdrdir"
      make -C "$linux" O="$blddir" INSTALL_HDR_PATH="$hdrdir" $arch_var=$arch headers_install
 
      rm -rf "$output/linux-headers/asm-$arch"

Hm. I presume that headers-install gives us the same set of headers outside include/asm for every arch?

I just double-checked and yes, apart from a file called "a.out.h", the other headers outside of the asm subfolder are the same. So AFAICS there is still a slight chance that we might pick up a wrong file from the asm folder... shall I change the patch to only delete that subfolder? Or is that chance just too small that we can ignore it?

Thomas

Acked-by
#3 lore raw
Quoted 29 lines · Thomas Huth
Quoted 20 lines · Cornelia Huck
Quoted 18 lines · Thomas Huth

We are reusing the same temporary directory for installing the headers of all targets, so there could be stale files here when switching from one target to another. Make sure to delete the folder before installing a new set of target headers into it.

---
  scripts/update-linux-headers.sh | 1 +
  1 file changed, 1 insertion(+)
scripts/update-linux-headers.sh +0 -0
index 8963c39189..fbf7e119bc 100755
@@ -112,6 +112,7 @@ for arch in $ARCHLIST; do
          arch_var=ARCH
      fi
 
Quoted 7 lines

scripts/update-linux-headers.sh for arch in $ARCHLIST; do · line 118

Quoted 4 lines
scripts/update-linux-headers.sh +1 -0
+    rm -rf "$hdrdir"
      make -C "$linux" O="$blddir" INSTALL_HDR_PATH="$hdrdir" $arch_var=$arch headers_install
 
      rm -rf "$output/linux-headers/asm-$arch"

Hm. I presume that headers-install gives us the same set of headers outside include/asm for every arch?

Quoted 5 lines

I just double-checked and yes, apart from a file called "a.out.h", the other headers outside of the asm subfolder are the same. So AFAICS there is still a slight chance that we might pick up a wrong file from the asm folder... shall I change the patch to only delete that subfolder? Or is that chance just too small that we can ignore it?

The asm folder is probably fine, but there's a chance for errors; if moving from "use union of files for all archs outside asm" to "use files for the last arch in the list outside asm" always results in the same set of files, your patch is probably the better choice here.

Reviewed-by on v1 1/1
#4 lore raw
In reply to Thomas Huth
Quoted 6 lines · Thomas Huth

We are reusing the same temporary directory for installing the headers of all targets, so there could be stale files here when switching from one target to another. Make sure to delete the folder before installing a new set of target headers into it.

who's merging this?

Quoted 18 lines
---
 scripts/update-linux-headers.sh | 1 +
 1 file changed, 1 insertion(+)
scripts/update-linux-headers.sh +1 -0
index 8963c39189..fbf7e119bc 100755
@@ -112,6 +112,7 @@ for arch in $ARCHLIST; do
         arch_var=ARCH
     fi
 
+    rm -rf "$hdrdir"
     make -C "$linux" O="$blddir" INSTALL_HDR_PATH="$hdrdir" $arch_var=$arch headers_install
 
     rm -rf "$output/linux-headers/asm-$arch"
Signature · 1 line
2.45.1
#5 lore raw
Quoted 10 lines · Michael S. Tsirkin
Quoted 6 lines · Thomas Huth

We are reusing the same temporary directory for installing the headers of all targets, so there could be stale files here when switching from one target to another. Make sure to delete the folder before installing a new set of target headers into it.

Thanks!

Quoted 1 line

who's merging this?

I don't mind ... if nobody objects, I can put it into my next pull request.

Thomas