From 37ff9a333a0922984f8a07e845c75f8682b98844 Mon Sep 17 00:00:00 2001 From: althafvly Date: Mon, 15 Sep 2025 19:19:18 +0530 Subject: [PATCH 01/10] Update key gen script --- src/common.list | 10 ++++++++++ src/init.sh | 4 ++-- src/make_key | 5 +++-- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 src/common.list diff --git a/src/common.list b/src/common.list new file mode 100644 index 0000000..f73e05b --- /dev/null +++ b/src/common.list @@ -0,0 +1,10 @@ +releasekey +platform +shared +media +networkstack +nfc +verity +bluetooth +sdk_sandbox + diff --git a/src/init.sh b/src/init.sh index 63f5495..d16c0c8 100755 --- a/src/init.sh +++ b/src/init.sh @@ -35,12 +35,12 @@ git config --global user.email "$USER_MAIL" if [ "$SIGN_BUILDS" = true ]; then if [ -z "$(ls -A "$KEYS_DIR")" ]; then echo ">> [$(date)] SIGN_BUILDS = true but empty \$KEYS_DIR, generating new keys" - for c in releasekey platform shared media networkstack; do + for c in $(cat "/root/common.list"); do echo ">> [$(date)] Generating $c..." /root/make_key "$KEYS_DIR/$c" "$KEYS_SUBJECT" <<<'' &>/dev/null done else - for c in releasekey platform shared media networkstack; do + for c in $(cat "/root/common.list"); do for e in pk8 x509.pem; do if [ ! -f "$KEYS_DIR/$c.$e" ]; then echo ">> [$(date)] SIGN_BUILDS = true and not empty \$KEYS_DIR, but \"\$KEYS_DIR/$c.$e\" is missing" diff --git a/src/make_key b/src/make_key index a6cf49c..d266cc5 100755 --- a/src/make_key +++ b/src/make_key @@ -50,7 +50,7 @@ read -p "Enter password for '$1' (blank for none; password will be visible): " \ password if [ "${3}" = "rsa" -o "$#" -eq 2 ]; then - ( openssl genrsa -f4 2048 | tee ${one} > ${two} ) & + ( openssl genrsa -f4 4096 | tee ${one} > ${two} ) & hash="-sha256" elif [ "${3}" = "ec" ]; then ( openssl ecparam -name prime256v1 -genkey -noout | tee ${one} > ${two} ) & @@ -69,10 +69,11 @@ if [ "${password}" == "" ]; then else echo "creating ${1}.pk8 with password [${password}]" export password - openssl pkcs8 -in ${one} -topk8 -outform DER -out $1.pk8 \ + openssl pkcs8 -in ${one} -topk8 -v1 PBE-SHA1-3DES -outform DER -out $1.pk8 \ -passout env:password unset password fi wait wait + -- GitLab From 0fe2921d32db029a5ed83336a5fb723a622147b4 Mon Sep 17 00:00:00 2001 From: althafvly Date: Mon, 15 Sep 2025 19:40:00 +0530 Subject: [PATCH 02/10] Skip signing target for test build --- src/build.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/build.sh b/src/build.sh index 301d3f6..f2dee7d 100755 --- a/src/build.sh +++ b/src/build.sh @@ -412,11 +412,9 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then fi E_VERSION=e-$E_BRANCH_NAME-$BUILD_NUMBER-$RELEASE_TYPE-${DEVICE}.zip - # Remove release-keys from build as its still using test-keys. - if [ "$SIGN_BUILDS" != true ]; then - SIGN_TARGETS=(-t "+test-keys,-release-keys") - else + if [ "$SIGN_BUILDS" = true ]; then SIGN_TARGETS=(-o -d "user-keys") + SIGN_KEY=(-k "user-keys/releasekey") fi if [ "$android_version_major" -ge 12 ] && [ "$SIGN_BUILDS" = true ]; then @@ -437,14 +435,15 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then fi if [ "$(find $OUT/obj/PACKAGING/target_files_intermediates/ -name *-target_files*.zip -print -quit)" ]; then - sign_target_files_apks "${SIGN_TARGETS[@]}" \ - $OUT/obj/PACKAGING/target_files_intermediates/*-target_files*.zip "$OUT/$TARGET_FILES" + if [ "$SIGN_BUILDS" = true ]; then + sign_target_files_apks "${SIGN_TARGETS[@]}" \ + $OUT/obj/PACKAGING/target_files_intermediates/*-target_files*.zip "$OUT/$TARGET_FILES" + else + mv $OUT/obj/PACKAGING/target_files_intermediates/*-target_files*.zip "$OUT/$TARGET_FILES" + fi # Generate OTA zip echo ">> [$(date)] Generating OTA zip from target-files-package" - if [ "$SIGN_BUILDS" = true ]; then - SIGN_KEY=(-k "user-keys/releasekey") - fi ota_from_target_files --backup=true "${SIGN_KEY[@]}" "$OUT/$TARGET_FILES" \ "$OUT/$E_VERSION" -- GitLab From 5ec12af405e81e002916b8aa4db7cbb5e1f7b52d Mon Sep 17 00:00:00 2001 From: althafvly Date: Mon, 15 Sep 2025 19:42:27 +0530 Subject: [PATCH 03/10] Move key dir to a var --- src/build.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/build.sh b/src/build.sh index f2dee7d..139eedc 100755 --- a/src/build.sh +++ b/src/build.sh @@ -93,6 +93,7 @@ sync_successful=true use_openjdk_from_ubuntu=false branch_dir=$(sed -E 's/^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(nougat|oreo|pie|q|r|s|t|u|a14|a15)(-[a-zA-Z0-9_]*)*$/\5/' <<<"${BRANCH_NAME}") branch_dir=${branch_dir^^} +default_key_dir="user-keys" if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then vendor=lineage @@ -269,11 +270,11 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then 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 + ln -sf "$KEYS_DIR" $default_key_dir 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" + sed -i "1s;^;PRODUCT_DEFAULT_DEV_CERTIFICATE := $default_key_dir/releasekey\nPRODUCT_OTA_PUBLIC_KEYS := $default_key_dir/releasekey\nPRODUCT_EXTRA_RECOVERY_KEYS := $default_key_dir/releasekey\n\n;" "vendor/$vendor/config/common.mk" elif [ "$android_version_major" -lt "12" ]; 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" + sed -i "1s;^;PRODUCT_DEFAULT_DEV_CERTIFICATE := $default_key_dir/releasekey\nPRODUCT_OTA_PUBLIC_KEYS := $default_key_dir/releasekey\n\n;" "vendor/$vendor/config/common.mk" fi fi @@ -413,24 +414,24 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then E_VERSION=e-$E_BRANCH_NAME-$BUILD_NUMBER-$RELEASE_TYPE-${DEVICE}.zip if [ "$SIGN_BUILDS" = true ]; then - SIGN_TARGETS=(-o -d "user-keys") - SIGN_KEY=(-k "user-keys/releasekey") + SIGN_TARGETS=(-o -d "$default_key_dir") + SIGN_KEY=(-k "$default_key_dir/releasekey") fi if [ "$android_version_major" -ge 12 ] && [ "$SIGN_BUILDS" = true ]; then APEX_PACKAGE_LIST=$(cat "/root/apex.list") for PACKAGE in $APEX_PACKAGE_LIST; do - if [ -f "user-keys/$PACKAGE.pem" ] && - [ -f "user-keys/$PACKAGE.x509.pem" ] && - [ -f "user-keys/$PACKAGE.pk8" ]; then - SIGN_TARGETS+=(--extra_apks "$PACKAGE.apex=user-keys/$PACKAGE" - --extra_apex_payload_key "$PACKAGE.apex=user-keys/$PACKAGE.pem") + if [ -f "$default_key_dir/$PACKAGE.pem" ] && + [ -f "$default_key_dir/$PACKAGE.x509.pem" ] && + [ -f "$default_key_dir/$PACKAGE.pk8" ]; then + SIGN_TARGETS+=(--extra_apks "$PACKAGE.apex=$default_key_dir/$PACKAGE" + --extra_apex_payload_key "$PACKAGE.apex=$default_key_dir/$PACKAGE.pem") fi done APEXAPK_PACKAGE_LIST=$(cat "/root/apex_apk.list") for PACKAGE in $APEXAPK_PACKAGE_LIST; do - SIGN_TARGETS+=(--extra_apks "$PACKAGE.apk=user-keys/releasekey") + SIGN_TARGETS+=(--extra_apks "$PACKAGE.apk=$default_key_dir/releasekey") done fi -- GitLab From dd2f9076988c27cb2baa91746f8f6acd33a42c86 Mon Sep 17 00:00:00 2001 From: althafvly Date: Mon, 15 Sep 2025 19:47:17 +0530 Subject: [PATCH 04/10] Drop legacy android support (below a12) --- src/build.sh | 47 +++-------------------------------------------- 1 file changed, 3 insertions(+), 44 deletions(-) diff --git a/src/build.sh b/src/build.sh index 139eedc..45618a2 100755 --- a/src/build.sh +++ b/src/build.sh @@ -91,7 +91,7 @@ exit_script() { sync_successful=true use_openjdk_from_ubuntu=false -branch_dir=$(sed -E 's/^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(nougat|oreo|pie|q|r|s|t|u|a14|a15)(-[a-zA-Z0-9_]*)*$/\5/' <<<"${BRANCH_NAME}") +branch_dir=$(sed -E 's/^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(s|t|u|a14|a15)(-[a-zA-Z0-9_]*)*$/\5/' <<<"${BRANCH_NAME}") branch_dir=${branch_dir^^} default_key_dir="user-keys" @@ -99,25 +99,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then vendor=lineage regex_part1="^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(" regex_part2=")(-[a-zA-Z0-9_]*)*$" - if [[ "${BRANCH_NAME}" =~ $regex_part1"nougat"$regex_part2 ]]; then - vendor="cm" - themuppets_branch="cm-14.1" - android_version="7.1.2" - use_openjdk_from_ubuntu=true - elif [[ "${BRANCH_NAME}" =~ $regex_part1"oreo"$regex_part2 ]]; then - themuppets_branch="lineage-15.1" - android_version="8.1" - use_openjdk_from_ubuntu=true - elif [[ "${BRANCH_NAME}" =~ $regex_part1"pie"$regex_part2 ]]; then - themuppets_branch="lineage-16.0" - android_version="9" - elif [[ "${BRANCH_NAME}" =~ $regex_part1"q"$regex_part2 ]]; then - themuppets_branch="lineage-17.1" - android_version="10" - elif [[ "${BRANCH_NAME}" =~ $regex_part1"r"$regex_part2 ]]; then - themuppets_branch="lineage-18.1" - android_version="11" - elif [[ "${BRANCH_NAME}" =~ $regex_part1"s"$regex_part2 ]]; then + if [[ "${BRANCH_NAME}" =~ $regex_part1"s"$regex_part2 ]]; then themuppets_branch="lineage-19.1" android_version="12" elif [[ "${BRANCH_NAME}" =~ $regex_part1"t"$regex_part2 ]]; then @@ -250,10 +232,6 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then fi config_file="vendor/lineage/config/version.mk" - if [ ! -f "$config_file" ]; then - # If version.mk doesn't exist, use common.mk - config_file="vendor/lineage/config/common.mk" - fi # Extract version information PRODUCT_VERSION_MAJOR=$(grep -oP 'PRODUCT_VERSION_MAJOR = \K.*' "$config_file") @@ -271,11 +249,6 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; 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" $default_key_dir - if [ "$android_version_major" -lt "10" ]; then - sed -i "1s;^;PRODUCT_DEFAULT_DEV_CERTIFICATE := $default_key_dir/releasekey\nPRODUCT_OTA_PUBLIC_KEYS := $default_key_dir/releasekey\nPRODUCT_EXTRA_RECOVERY_KEYS := $default_key_dir/releasekey\n\n;" "vendor/$vendor/config/common.mk" - elif [ "$android_version_major" -lt "12" ]; then - sed -i "1s;^;PRODUCT_DEFAULT_DEV_CERTIFICATE := $default_key_dir/releasekey\nPRODUCT_OTA_PUBLIC_KEYS := $default_key_dir/releasekey\n\n;" "vendor/$vendor/config/common.mk" - fi fi # Prepare the environment @@ -384,14 +357,6 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then build_success=true fi fi - elif [ "$android_version_major" -lt "12" ]; then - if [ "${BUILD_SUPER_IMAGE}" = true ]; then - if breakfast_device && mka bacon superimage; then - build_success=true - fi - elif brunch "${DEVICE}" "${BUILD_TYPE}"; then - build_success=true - fi elif breakfast_device; then # Apply patch for vendor prebuilt devices. if [ "${DEVICE}" = "one" ] || [ "${DEVICE}" = "two" ]; then @@ -418,7 +383,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then SIGN_KEY=(-k "$default_key_dir/releasekey") fi - if [ "$android_version_major" -ge 12 ] && [ "$SIGN_BUILDS" = true ]; then + if [ "$SIGN_BUILDS" = true ]; then APEX_PACKAGE_LIST=$(cat "/root/apex.list") for PACKAGE in $APEX_PACKAGE_LIST; do if [ -f "$default_key_dir/$PACKAGE.pem" ] && @@ -602,17 +567,11 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then fi IMG_OUT=$OUT - if [ "$android_version_major" -lt "12" ]; then - IMG_OUT=obj/PACKAGING/target_files_intermediates/lineage_*/IMAGES - fi # Move produced ZIP files to the main OUT directory echo ">> [$(date)] Moving build artifacts for ${DEVICE} to '$ZIP_DIR/$zipsubdir'" cd "${OUT}" || return 1 for build in $(ls e-*.zip); do - if [ "$android_version_major" -lt "12" ]; then - sha256sum "$build" >"$ZIP_DIR/$zipsubdir/$build.sha256sum" - fi find . -maxdepth 1 \( -name 'e-*.zip*' -o -name 'IMG-e*.zip*' -o -name 'QFIL-e*.zip*' \) -type f -exec mv {} "$ZIP_DIR/$zipsubdir/" \; SKIP_DYNAMIC_IMAGES="odm.img product.img system.img system_ext.img vendor.img" -- GitLab From f37331de6d53822f82d5198dd821ce01dc92c208 Mon Sep 17 00:00:00 2001 From: althafvly Date: Tue, 16 Sep 2025 12:06:09 +0530 Subject: [PATCH 05/10] add initial a16 support --- build-community.sh | 3 +++ src/build.sh | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build-community.sh b/build-community.sh index 5d3c5e6..7bea9c5 100755 --- a/build-community.sh +++ b/build-community.sh @@ -123,6 +123,9 @@ for branch in ${BRANCH_NAME//,/ }; do elif [[ "${BRANCH_NAME}" =~ $regex_part1"a15"$regex_part2 || "${BRANCH_NAME}" =~ "a15" ]]; then themuppets_branch="lineage-22.2" android_version="15" + elif [[ "${BRANCH_NAME}" =~ $regex_part1"a16"$regex_part2 || "${BRANCH_NAME}" =~ "a16" ]]; then + themuppets_branch="lineage-23.0" + android_version="16" else echo ">> [$(date)] Building branch $branch is not (yet) suppported" exit 1 diff --git a/src/build.sh b/src/build.sh index 45618a2..31cde90 100755 --- a/src/build.sh +++ b/src/build.sh @@ -91,7 +91,7 @@ exit_script() { sync_successful=true use_openjdk_from_ubuntu=false -branch_dir=$(sed -E 's/^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(s|t|u|a14|a15)(-[a-zA-Z0-9_]*)*$/\5/' <<<"${BRANCH_NAME}") +branch_dir=$(sed -E 's/^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(s|t|u|a14|a15|a16)(-[a-zA-Z0-9_]*)*$/\5/' <<<"${BRANCH_NAME}") branch_dir=${branch_dir^^} default_key_dir="user-keys" @@ -114,6 +114,9 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then elif [[ "${BRANCH_NAME}" =~ $regex_part1"a15"$regex_part2 || "${BRANCH_NAME}" =~ "a15" ]]; then themuppets_branch="lineage-22.2" android_version="15" + elif [[ "${BRANCH_NAME}" =~ $regex_part1"a16"$regex_part2 || "${BRANCH_NAME}" =~ "a16" ]]; then + themuppets_branch="lineage-23.0" + android_version="16" else echo ">> [$(date)] Building branch $BRANCH_NAME is not (yet) supported" exit 1 -- GitLab From f912dd2aa7b1d20f9a38d3fd6c4ddb5081e87f99 Mon Sep 17 00:00:00 2001 From: althafvly Date: Tue, 16 Sep 2025 12:06:54 +0530 Subject: [PATCH 06/10] Update apex list for a16 --- src/apex.list | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/apex.list b/src/apex.list index bf13f93..80d46d4 100644 --- a/src/apex.list +++ b/src/apex.list @@ -5,8 +5,10 @@ com.android.appsearch com.android.appsearch.apk com.android.art com.android.bluetooth +com.android.bt com.android.btservices com.android.cellbroadcast +com.android.crashrecovery com.android.compos com.android.configinfrastructure com.android.connectivity.resources @@ -48,6 +50,7 @@ com.android.telephony com.android.telephonymodules com.android.tethering com.android.tzdata +com.android.uprobestats com.android.uwb com.android.uwb.resources com.android.virt -- GitLab From 7b931a49aea0d8edf78c8e77139e63d9d84eaaa8 Mon Sep 17 00:00:00 2001 From: althafvly Date: Tue, 16 Sep 2025 12:19:10 +0530 Subject: [PATCH 07/10] Allow to build vanilla lineage --- Dockerfile | 6 ++++++ src/build.sh | 19 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0676d4e..8ff175c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,6 +46,10 @@ ENV RELEASE_TYPE 'UNOFFICIAL' # Repo use for build ENV REPO 'https://gitlab.e.foundation/e/os/android.git' +ENV LINEAGE_REPO 'https://github.com/LineageOS/android.git' + +# If we have a change ref for lineage like refs/changes/42/436442/31 +ENV CHANGE_REF='' # Optional parameter to repo init --depth N # A size of 0 deactivates --depth N @@ -145,6 +149,8 @@ ENV BUILD_FLASH_PACKAGE false # specify a custom manifest URL ENV REPO_CUSTOM_MANIFEST false +# Build lineage from source +ENV IS_LINEAGE_BUILD false # You can optionally specify a USERSCRIPTS_DIR volume containing these scripts: # * begin.sh, run at the very beginning diff --git a/src/build.sh b/src/build.sh index 31cde90..c96fac8 100755 --- a/src/build.sh +++ b/src/build.sh @@ -136,7 +136,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then echo ">> [$(date)] Setting up CCache, CCACHE_DIR=${CCACHE_DIR} CCACHE_SIZE=${CCACHE_SIZE}" - echo ">> [$(date)] Branch: ${BRANCH_NAME}" + echo ">> [$(date)] Branch: ${BRANCH_NAME}" echo ">> [$(date)] Device: ${DEVICE}" # Remove previous changes of vendor/cm, vendor/lineage and frameworks/base (if they exist) @@ -180,9 +180,22 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then REPO_GROUPS="" fi + # Repo init branch + INIT_REPO=$REPO + INIT_BRANCH=${TAG_PREFIX}${BRANCH_NAME} + + if [ "$IS_LINEAGE_BUILD" = true ]; then + INIT_REPO=$LINEAGE_REPO + fi + + # If you have a change ref, override INIT_BRANCH + if [ -n "$CHANGE_REF" ]; then + INIT_BRANCH=$CHANGE_REF + fi + # Repo init source - echo ">> [$(date)] Running: repo init $REPO_INIT_PARAM -u \"$REPO\" -b \"${TAG_PREFIX}${BRANCH_NAME}\" $REPO_GROUPS" - yes | repo init $REPO_INIT_PARAM -u "$REPO" -b "${TAG_PREFIX}${BRANCH_NAME}" $REPO_GROUPS + echo ">> [$(date)] Running: repo init $REPO_INIT_PARAM -u \"$INIT_REPO\" -b \"${INIT_BRANCH}\" $REPO_GROUPS" + yes | repo init $REPO_INIT_PARAM -u "$INIT_REPO" -b "${INIT_BRANCH}" $REPO_GROUPS if [ "$REPO_CUSTOM_MANIFEST" != false ]; then wget -O .repo/manifests/default.xml $REPO_CUSTOM_MANIFEST -- GitLab From 4190f81d2692bb2d79dd5c3c83b007546cbf3677 Mon Sep 17 00:00:00 2001 From: althafvly Date: Mon, 22 Sep 2025 10:13:23 +0530 Subject: [PATCH 08/10] Update docker dind tag --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ef10b1..d163042 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ variables: stage: build image: docker:git services: - - docker:20.10.16-dind + - docker:28.4.0-dind script: - "docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY" - "docker pull $CI_REGISTRY_IMAGE:$IMAGE_TAG || true" -- GitLab From a2132740e36a0c16c1bc5a49b5c09eb496be423b Mon Sep 17 00:00:00 2001 From: althafvly Date: Mon, 22 Sep 2025 14:39:58 +0530 Subject: [PATCH 09/10] Allow removing source code before build --- Dockerfile | 3 +++ src/build.sh | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/Dockerfile b/Dockerfile index 8ff175c..41a49a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,6 +71,9 @@ ENV CLEAN_OUTDIR false # For example, '0 10 * * *' means 'Every day at 10:00 UTC' ENV CRONTAB_TIME 'now' +# Clean source code before build +ENV CLEAN_SRC_BUILD false + # Clean artifacts output after each build ENV CLEAN_AFTER_BUILD true diff --git a/src/build.sh b/src/build.sh index c96fac8..ba10b9a 100755 --- a/src/build.sh +++ b/src/build.sh @@ -128,6 +128,12 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then android_version_major=$(cut -d '.' -f 1 <<<$android_version) + if [ "$CLEAN_SRC_BUILD" = true ]; then + echo ">> [$(date)] Cleaning source code" + rm -rf "$SRC_DIR/$branch_dir" + rm -rf "$CCACHE_BASE_DIR/$branch_dir" + fi + mkdir -p "$SRC_DIR/$branch_dir" cd "$SRC_DIR/$branch_dir" || return 1 -- GitLab From cfb9f2a220b2801a1d8509baf4b7287c447da9e3 Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Fri, 18 Jul 2025 16:12:49 +0530 Subject: [PATCH 10/10] Update ubuntu image to 24.04 --- Dockerfile | 28 +++++++++------------------- Dockerfile.community | 18 +++++++----------- 2 files changed, 16 insertions(+), 30 deletions(-) diff --git a/Dockerfile b/Dockerfile index 41a49a3..8771395 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:24.04 MAINTAINER Romain Hunault # Environment variables @@ -194,29 +194,19 @@ RUN mkdir -p $USERSCRIPTS_DIR RUN apt-get -qq update RUN apt-get -qqy upgrade -RUN apt-get install -y bc bison bsdmainutils build-essential ccache cgpt clang cron \ - curl flex g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick img2simg kmod jq \ - lib32ncurses5-dev libncurses5 lib32readline-dev lib32z1-dev libtinfo5 liblz4-tool \ - libncurses5-dev libsdl1.2-dev libssl-dev libxml2 \ - libxml2-utils lsof lzop maven openjdk-8-jdk pngcrush \ - procps python python3 rsync schedtool simg2img squashfs-tools software-properties-common wget xdelta3 xsltproc xxd yasm \ +RUN apt-get install -y android-sdk-libsparse-utils bc bison bsdmainutils build-essential ccache cgpt clang cron \ + curl flex g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick kmod jq \ + lib32readline-dev lib32z1-dev liblz4-tool \ + libsdl1.2-dev libssl-dev libxml2 \ + libxml2-utils lsof lzop maven pngcrush \ + procps python3 python-is-python3 rsync schedtool squashfs-tools software-properties-common wget xdelta3 xsltproc xxd yasm \ zip zlib1g-dev RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo RUN chmod a+x /usr/local/bin/repo -RUN ln -fs /usr/bin/python3 /usr/bin/python - -# Use adoptopenjdk.net to be able to use OpeJDK8 on debian:buster -RUN curl -q https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add - -RUN add-apt-repository --yes https://packages.adoptium.net/artifactory/deb -RUN apt-get -qq update && apt-get install -y temurin-8-jdk -RUN update-alternatives --set java /usr/lib/jvm/temurin-8-jdk-amd64/bin/java - - -# Fix jack server SSL issue during build for openjdk (adoptopenjdk won't work for nougat and oreo) -RUN perl -0777 -i -p -e 's/(jdk.tls.disabledAlgorithms=.*?), TLSv1, TLSv1\.1/$1/g' \ - /etc/java-8-openjdk/security/java.security +RUN wget https://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2_amd64.deb && dpkg -i libtinfo5_6.3-2_amd64.deb && rm -f libtinfo5_6.3-2_amd64.deb +RUN wget https://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2_amd64.deb && dpkg -i libncurses5_6.3-2_amd64.deb && rm -f libncurses5_6.3-2_amd64.deb # Set the work directory ######################## diff --git a/Dockerfile.community b/Dockerfile.community index 87bbd64..6cee5eb 100644 --- a/Dockerfile.community +++ b/Dockerfile.community @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:24.04 MAINTAINER Romain Hunault # Environment variables @@ -177,23 +177,19 @@ RUN mkdir -p $USERSCRIPTS_DIR RUN apt-get -qq update RUN apt-get -qqy upgrade -RUN apt-get install -y bc bison bsdmainutils build-essential ccache cgpt clang cron \ +RUN apt-get install -y android-sdk-libsparse-utils bc bison bsdmainutils build-essential ccache cgpt clang cron \ curl flex g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick kmod jq \ - lib32ncurses5-dev libncurses5 lib32readline-dev lib32z1-dev libtinfo5 liblz4-tool \ - libncurses5-dev libsdl1.2-dev libssl-dev libxml2 \ + lib32readline-dev lib32z1-dev liblz4-tool \ + libsdl1.2-dev libssl-dev libxml2 \ libxml2-utils lsof lzop maven pngcrush \ - procps python python3 rsync schedtool squashfs-tools software-properties-common wget xdelta3 xsltproc xxd yasm \ + procps python3 python-is-python3 rsync schedtool squashfs-tools software-properties-common wget xdelta3 xsltproc xxd yasm \ zip zlib1g-dev RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo RUN chmod a+x /usr/local/bin/repo -RUN ln -fs /usr/bin/python3 /usr/bin/python -# Use adoptopenjdk.net to be able to use OpeJDK8 on debian:buster -RUN curl -q https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add - -RUN add-apt-repository --yes https://packages.adoptium.net/artifactory/deb -RUN apt-get -qq update && apt-get install -y temurin-8-jdk -RUN update-alternatives --set java /usr/lib/jvm/temurin-8-jdk-amd64/bin/java +RUN wget https://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2_amd64.deb && dpkg -i libtinfo5_6.3-2_amd64.deb && rm -f libtinfo5_6.3-2_amd64.deb +RUN wget https://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2_amd64.deb && dpkg -i libncurses5_6.3-2_amd64.deb && rm -f libncurses5_6.3-2_amd64.deb # Set the work directory ######################## -- GitLab