From 752f8ab2704677837eb14f28d4f1b949a8ed6abb Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Wed, 7 Apr 2021 13:28:43 +0000 Subject: [PATCH 1/4] adding BUILD_ONLY_SYSTEMIMAGE option --- src/build.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/build.sh b/src/build.sh index 2b9245f..7f202b4 100755 --- a/src/build.sh +++ b/src/build.sh @@ -201,8 +201,19 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then if [ "${ENG_BUILD}" = true ]; then BRUNCH_DEVICE=lineage_${DEVICE}-eng fi + build_success=false + if [ "${BUILD_ONLY_SYSTEMIMAGE}" = true ]; then + breakfast "${BRUNCH_DEVICE}" + if make systemimage; then + build_success=true + fi + else + if brunch "${BRUNCH_DEVICE}"; then + build_success=true + fi + fi - if brunch "${BRUNCH_DEVICE}"; then + if [ "$build_success" = true ]; then currentdate=$(date +%Y%m%d) if [ "$builddate" != "$currentdate" ]; then find "out/target/product/${DEVICE}" -maxdepth 1 -name "e-*-$currentdate-*.zip*" -type f -exec sh /root/fix_build_date.sh {} "$currentdate" "$builddate" \; -- GitLab From 8d018fe01d95743c902a8c8c2f7cb12dc75fe124 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Thu, 8 Apr 2021 08:23:47 +0000 Subject: [PATCH 2/4] using $OUT variable instead of $DEVICE --- src/build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/build.sh b/src/build.sh index 7f202b4..25e1110 100755 --- a/src/build.sh +++ b/src/build.sh @@ -216,12 +216,12 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then if [ "$build_success" = true ]; then currentdate=$(date +%Y%m%d) if [ "$builddate" != "$currentdate" ]; then - find "out/target/product/${DEVICE}" -maxdepth 1 -name "e-*-$currentdate-*.zip*" -type f -exec sh /root/fix_build_date.sh {} "$currentdate" "$builddate" \; + find "${OUT}" -maxdepth 1 -name "e-*-$currentdate-*.zip*" -type f -exec sh /root/fix_build_date.sh {} "$currentdate" "$builddate" \; fi # Move produced ZIP files to the main OUT directory echo ">> [$(date)] Moving build artifacts for ${DEVICE} to '$ZIP_DIR/$zipsubdir'" - cd "out/target/product/${DEVICE}" || return 1 + cd "${OUT}" || return 1 for build in e-*.zip; do sha256sum "$build" > "$ZIP_DIR/$zipsubdir/$build.sha256sum" find . -maxdepth 1 -name 'e-*.zip*' -type f -exec mv {} "$ZIP_DIR/$zipsubdir/" \; @@ -231,7 +231,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then cd "$ZIP_DIR/$zipsubdir" || return 1 sha256sum "IMG-$build" > "IMG-$build.sha256sum" md5sum "IMG-$build" > "IMG-$build.md5sum" - cd "$source_dir/out/target/product/${DEVICE}" || return 1 + cd "${OUT}" || return 1 fi if [ "$BACKUP_INTERMEDIATE_SYSTEM_IMG" = true ]; then mv obj/PACKAGING/target_files_intermediates/lineage*/IMAGES/system.img ./ @@ -239,7 +239,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then cd $ZIP_DIR/$zipsubdir sha256sum "IMG-$build" > "IMG-$build.sha256sum" md5sum "IMG-$build" > "IMG-$build.md5sum" - cd "$source_dir/out/target/product/${DEVICE}" || return 1 + cd "${OUT}" || return 1 fi if [ "$RECOVERY_IMG" = true ]; then -- GitLab From e23e971e2f68d59a2cf89016daab72532bd8ce99 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Thu, 8 Apr 2021 13:21:18 +0000 Subject: [PATCH 3/4] sed build name from build.prop for systemimage only builds --- src/build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/build.sh b/src/build.sh index 25e1110..bf885c8 100755 --- a/src/build.sh +++ b/src/build.sh @@ -223,6 +223,10 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then echo ">> [$(date)] Moving build artifacts for ${DEVICE} to '$ZIP_DIR/$zipsubdir'" cd "${OUT}" || return 1 for build in e-*.zip; do + #with only systemimage, we don't have a e-*.zip + if [ "${BUILD_ONLY_SYSTEMIMAGE}" = true ]; then + build=e-`grep lineage.version system/build.prop | sed s/#.*// | sed s/.*=// | tr -d \\n` + fi sha256sum "$build" > "$ZIP_DIR/$zipsubdir/$build.sha256sum" find . -maxdepth 1 -name 'e-*.zip*' -type f -exec mv {} "$ZIP_DIR/$zipsubdir/" \; -- GitLab From 66c9a32827c0c0ea09c731aec03cf69158789523 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Thu, 8 Apr 2021 14:30:20 +0000 Subject: [PATCH 4/4] missing .zip at the end of the build name --- src/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.sh b/src/build.sh index bf885c8..4fab9ea 100755 --- a/src/build.sh +++ b/src/build.sh @@ -225,7 +225,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then for build in e-*.zip; do #with only systemimage, we don't have a e-*.zip if [ "${BUILD_ONLY_SYSTEMIMAGE}" = true ]; then - build=e-`grep lineage.version system/build.prop | sed s/#.*// | sed s/.*=// | tr -d \\n` + build=e-`grep lineage.version system/build.prop | sed s/#.*// | sed s/.*=// | tr -d \\n`.zip fi sha256sum "$build" > "$ZIP_DIR/$zipsubdir/$build.sha256sum" find . -maxdepth 1 -name 'e-*.zip*' -type f -exec mv {} "$ZIP_DIR/$zipsubdir/" \; -- GitLab