1
0
mirror of https://github.com/lineageos4microg/docker-lineage-cicd synced 2024-11-09 10:09:56 +01:00

Automatically select the correct OTA_PROP

This commit is contained in:
Nicola Corna 2018-02-28 07:45:17 +01:00
parent a6d122f30b
commit 876c28dc8f
2 changed files with 11 additions and 9 deletions

@ -41,11 +41,6 @@ ENV DEVICE_LIST ''
# Release type string
ENV RELEASE_TYPE 'UNOFFICIAL'
# OTA build.prop key that will be used inside Updater/CMUpdater
# This should be set to 'cm.updater.uri. for LineageOS/Cyanogenmod <= 14.1 and
# to 'lineage.updater.uri' for LineageOS >= 15.0
ENV OTA_PROP 'cm.updater.uri'
# OTA URL that will be used inside CMUpdater
# Use this in combination with LineageOTA to make sure your device can auto-update itself from this buildbot
ENV OTA_URL ''

@ -138,6 +138,10 @@ for branch in $BRANCH_NAME; do
exit 1
fi
los_ver_major=$(sed -n -e 's/^\s*PRODUCT_VERSION_MAJOR = //p' "vendor/$vendor/config/common.mk")
los_ver_minor=$(sed -n -e 's/^\s*PRODUCT_VERSION_MINOR = //p' "vendor/$vendor/config/common.mk")
los_ver="$los_ver_major.$los_ver_minor"
# If needed, apply the microG's signature spoofing patch
if [ "$SIGNATURE_SPOOFING" = "yes" ] || [ "$SIGNATURE_SPOOFING" = "restricted" ]; then
# Determine which patch should be applied to the current Android source tree
@ -173,8 +177,14 @@ for branch in $BRANCH_NAME; do
# Set a custom updater URI if a OTA URL is provided
if ! [ -z "$OTA_URL" ]; then
if [ "$los_ver_major" -ge "15" ]; then
ota_prop="lineage.updater.uri"
else
ota_prop="cm.updater.uri"
fi
echo ">> [$(date)] Adding OTA URL '$OTA_URL' to build.prop"
sed -i "1s;^;PRODUCT_PROPERTY_OVERRIDES += $OTA_PROP=$OTA_URL\n\n;" "vendor/$vendor/config/common.mk"
sed -i "1s;^;PRODUCT_PROPERTY_OVERRIDES += $ota_prop=$OTA_URL\n\n;" "vendor/$vendor/config/common.mk"
fi
# Add custom packages to be installed
@ -240,9 +250,6 @@ for branch in $BRANCH_NAME; do
logsubdir=
fi
los_ver_major=$(sed -n -e 's/^\s*PRODUCT_VERSION_MAJOR = //p' "vendor/$vendor/config/common.mk")
los_ver_minor=$(sed -n -e 's/^\s*PRODUCT_VERSION_MINOR = //p' "vendor/$vendor/config/common.mk")
los_ver="$los_ver_major.$los_ver_minor"
DEBUG_LOG="$LOGS_DIR/$logsubdir/lineage-$los_ver-$builddate-$RELEASE_TYPE-$codename.log"
if [ -f /root/userscripts/pre-build.sh ]; then