Use PRODUCT_COPY_FILES to install uwb country files
Previously, these files were installed with a custom $(shell) command in an Android.mk file. This doesn't let the build system know that these files exist, and breaks hermetic partition builds. Instead, install them with PRODUCT_COPY_FILES, and add a check that the list is up-to-date. Bug: 205632228 Test: Presubmits Change-Id: I29bf9d51e7341643e441fa7e1f43a6b4f9af84f0
This commit is contained in:
parent
3ebad0b33f
commit
e4dd513cc5
4 changed files with 89 additions and 32 deletions
|
@ -1,13 +1,38 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script is used to generate uwb conuntry configuration file,
|
||||
# and the PRODUCT_COPY_FILES list in uwb.mk based on uwb_country.conf
|
||||
# and the PRODUCT_COPY_FILES list in uwb_calibration_country.mk based on uwb_country.conf
|
||||
# Bug: 196073172, 233619860
|
||||
|
||||
count=1
|
||||
|
||||
mkdir -p $2
|
||||
LOCAL_PATH=device/google/tangorpro/uwb
|
||||
|
||||
echo "# Copyright (C) 2023 The Android Open-Source Project"
|
||||
echo "#"
|
||||
echo "# Licensed under the Apache License, Version 2.0 (the \"License\");"
|
||||
echo "# you may not use this file except in compliance with the License."
|
||||
echo "# You may obtain a copy of the License at"
|
||||
echo "#"
|
||||
echo "# http://www.apache.org/licenses/LICENSE-2.0"
|
||||
echo "#"
|
||||
echo "# Unless required by applicable law or agreed to in writing, software"
|
||||
echo "# distributed under the License is distributed on an \"AS IS\" BASIS,"
|
||||
echo "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied."
|
||||
echo "# See the License for the specific language governing permissions and"
|
||||
echo "# limitations under the License."
|
||||
echo ""
|
||||
echo "# This file was autogenerated by country_conf_gen.sh"
|
||||
echo ""
|
||||
echo "ifneq (\$(LOCAL_PATH),$LOCAL_PATH)"
|
||||
echo " \$(error LOCAL_PATH in country_conf_gen.sh needs to be updated, and uwb_calibration_country.mk regenerated)"
|
||||
echo "endif"
|
||||
echo "diffs := \$(shell diff \$(LOCAL_PATH)/uwb_calibration_country.mk <($LOCAL_PATH/country_conf_gen.sh))"
|
||||
echo "ifneq (\$(diffs),)"
|
||||
echo " \$(error $LOCAL_PATH/uwb_calibration_country.mk is not up to date, please run $LOCAL_PATH/country_conf_gen.sh > $LOCAL_PATH/uwb_calibration_country.mk)"
|
||||
echo "endif"
|
||||
echo ""
|
||||
echo "PRODUCT_COPY_FILES += \\"
|
||||
while read line ; do
|
||||
if [[ "$line" =~ ^"*" ]]; then
|
||||
header=${line:1}
|
||||
|
@ -16,16 +41,16 @@ while read line ; do
|
|||
country[count]=$(echo $line | cut -d ':' -f1 | tr -d "\"")
|
||||
code[count]=$(echo $line | cut -d ':' -f2 | tr -d "\"" | tr -d " ")
|
||||
if [ "$header" = "FCC" ]; then
|
||||
cp $1/UWB-calibration-fcc.conf $2/UWB-calibration-${code[$count]}.conf
|
||||
echo " \$(LOCAL_PATH)/UWB-calibration-fcc.conf:\$(TARGET_COPY_OUT_VENDOR)/etc/uwb/UWB-calibration-${code[$count]}.conf \\"
|
||||
elif [ "$header" = "CE" ]; then
|
||||
cp $1/UWB-calibration-ce.conf $2/UWB-calibration-${code[$count]}.conf
|
||||
echo " \$(LOCAL_PATH)/UWB-calibration-ce.conf:\$(TARGET_COPY_OUT_VENDOR)/etc/uwb/UWB-calibration-${code[$count]}.conf \\"
|
||||
elif [ "$header" = "JP" ]; then
|
||||
cp $1/UWB-calibration-jp.conf $2/UWB-calibration-${code[$count]}.conf
|
||||
echo " \$(LOCAL_PATH)/UWB-calibration-jp.conf:\$(TARGET_COPY_OUT_VENDOR)/etc/uwb/UWB-calibration-${code[$count]}.conf \\"
|
||||
elif [ "$header" = "TW" ]; then
|
||||
cp $1/UWB-calibration-tw.conf $2/UWB-calibration-${code[$count]}.conf
|
||||
echo " \$(LOCAL_PATH)/UWB-calibration-tw.conf:\$(TARGET_COPY_OUT_VENDOR)/etc/uwb/UWB-calibration-${code[$count]}.conf \\"
|
||||
elif [ "$header" = "Restricted" ]; then
|
||||
cp $1/UWB-calibration-restricted.conf $2/UWB-calibration-${code[$count]}.conf
|
||||
echo " \$(LOCAL_PATH)/UWB-calibration-restricted.conf:\$(TARGET_COPY_OUT_VENDOR)/etc/uwb/UWB-calibration-${code[$count]}.conf \\"
|
||||
fi
|
||||
fi
|
||||
((count++))
|
||||
done < $1/uwb_country.conf
|
||||
done < $LOCAL_PATH/uwb_country.conf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue