Skip to content

Commit aa74319

Browse files
committed
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 <[email protected]>
1 parent 6b46f5e commit aa74319

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • sdk_container/src/third_party/coreos-overlay/profiles/coreos/base

sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/profile.bashrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,18 @@ cros_pre_pkg_setup_sysroot_build_bin_dir() {
124124
PATH+=":${CROS_BUILD_BOARD_BIN}"
125125
}
126126

127+
# Remove any debug build-id symlinks that are broken because of INSTALL_MASK,
128+
# and also remove their associated debug files to avoid wasting space.
129+
cros_post_pkg_preinst_rm_masked_debug_files() {
130+
local link debug dir=${ED}/usr/lib/debug
131+
[[ -d ${dir}/.build-id ]] || return
132+
while read -d $'\n' -r link; do
133+
debug=$(realpath "${link}.debug") || die
134+
rm -f -- "${link}" "${link}.debug" "${debug}" || die
135+
done < <(find "${dir}"/.build-id -xtype l ! -name "*.debug")
136+
find "${dir}" -type d -empty -delete || die
137+
}
138+
127139
# Avoid modifications of the preexisting users - these are provided by
128140
# our baselayout and usermod can't change anything there anyway (it
129141
# complains that the user is not in /etc/passwd).

0 commit comments

Comments
 (0)