diff --git a/build_library/prod_image_util.sh b/build_library/prod_image_util.sh index a4f11bfcc2..331236afff 100755 --- a/build_library/prod_image_util.sh +++ b/build_library/prod_image_util.sh @@ -67,7 +67,7 @@ create_prod_image() { # Add a tmpfiles rule that symlink ld.so.conf from /usr into / sudo tee "${root_fs_dir}/usr/lib64/tmpfiles.d/baselayout-ldso.conf" \ > /dev/null <&2 + return 1 + fi + + # may be called from either catalyst (root) or upgrade_chroot (user) + local sudo="env" + if [[ $(id -u) -ne 0 ]]; then + sudo="sudo -E" + fi + + if [[ "${latest}" != $(gcc-config -c "$1") ]]; then + $sudo gcc-config "${latest}" + fi +} diff --git a/update_chroot b/update_chroot index 332f49e098..0e23dfa9f0 100755 --- a/update_chroot +++ b/update_chroot @@ -158,6 +158,8 @@ sudo -E ${EMERGE_CMD} --quiet ${EMERGE_FLAGS} \ sys-libs/nss-usrfiles \ "${TOOLCHAIN_PKGS[@]}" +gcc_set_latest_profile "$(portageq envvar CHOST)" + if [[ "${FLAGS_skip_toolchain_update}" -eq "${FLAGS_FALSE}" && \ -n "${FLAGS_toolchain_boards}" ]]; then CROSS_CHOSTS=( $(get_board_chost ${FLAGS_toolchain_boards} | sort -u) )