From aa743198d0d97ec7da1f1e92f6976e30ef66fe76 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Fri, 27 Mar 2026 16:20:17 +0000 Subject: [PATCH] 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 | 12 ++++++++++++ 1 file changed, 12 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 6165f45d05..c3ea1148f3 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,18 @@ 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") + 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).