From 057828d34888effe7daac6bccffe8d48bcde63f8 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Fri, 1 Oct 2021 17:51:23 -0700 Subject: [PATCH] Make rbc-run accept a makefile instead of a product Needed for the board configuration. rbc-run will also now pass any extra arguments it receives to rbcrun. (The real program, not the script) Bug: 201700692 Test: rbc_product_config.py aosp_arm64-userdebug Change-Id: Ic9869f693f1d28bafee59050b6ae7b1fba14dbdd --- scripts/rbc-run | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/scripts/rbc-run b/scripts/rbc-run index e2fa6d1be..a0907cfb4 100755 --- a/scripts/rbc-run +++ b/scripts/rbc-run @@ -1,16 +1,15 @@ #! /bin/bash # Convert and run one configuration -# Args: - -[[ $# -eq 1 && "$1" =~ ^(.*)-(.*)$ ]] || { echo Usage: ${0##*/} PRODUCT-VARIANT >&2; exit 1; } -declare -r product="${BASH_REMATCH[1]:-aosp_arm}" -declare -r variant="${BASH_REMATCH[2]:-eng}" +# Args: a product/board makefile optionally followed by additional arguments +# that will be passed to rbcrun. +[[ $# -gt 0 && -f "$1" ]] || { echo "Usage: ${0##*/} product.mk [Additional rbcrun arguments]" >&2; exit 1; } set -eu declare -r output_root=${OUT_DIR:-out} declare -r runner="$output_root/soong/.bootstrap/bin/rbcrun" declare -r converter="$output_root/soong/.bootstrap/bin/mk2rbc" declare -r launcher=$output_root/launchers/run.rbc -$converter -mode=write -r --outdir $output_root --launcher=$launcher $product -printf "#TARGET_PRODUCT=$product TARGET_BUILD_VARIANT=$variant\n" -env TARGET_PRODUCT=$product TARGET_BUILD_VARIANT=$variant \ - $runner RBC_OUT="make,global" RBC_DEBUG="${RBC_DEBUG:-}" $launcher +declare -r makefile=$1 +shift +$converter -mode=write -r --outdir $output_root --launcher=$launcher $makefile +$runner RBC_OUT="make,global" RBC_DEBUG="${RBC_DEBUG:-}" $@ $launcher