sys-apps/baselayout: Modify ${ROOT} rather than ${D} in pkg_preinst

update_sdk_container_image failed to update baselayout because it
touched /sys, which is not allowed in an unprivileged docker build
environment.

dumb-tmpfiles-proc.sh does not touch existing directories, but it was
modifying the staging directory rather than the live filesystem, causing
Portage to record /sys in the package's CONTENTS and then make changes
to it when merging.

We only need to create the directories in pkg_preinst because the other
file types are already created in src_install.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
This commit is contained in:
James Le Cuirot 2026-04-20 10:40:24 +01:00
parent 8f8977f668
commit 28831b50a6
No known key found for this signature in database
GPG Key ID: 1226415D00DD3137

View File

@ -94,7 +94,7 @@ pkg_preinst() {
libdirs=$(get_all_libdirs)
emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" LIBDIRS="${libdirs}" layout
SYSTEMD_JOURNAL_GID=${ACCT_GROUP_SYSTEMD_JOURNAL_ID:-190} ROOT_UID=0 ROOT_GID=0 CORE_UID=500 CORE_GID=500 \
DESTDIR=${D} "${ED}/usr/share/${PN}/dumb-tmpfiles-proc.sh" "${ED}/usr/lib/tmpfiles.d" || die
DESTDIR=${ROOT} "${ED}/usr/share/${PN}/dumb-tmpfiles-proc.sh" --exclude CZL+ "${ED}/usr/lib/tmpfiles.d" || die
rm -f "${ED}/usr/share/${PN}/Makefile" "${ED}/usr/share/${PN}/dumb-tmpfiles-proc.sh" || die
}