Commit 1f824fb
build: Fix /usr/lib permissions clobbered by COPY --from=packaging
The COPY --from=packaging /usr-extras/ /usr/ step overwrites directory
metadata from the packaging image layer. The directories under
contrib/packaging/usr-extras/ have 0770 permissions (group/world-
inaccessible) when built with a restrictive umask, which gets baked
into the packaging stage. When COPY merges /usr-extras/ into /usr/,
the destination directory metadata is updated from the source, so
/usr/lib ends up 0770 (drwxrwx---) instead of the correct 0755.
This causes subtle but fatal failures: non-root system daemons (polkit,
dbus-broker, etc.) can't traverse /usr/lib to exec their binaries, so
the booted system never becomes SSH-reachable. This is why all centos-10
grub+bls integration tests have been failing in the merge queue for the
last three days.
Fix by replacing the COPY with a RUN --mount=type=bind,from=packaging
that uses install(1) with explicit -m flags: -D creates the destination
directory and -m 0644 sets the file mode, guaranteeing correct
permissions regardless of the builder's umask.
Assisted-by: OpenCode (Claude Sonnet 4.6)
Signed-off-by: Colin Walters <walters@verbum.org>1 parent aa712ff commit 1f824fb
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
265 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
| |||
0 commit comments