From cea18c41c3556356ea2a2bc91b9a44c8d7eb2a41 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Thu, 19 Aug 2021 12:58:40 +0200 Subject: [PATCH] *: Use the internal copy of cros_workon The scripts that invoked `cros_workon` without specifying a path to the script were not calling the internal `cros_workon` directly, but rather a copy installed in `/usr/bin/cros_workon`. `/usr/bin/cros_workon` comes from the `coreos-base/cros-devutil` and is a wrapper script that sources `common.sh` file to figure the location of the `scripts` and finally invokes the internal `cros_workon`. Curious thing is that the sourced `common.sh` comes from the `/usr/lib/crosutils` directory and contents of the directory come from the `dev-util/crosutils` package. And that `common.sh` is different from the one in the scripts directory, but fortunately the part that detects the path to the `scripts` directory is the same. I'm not sure where where exactly the copy of `common.sh` in `/usr/lib/crosutils` comes from - likely from somewhere in `https://chromium.googlesource.com/chromiumos/platform/crosutils`. Just cut the middle layers and call the internal copy of `cros_workon` directly. --- build_packages | 2 +- setup_board | 4 ++-- update_chroot | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build_packages b/build_packages index 154d322d46..a07462db8e 100755 --- a/build_packages +++ b/build_packages @@ -166,7 +166,7 @@ fi # Build cros_workon packages when they are changed. CROS_WORKON_PKGS=() if [ "${FLAGS_workon}" -eq "${FLAGS_TRUE}" ]; then - CROS_WORKON_PKGS+=( $(cros_workon list --board=${FLAGS_board}) ) + CROS_WORKON_PKGS+=( $("${SRC_ROOT}/scripts/cros_workon" list --board=${FLAGS_board}) ) fi if [[ ${#CROS_WORKON_PKGS[@]} -gt 0 ]]; then diff --git a/setup_board b/setup_board index 1b0bf8808b..678ee3ddd0 100755 --- a/setup_board +++ b/setup_board @@ -98,7 +98,7 @@ generate_all_wrappers() { wrapper="/usr/local/bin/cros_workon-${BOARD_VARIANT}" sudo_clobber "${wrapper}" <