update-linux-headers: fix forwarding to asm-generic headers
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 3 Jun 2024 11:49:49 +0000 (13:49 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 5 Jun 2024 09:01:05 +0000 (11:01 +0200)
commitef7c70f020ca1fe9e7c98ea2cd9d6ba3c5714716
treee0846f3d6b06f18452a759f874b436e2a3cc8540
parent7604bbc2d87d153e65e38cf2d671a5a9a35917b1
update-linux-headers: fix forwarding to asm-generic headers

Afer commit 3efc75ad9d9 ("scripts/update-linux-headers.sh: Remove
temporary directory inbetween", 2024-05-29), updating linux-headers/
results in errors such as

   cp: cannot stat '/tmp/tmp.1A1Eejh1UE/headers/include/asm/bitsperlong.h': No such file or directory

because Loongarch does not have an asm/bitsperlong.h file and uses the
generic version.  Before commit 3efc75ad9d9, the missing file would
incorrectly cause stale files to be included in linux-headers/.  The files
were never committed to qemu.git, but were wrong nevertheless. The build
would just use the system version of the files, which is opposite to
the idea of importing Linux header files into QEMU's tree.

Create forwarding headers, resembling the ones that are generated during a
kernel build by scripts/Makefile.asm-generic, if a file is only installed
under include/asm-generic/.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scripts/update-linux-headers.sh