Skip to content

Commit

Permalink
CHROMEOS build_board: adapt to R120 changes
Browse files Browse the repository at this point in the history
Starting with ChromeOS R120, the output files are no longer stored in
`$SDK/chroot/build/$BOARD` but in `$SDK/out/build/$BOARD`. This change
ensures we use the correct path no matter which is the current version.

Signed-off-by: Arnaud Ferraris <[email protected]>
  • Loading branch information
a-wai committed Jan 15, 2024
1 parent f6695d3 commit 9abf768
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions config/rootfs/chromiumos/scripts/build_board.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ BOARD=$1
BRANCH=$2
SERIAL=$3
DATA_DIR=$(pwd)
OUT_DIR="out"
USERNAME=$(/usr/bin/id -run)
SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

VERSION=$(echo $BRANCH | sed 's/^.*-R\([[:digit:]]*\)-.*$/\1/')
if [ $VERSION -lt 120 ]; then
OUT_DIR="chroot"
fi

function cleanup()
{
rc=$?
Expand Down Expand Up @@ -142,10 +148,10 @@ echo "Compressing image"
gzip -1 "${DATA_DIR}/${BOARD}/chromiumos_test_image.bin"

echo "Extracting additional artifacts"
sudo tar -cJf "${DATA_DIR}/${BOARD}/modules.tar.xz" -C ./chroot/build/${BOARD} lib/modules
sudo cp ./chroot/build/${BOARD}/boot/config* "${DATA_DIR}/${BOARD}/kernel.config"
sudo tar -cJf "${DATA_DIR}/${BOARD}/modules.tar.xz" -C ./${OUT_DIR}/build/${BOARD} lib/modules
sudo cp ./${OUT_DIR}/build/${BOARD}/boot/config* "${DATA_DIR}/${BOARD}/kernel.config"
# Extract CR50/TI50 firmware, but dont crash in case it is missing
sudo mv ./chroot/build/${BOARD}/opt/google/{cr,ti}50/firmware/* "${DATA_DIR}/${BOARD}/" > /dev/null 2>&1 || true
sudo mv ./${OUT_DIR}/build/${BOARD}/opt/google/{cr,ti}50/firmware/* "${DATA_DIR}/${BOARD}/" > /dev/null 2>&1 || true

# Identify baseboard and chipset
BASEBOARD="$(grep baseboard ./src/overlays/overlay-${BOARD}/profiles/base/parent | sed 's/:.*//')"
Expand Down Expand Up @@ -176,14 +182,14 @@ if [ "${CHROMEOS_KERNEL_ARCH}" = "arm64" ]; then

# ARM64 needs dtb to boot
mkdir -p ${DATA_DIR}/${BOARD}/dtbs/${BOARD_VENDOR}
sudo cp ./chroot/build/${BOARD}/var/cache/portage/sys-kernel/*kernel*/arch/arm64/boot/dts/${BOARD_VENDOR}/${CHROMEOS_DTBS} \
sudo cp ./${OUT_DIR}/build/${BOARD}/var/cache/portage/sys-kernel/*kernel*/arch/arm64/boot/dts/${BOARD_VENDOR}/${CHROMEOS_DTBS} \
${DATA_DIR}/${BOARD}/dtbs/${BOARD_VENDOR}

# Copy kernel image for ARM64 board
sudo cp ./chroot/build/${BOARD}/boot/Image* "${DATA_DIR}/${BOARD}/Image"
sudo cp ./${OUT_DIR}/build/${BOARD}/boot/Image* "${DATA_DIR}/${BOARD}/Image"
else
# Copy kernel image for x86-64 board
sudo cp "./chroot/build/${BOARD}/boot/vmlinuz" "${DATA_DIR}/${BOARD}/bzImage"
sudo cp "./${OUT_DIR}/build/${BOARD}/boot/vmlinuz" "${DATA_DIR}/${BOARD}/bzImage"
fi

echo "Creating artifacts manifest file"
Expand Down

0 comments on commit 9abf768

Please sign in to comment.