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

Custom packages, keys and environment setup

This commit is contained in:
Pete Fotheringham 2024-09-02 14:09:51 +01:00
parent 571d8d4567
commit f5df79adc2

@ -31,13 +31,17 @@
# - main sync and build loop
# For each device in `$DEVICE_LIST`
# - setup subdirectories
# - setup build overlay
# - setup our overlays
# - Add custom packages to be installed
# - Handle keys
# - Prepare the environment
# - `repo init`
# - `repo sync`
# - Call `before.sh`
# - `breakfast` - in case of failure, call
# - `post-build.sh`
# - `do_cleanup`
# - Call `pre-build.sh`
# - `mka`
# - move artefacts to `ZIPDIR`
# - ROM zip file
@ -263,6 +267,38 @@ for codename in ${devices//,/ }; do
los_ver_minor=$(sed -n -e 's/^\s*PRODUCT_VERSION_MINOR = //p' "$makefile_containing_version")
los_ver="$los_ver_major.$los_ver_minor"
# Add custom packages to be installed
if [ -n "$CUSTOM_PACKAGES" ]; then
echo ">> [$(date)] Adding custom packages ($CUSTOM_PACKAGES)"
sed -i "1s;^;PRODUCT_PACKAGES += $CUSTOM_PACKAGES\n\n;" "vendor/$vendor/config/common.mk"
fi
# Handle keys
if [ "$SIGN_BUILDS" = true ]; then
echo ">> [$(date)] Adding keys path ($KEYS_DIR)"
# Soong (Android 9+) complains if the signing keys are outside the build path
ln -sf "$KEYS_DIR" user-keys
if [ "$android_version_major" -lt "10" ]; then
sed -i "1s;^;PRODUCT_DEFAULT_DEV_CERTIFICATE := user-keys/releasekey\nPRODUCT_OTA_PUBLIC_KEYS := user-keys/releasekey\nPRODUCT_EXTRA_RECOVERY_KEYS := user-keys/releasekey\n\n;" "vendor/$vendor/config/common.mk"
fi
if [ "$android_version_major" -ge "10" ]; then
sed -i "1s;^;PRODUCT_DEFAULT_DEV_CERTIFICATE := user-keys/releasekey\nPRODUCT_OTA_PUBLIC_KEYS := user-keys/releasekey\n\n;" "vendor/$vendor/config/common.mk"
fi
fi
# Prepare the environment
if [ "$PREPARE_BUILD_ENVIRONMENT" = true ]; then
echo ">> [$(date)] Preparing build environment"
set +eu
# shellcheck source=/dev/null
source build/envsetup.sh > /dev/null
set -eu
else
echo ">> [$(date)] Preparing build environment disabled"
fi
fi
# More stuff to do