From 70974365809fd1f1dee9eb4c33705d9b3fc0db82 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 | 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 6165f45d05..c3299e9905 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).