build_library: install libc from sysroot toolchain cache first

When building images with Bazel, cross-${abi}/glibc (and any secondary
ABIs) are built and staged into the board sysroot under
${BOARD_ROOT}/var/cache/toolchain-pkgs/cross-${abi}/ by sysroot_create.
Previously, install_libc_for_abi hardcoded PKGDIR=/var/lib/portage/pkgs,
which caused image assembly to install the host SDK's glibc binpkg
rather than the version built for the board by Bazel.

Check the sysroot toolchain package cache first, using the staged
manifest.json, before falling back to PKGDIR.

BUG=b:491765858
TEST=Tested install_libc_for_abi extracted glibc-2.43 into rootfs
TAG=agy
CONV=ab6295d5-8c73-4497-92dd-9198e2c89a8d

Change-Id: I224c3d319dc613ce40a4fb41f6412c9a55f326ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/8355714
Reviewed-by: George Burgess <gbiv@chromium.org>
Auto-Submit: Raul Rangel <rrangel@chromium.org>
Tested-by: Raul Rangel <rrangel@chromium.org>
Commit-Queue: Raul Rangel <rrangel@chromium.org>
2 files changed
tree: 1e34fa3915851a6471c0f66860203fbea01db011
  1. bin/
  2. build_library/
  3. hooks/
  4. lib/
  5. mod_for_test_scripts/
  6. .gitignore
  7. build_kernel_image.sh
  8. common.sh
  9. cros_show_stacks
  10. DIR_METADATA
  11. image_to_vm.sh
  12. make_netboot.sh
  13. mod_image_for_recovery.sh
  14. mount_gpt_image.sh
  15. OWNERS
  16. PRESUBMIT.cfg
  17. README.md
  18. update_bootloaders.sh
  19. update_kernel.sh
README.md

src/scripts directory

This repository contains build tools and scripts written in shell (e.g., Bash). Historically, much of our build process was written in shell in this directory, however, we're currently in the process of migrating many scripts to Python in Chromite.

In general, we're not currently accepting new scripts in this directory.

If you want to host a script for yourself/local team, feel free to use the src/platform/dev/contrib/ directory instead.