Fix misplaced Linux headers in Arch and Debian kernel packages #17

Merged
bizkut merged 4 commits from fix-header-packaging into main 2026-06-16 13:13:44 -05:00
bizkut commented 2026-06-12 03:12:02 -05:00 (Migrated from github.com)

Problem

The kernel UAPI headers were being installed at the wrong path inside both the Arch and Debian kernel packages.

Both packagers used:

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

Because $DEST/usr already exists (modules are copied to $STAGING/usr/lib/modules first, and other staged files may already live under $PKG/usr), cp -a copies the source directory into the destination instead of merging its contents. This produced a nested usr/usr/include/linux/... layout, so the headers were not available at the expected /usr/include/linux/... path.

Fix

Merge the header contents instead of copying the directory node:

mkdir -p "$DEST/usr"
cp -a /out/staging/headers/usr/. "$DEST/usr/"

Files changed

  • docker/kernel-builder-arch/build.sh – Arch .pkg.tar.zst packaging
  • docker/kernel-builder/package-deb.sh – Debian .deb packaging

The out-of-tree module build tree (/usr/lib/modules/<kver>/build/) was already being copied correctly and is untouched.

## Problem The kernel UAPI headers were being installed at the wrong path inside both the Arch and Debian kernel packages. Both packagers used: ```bash cp -a /out/staging/headers/usr "$DEST/usr" ``` Because `$DEST/usr` already exists (modules are copied to `$STAGING/usr/lib/modules` first, and other staged files may already live under `$PKG/usr`), `cp -a` copies the source directory *into* the destination instead of merging its contents. This produced a nested `usr/usr/include/linux/...` layout, so the headers were not available at the expected `/usr/include/linux/...` path. ## Fix Merge the header contents instead of copying the directory node: ```bash mkdir -p "$DEST/usr" cp -a /out/staging/headers/usr/. "$DEST/usr/" ``` ## Files changed - `docker/kernel-builder-arch/build.sh` – Arch `.pkg.tar.zst` packaging - `docker/kernel-builder/package-deb.sh` – Debian `.deb` packaging The out-of-tree module build tree (`/usr/lib/modules/<kver>/build/`) was already being copied correctly and is untouched.
Sign in to join this conversation.
No description provided.