fix(kernel): merge UAPI headers into existing usr/ directory (#17)

Both packagers copied the staged UAPI headers with:

    cp -a /out/staging/headers/usr "$DEST/usr"

Because $DEST/usr already exists (modules live under $STAGING/usr/lib/modules,
and other files may be staged under $PKG/usr), cp placed the source directory
inside the destination, producing a nested usr/usr/include/ path. The headers
were therefore installed at the wrong location and not found by builds.

Merge the contents with cp -a .../usr/. "$DEST/usr/" so the headers land at
the expected /usr/include/linux/... path in both .deb and .pkg.tar.zst
packages.
This commit is contained in:
Hasanuddin Abu Bakar
2026-06-17 02:13:44 +08:00
committed by GitHub
parent 7d5efa0583
commit 76824ba725
2 changed files with 7 additions and 2 deletions

View File

@@ -31,7 +31,9 @@ cp -a "/out/staging/lib/modules/$KVER" "$STAGING/usr/lib/modules/"
# Kernel headers (for out-of-tree module builds) # Kernel headers (for out-of-tree module builds)
if [ -d /out/staging/headers ]; then if [ -d /out/staging/headers ]; then
# UAPI headers (/usr/include/linux/, /usr/include/asm/, etc.) # UAPI headers (/usr/include/linux/, /usr/include/asm/, etc.)
cp -a /out/staging/headers/usr "$STAGING/usr" # $STAGING/usr already exists (modules were copied there), so merge
# contents instead of creating a nested usr/usr/include/ directory.
cp -a /out/staging/headers/usr/. "$STAGING/usr/"
# Build headers (/usr/lib/modules/$KVER/build/) # Build headers (/usr/lib/modules/$KVER/build/)
mkdir -p "$STAGING/usr/lib/modules/$KVER" mkdir -p "$STAGING/usr/lib/modules/$KVER"
cp -a /out/staging/headers/lib/modules/$KVER/build "$STAGING/usr/lib/modules/$KVER/build" cp -a /out/staging/headers/lib/modules/$KVER/build "$STAGING/usr/lib/modules/$KVER/build"

View File

@@ -20,7 +20,10 @@ cp -a "$STAGING/lib/modules/$KVER" "$PKG/lib/modules/"
# Kernel headers (for out-of-tree module builds) # Kernel headers (for out-of-tree module builds)
if [ -d "$STAGING/headers" ]; then if [ -d "$STAGING/headers" ]; then
cp -a "$STAGING/headers/usr" "$PKG/usr" # $PKG/usr may already exist from other staged files, so merge contents
# instead of creating a nested usr/usr/include/ directory.
mkdir -p "$PKG/usr"
cp -a "$STAGING/headers/usr/." "$PKG/usr/"
# Point /lib/modules/$KVER/build at the installed headers # Point /lib/modules/$KVER/build at the installed headers
HDR_DEST="/usr/lib/modules/$KVER/build" HDR_DEST="/usr/lib/modules/$KVER/build"
mkdir -p "$PKG/usr/lib/modules/$KVER" mkdir -p "$PKG/usr/lib/modules/$KVER"