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 <jlecuirot@microsoft.com>
This commit is contained in:
James Le Cuirot 2026-03-27 16:20:17 +00:00
parent d32cf515b0
commit 7097436580
No known key found for this signature in database
GPG Key ID: 1226415D00DD3137

View File

@ -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).