diff --git a/build_library/build_image_util.sh b/build_library/build_image_util.sh index 9992c7d4c20..b7795ade839 100755 --- a/build_library/build_image_util.sh +++ b/build_library/build_image_util.sh @@ -102,11 +102,6 @@ zip_update_tools() { --arch "$(get_sdk_arch)" --output-dir "${BUILD_DIR}" --zip-name "${update_zip}" } -run_ldconfig() { - # This wrapper is created by setup_board. - sudo "ldconfig-${BOARD}" -r "$1" -} - run_localedef() { local root_fs_dir="$1" info "Generating C.UTF-8 locale..." @@ -140,17 +135,6 @@ emerge_to_image() { --jobs="${NUM_JOBS}" \ --verbose \ "$@" - - # Shortcut if this was just baselayout - [[ "$*" == *sys-apps/baselayout ]] && return - - # Make sure profile.env has been generated - sudo -E ROOT="${root_fs_dir}" env-update --no-ldconfig - - # TODO(marineam): just call ${BUILD_LIBRARY_DIR}/check_root directly once - # all tests are fatal, for now let the old function skip soname errors. - ROOT="${root_fs_dir}" PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \ - test_image_content "${root_fs_dir}" } # Switch to the dev or prod sub-profile @@ -497,6 +481,7 @@ start_image() { local disk_layout="$2" local root_fs_dir="$3" local update_group="$4" + local profile="$5" local disk_img="${BUILD_DIR}/${image_name}" @@ -507,6 +492,8 @@ start_image() { "${BOARD_ROOT}"/etc/portage/repos.conf \ "${BUILD_DIR}"/configroot/etc/portage/ + set_image_profile "${profile}" + info "Using image type ${disk_layout}" "${BUILD_LIBRARY_DIR}/disk_util" --disk_layout="${disk_layout}" \ format "${disk_img}" @@ -520,9 +507,9 @@ start_image() { # First thing first, install baselayout to create a working filesystem. emerge_to_image "${root_fs_dir}" --nodeps --oneshot sys-apps/baselayout - # FIXME(marineam): Work around glibc setting EROOT=$ROOT - # https://bugs.gentoo.org/show_bug.cgi?id=473728#c12 - sudo mkdir -p "${root_fs_dir}/etc/ld.so.conf.d" + # We need the libc ASAP to execute binaries from the ROOT at install time, but + # the dependency is implicit, so explicitly install. + emerge_to_image "${root_fs_dir}" --oneshot virtual/libc # Set /etc/lsb-release on the image. "${BUILD_LIBRARY_DIR}/set_lsb_release" \ diff --git a/build_library/dev_container_util.sh b/build_library/dev_container_util.sh index 3724846979d..5bee2889e55 100755 --- a/build_library/dev_container_util.sh +++ b/build_library/dev_container_util.sh @@ -71,12 +71,16 @@ create_dev_container() { local image_packages="${image_name%.bin}_packages.txt" local image_licenses="${image_name%.bin}_licenses.json" - start_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${update_group}" + start_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${update_group}" dev - set_image_profile dev emerge_to_image "${root_fs_dir}" @system ${base_pkg} - run_ldconfig "${root_fs_dir}" run_localedef "${root_fs_dir}" + + # TODO(marineam): just call ${BUILD_LIBRARY_DIR}/check_root directly once + # all tests are fatal, for now let the old function skip soname errors. + ROOT="${root_fs_dir}" PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \ + test_image_content "${root_fs_dir}" + write_packages "${root_fs_dir}" "${BUILD_DIR}/${image_packages}" write_licenses "${root_fs_dir}" "${BUILD_DIR}/${image_licenses}" insert_licenses "${BUILD_DIR}/${image_licenses}" "${root_fs_dir}" diff --git a/build_library/prod_image_util.sh b/build_library/prod_image_util.sh index 955ec5542be..0ea886b9a00 100755 --- a/build_library/prod_image_util.sh +++ b/build_library/prod_image_util.sh @@ -89,15 +89,18 @@ create_prod_image() { local image_realinitrd_contents_wtd="${image_name%.bin}_realinitrd_contents_wtd.txt" local image_sysext_base="${image_name%.bin}_sysext.squashfs" - start_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${update_group}" + start_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${update_group}" prod # Install minimal GCC (libs only) and then everything else - set_image_profile prod extract_prod_gcc "${root_fs_dir}" emerge_to_image "${root_fs_dir}" "${base_pkg}" - run_ldconfig "${root_fs_dir}" run_localedef "${root_fs_dir}" + # TODO(marineam): just call ${BUILD_LIBRARY_DIR}/check_root directly once + # all tests are fatal, for now let the old function skip soname errors. + ROOT="${root_fs_dir}" PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \ + test_image_content "${root_fs_dir}" + local root_with_everything="${root_fs_dir}" # Call helper script for adding sysexts to the base OS. diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-apps/portage/portage-buildpkg-proactive-user-patches.patch b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-apps/portage/portage-buildpkg-proactive-user-patches.patch new file mode 100644 index 00000000000..2505fcdf77f --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-apps/portage/portage-buildpkg-proactive-user-patches.patch @@ -0,0 +1,26 @@ +From b1a85fb629593de585e63271cfd20cc93319dd01 Mon Sep 17 00:00:00 2001 +From: James Le Cuirot +Date: Mon, 9 Nov 2026 15:13:23 +0000 +Subject: [PATCH] depgraph: Make buildpkg-proactive aware of + --binpkg-respect-user-patches + +This now triggers a rebuild when --binpkg-respect-user-patches would +mask a binary package. + +Signed-off-by: James Le Cuirot +--- a/lib/_emerge/depgraph.py ++++ b/lib/_emerge/depgraph.py +@@ -8344,6 +8344,10 @@ class depgraph: + binpkg_changed_deps + and self._changed_deps(binpkg) + ) ++ and not ( ++ binpkg_respect_user_patches ++ and binpkg.user_patches != pkgsettings.userPatchDigest(binpkg) ++ ) + ): + break + else: +-- +2.56.0 + diff --git a/sdk_container/src/third_party/gentoo b/sdk_container/src/third_party/gentoo index 9374e148b92..a1662c61dc9 160000 --- a/sdk_container/src/third_party/gentoo +++ b/sdk_container/src/third_party/gentoo @@ -1 +1 @@ -Subproject commit 9374e148b92394c5c8025d6a51ba2b217c42fd48 +Subproject commit a1662c61dc989f8a1ba90cd8de54b91c3f35a9de diff --git a/setup_board b/setup_board index c7d0c987c7b..561ec016401 100755 --- a/setup_board +++ b/setup_board @@ -134,16 +134,13 @@ EOF # ldconfig cannot generate caches for non-native arches. Use QEMU and the # native ldconfig to work around that. Don't use the bwrap wrapper above # because it's unnecessarily complex for this use case. - wrapper="/usr/local/sbin/ldconfig-${BOARD_VARIANT}" + wrapper="/usr/local/sbin/${BOARD_CHOST}-ldconfig" sudo_clobber "${wrapper}" <