blob: ee35ac24c5db8aff88415532378326862139a9a0 [file] [log] [blame]
#!/bin/bash -ex
#######################################################
# better to be speified in the build config file
ptable_url="https://android-git.linaro.org/android-build-configs.git/plain/lkft/scripts/hikey/prm_ptable-hikey960.img?h=lkft"
function main(){
echo "TARGET_PRODUCT=${TARGET_PRODUCT}"
local dir_out_target="out/target/product/${TARGET_PRODUCT}"
local f_ptable_vendor=$(ls vendor/linaro/hikey960/*/bootloader/prm_ptable.img|tail -n1)
local f_ptable_device="device/linaro/hikey/installer/hikey960/prm_ptable.img"
if [ -f "${f_ptable_vendor}" ]; then
# for AOSP main build
cp -vf "${f_ptable_vendor}" "${dir_out_target}"
elif [ -f "${f_ptable_device}" ]; then
# for android11, android12 with the super partition support
# android10 would come here as well,
# but this script should not be run for android10
cp -vf "${f_ptable_device}" "${dir_out_target}"
else
echo "Downloading prm_ptable.img from ${ptable_url}!"
wget -c "${ptable_url}" -O "${dir_out_target}/prm_ptable.img"
fi
}
main "$@"