update_chroot/build_packages: trigger @preserved-rebuild

Rebuilds packages that are linked against old libraries that have been
upgraded or removed from the system. Skipping this can lead to shared
library checks looking ok in the build root but then built images have
broken library dependencies.
This commit is contained in:
Michael Marineau 2015-07-12 15:47:34 -07:00
parent 494505ec7d
commit 9d4d888429
2 changed files with 15 additions and 0 deletions

View File

@ -125,6 +125,7 @@ fi
# Setup all the emerge command/flags.
EMERGE_FLAGS=( -uDNv --backtrack=30 --select )
REBUILD_FLAGS=()
EMERGE_CMD=( "emerge-${FLAGS_board}" )
if [[ "${FLAGS_fetchonly}" -eq "${FLAGS_TRUE}" ]]; then
EMERGE_CMD+=( --fetchonly )
@ -144,10 +145,12 @@ if [[ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ||
# Only update toolchain when binpkgs are available.
EMERGE_FLAGS+=( $(get_binonly_args) )
REBUILD_FLAGS+=( $(get_binonly_args) )
fi
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
EMERGE_FLAGS+=( --jobs=${FLAGS_jobs} )
REBUILD_FLAGS+=( --jobs=${FLAGS_jobs} )
fi
if [[ "${FLAGS_rebuild}" -eq "${FLAGS_TRUE}" ]]; then
@ -222,6 +225,10 @@ info "Merging board packages now"
sudo -E "${EMERGE_CMD[@]}" "${EMERGE_FLAGS[@]}" \
@system coreos-devel/board-packages
if "portageq-${BOARD}" list_preserved_libs "${BOARD_ROOT}" >/dev/null; then
sudo -E "${EMERGE_CMD[@]}" "${REBUILD_FLAGS[@]}" @preserved-rebuild
fi
info "Checking build root"
test_image_content "${BOARD_ROOT}"

View File

@ -169,6 +169,7 @@ done
"${BUILD_LIBRARY_DIR}/set_lsb_release" --root /
EMERGE_FLAGS="-uNv --with-bdeps=y --select"
REBUILD_FLAGS=""
if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
EMERGE_FLAGS="${EMERGE_FLAGS} --usepkg"
if [ "${FLAGS_getbinpkg}" -eq "${FLAGS_TRUE}" ]; then
@ -177,10 +178,12 @@ if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
# Only update toolchain when binpkgs are available.
EMERGE_FLAGS+=" $(get_binonly_args $(get_chost_list))"
REBUILD_FLAGS+=" $(get_binonly_args $(get_chost_list))"
fi
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
EMERGE_FLAGS+=" --jobs=${FLAGS_jobs}"
REBUILD_FLAGS+=" --jobs=${FLAGS_jobs}"
fi
# Perform an update of coreos-devel/sdk-depends and world in the chroot.
@ -223,6 +226,11 @@ info "Updating all SDK packages"
sudo -E ${EMERGE_CMD} ${EMERGE_FLAGS} \
coreos-devel/sdk-depends world
if portageq list_preserved_libs / >/dev/null; then
info "Rebuilding packages linked against old libraries"
sudo -E ${EMERGE_CMD} ${REBUILD_FLAGS} @preserved-rebuild
fi
# Automatically discard all CONFIG_PROTECT'ed files. Those that are
# protected should not be overwritten until the variable is changed.
# Autodiscard is option "-9" followed by the "YES" confirmation.