From 5763ce9a8bb89b734b406135cb2f46f835462c42 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Thu, 26 Mar 2026 13:15:38 +0000 Subject: [PATCH 1/3] overlay profiles: Drop /usr/lib/debug/.build-id from INSTALL_MASK A recent Portage fix should avoid any collisions by salting the debug files with the package name and version. The fix inadvertently broke the debuglink CRC, which gdb checks, but this went unnoticed in Gentoo because gdb prefers looking up symbols with the build-id instead. However, this was noticed in Flatcar because of the INSTALL_MASK! This has now been fixed in Gentoo, pending a new Portage release. We can drop the INSTALL_MASK now to rely on the build-id instead of the debuglink. Signed-off-by: James Le Cuirot --- .../coreos-overlay/profiles/coreos/base/make.defaults | 2 -- 1 file changed, 2 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/make.defaults b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/make.defaults index 60494bf9f27..34e2a6cbbbe 100644 --- a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/make.defaults +++ b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/make.defaults @@ -91,13 +91,11 @@ CONFIG_PROTECT=" # Remove libtool .la files for non-plugin libraries. # Remove Gentoo init files since we use systemd. -# Remove build-id, there is some issue with it causing collisions. # Remove default files from sys-power/acpid. # Do not install default repos.conf, we always put repository configuration in /etc. INSTALL_MASK=" /usr/lib*/*.la /etc/init.d /etc/conf.d /etc/user/conf.d /etc/user/init.d - /usr/lib/debug/.build-id /etc/acpi /usr/share/portage/config/repos.conf " From 2ac3a6e9df5523dc7f75213e6318048c00eaa55f Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Fri, 27 Mar 2026 16:20:17 +0000 Subject: [PATCH 2/3] overlay profiles: Remove debug build-id symlinks broken by INSTALL_MASK Otherwise they trip our QA check, which fails the build. Signed-off-by: James Le Cuirot --- .../profiles/coreos/base/profile.bashrc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/profile.bashrc b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/profile.bashrc index 6165f45d053..c3299e99058 100644 --- a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/profile.bashrc +++ b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/profile.bashrc @@ -124,6 +124,19 @@ cros_pre_pkg_setup_sysroot_build_bin_dir() { PATH+=":${CROS_BUILD_BOARD_BIN}" } +# Remove any debug build-id symlinks that are broken because of INSTALL_MASK, +# and also remove their associated debug files to avoid wasting space. +cros_post_pkg_preinst_rm_masked_debug_files() { + local link debug dir=${ED}/usr/lib/debug + [[ -d ${dir}/.build-id ]] || return + while read -d $'\n' -r link; do + debug=$(realpath "${link}.debug") || die + rm -f -- "${link}" "${link}.debug" "${debug}" || die + done < <(find "${dir}"/.build-id -xtype l ! -name "*.debug") + # -delete implies -depth so entire empty trees are deleted. + find "${dir}" -type d -empty -delete || die +} + # Avoid modifications of the preexisting users - these are provided by # our baselayout and usermod can't change anything there anyway (it # complains that the user is not in /etc/passwd). From 46861b93eb0ee32d46527e7406b28cfc3c22faf3 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Thu, 26 Mar 2026 14:15:05 +0000 Subject: [PATCH 3/3] sys-apps/baselayout: Bump to drop /usr/lib/debug dirs and symlinks Gentoo starts with this directory being empty, and Portage complains if you populate it with merge-usr symlinks. Signed-off-by: James Le Cuirot --- .../src/third_party/coreos-overlay/sys-apps/baselayout/Manifest | 2 +- ...{baselayout-3.6.8-r20.ebuild => baselayout-3.6.8-r21.ebuild} | 0 .../coreos-overlay/sys-apps/baselayout/baselayout-9999.ebuild | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/{baselayout-3.6.8-r20.ebuild => baselayout-3.6.8-r21.ebuild} (100%) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/Manifest b/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/Manifest index 8c30e5b987e..f6ac62235ea 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/Manifest +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/Manifest @@ -1 +1 @@ -DIST flatcar-baselayout-bb76459c3338ce0e76c4e48d545795bfbc9dbfd9.tar.gz 37869 BLAKE2B 2d7ca48708e4eb3dc2f68ed6fb2b86bb9a903031e3249f55f8b8a0e1d6d08ef35caa40a50560c87bd0bad2c69fc9089425469a56b66a9c9ac9eee69bc83fbe5d SHA512 4f294d82eec5d53b1b444561f01b33b768e88c44ef7d8d3d7a5ce12a42c06048656a9f8bbdcb3a2c4751eb3f92639ccbdbb6a316e35b85a242476e1de5cd3fe1 +DIST flatcar-baselayout-e721701eb2847df30d64b34a194f205ab3e5e40f.tar.gz 37838 BLAKE2B 96f8d39319fbaf9949eda64ff3a55731578f9e71ffffe07e67c253774af86bc33e798c5e23b3836dfae26912c34b1cd25da76405633f3d662efb7e1fdad617b8 SHA512 c142672f275914ca7e8ba39b3bdd9041ed221dcc81187a8c309569b7d4c0902527a12de4295992cfa2c21202c2c6bce5a6c7ab2a9ed2026fa50674878a147c67 diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-3.6.8-r20.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-3.6.8-r21.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-3.6.8-r20.ebuild rename to sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-3.6.8-r21.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-9999.ebuild index 403d3bf4979..7d8dcdb87c5 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-9999.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-9999.ebuild @@ -12,7 +12,7 @@ if [[ ${PV} == 9999 ]]; then EGIT_REPO_URI="https://github.com/flatcar/baselayout.git" inherit git-r3 else - EGIT_VERSION="bb76459c3338ce0e76c4e48d545795bfbc9dbfd9" # flatcar-master + EGIT_VERSION="e721701eb2847df30d64b34a194f205ab3e5e40f" # chewi/debug-dirs SRC_URI="https://github.com/flatcar/baselayout/archive/${EGIT_VERSION}.tar.gz -> flatcar-${PN}-${EGIT_VERSION}.tar.gz" S="${WORKDIR}/${PN}-${EGIT_VERSION}" KEYWORDS="amd64 arm64"