diff --git a/Scripts/Common/Copy_Keys.sh b/Scripts/Common/Copy_Keys.sh index ed30b2e5..b9bb075d 100644 --- a/Scripts/Common/Copy_Keys.sh +++ b/Scripts/Common/Copy_Keys.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -uo pipefail; if [ -d "$DOS_SIGNING_KEYS" ]; then echo "Copying verity/avb public keys to kernels..."; @@ -104,7 +105,7 @@ cp -v "$DOS_SIGNING_KEYS/vayu/verifiedboot_relkeys.der.x509" "kernel/xiaomi/sm81 cp -v "$DOS_SIGNING_KEYS/walleye/verifiedboot_relkeys.der.x509" "kernel/google/wahoo/verifiedboot_walleye_dos_relkeys.der.x509"; cp -v "$DOS_SIGNING_KEYS/z2_plus/verifiedboot_relkeys.der.x509" "kernel/zuk/msm8996/verifiedboot_z2_plus_dos_relkeys.der.x509"; cp -v "$DOS_SIGNING_KEYS/zenfone3/verifiedboot_relkeys.der.x509" "kernel/asus/msm8953/verifiedboot_zenfone3_dos_relkeys.der.x509"; -echo "Copied keys to kernels!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Copied keys to kernels\e[0m"; else -echo -e "\e[0;31mSigning keys unavailable, NOT copying public keys to kernels!\e[0m"; +echo -e "\e[0;31mSigning keys unavailable, NOT copying public keys to kernels\e[0m"; fi; diff --git a/Scripts/Common/Deblob.sh b/Scripts/Common/Deblob.sh index 80299a35..7ceddc43 100644 --- a/Scripts/Common/Deblob.sh +++ b/Scripts/Common/Deblob.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -uo pipefail; #Goal: Remove as many proprietary blobs without breaking core functionality #Outcome: Increased battery/performance/privacy/security, Decreased ROM size @@ -806,4 +807,4 @@ rm -rf vendor/samsung/nodevice; cd "$DOS_BUILD_BASE"; -echo "Deblobbing complete!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Deblobbing complete\e[0m"; diff --git a/Scripts/Common/Fix_CVE_Patchers.sh b/Scripts/Common/Fix_CVE_Patchers.sh index 32a32e34..394e5ed3 100644 --- a/Scripts/Common/Fix_CVE_Patchers.sh +++ b/Scripts/Common/Fix_CVE_Patchers.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; commentPatches() { file="$1"; @@ -83,3 +84,4 @@ commentPatches android_kernel_yandex_sdm660.sh "CVE-2019-11599" "CVE-2019-14070/ commentPatches android_kernel_zte_msm8930.sh "CVE-2015-2922" "CVE-2017-11015/prima"; commentPatches android_kernel_zte_msm8996.sh "0001-LinuxIncrementals/3.18/3.18.0098-0099.patch" "CVE-2017-13162" "CVE-2017-15951" "CVE-2017-16939" "CVE-2018-17972" "CVE-2019-2214" "CVE-2019-14070" "CVE-2019-16746" "CVE-2020-0427" "CVE-2020-14381" "CVE-2020-16166"; commentPatches android_kernel_zuk_msm8996.sh "0008-Graphene-Kernel_Hardening/4.4/0011.patch" "0008-Graphene-Kernel_Hardening/4.4/0012.patch" "0008-Graphene-Kernel_Hardening/4.4/0014.patch" "CVE-2019-19319" "CVE-2020-1749" "CVE-2020-8992" "CVE-2020-1616"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Fixed CVE patchers\e[0m"; diff --git a/Scripts/Common/Optimize.sh b/Scripts/Common/Optimize.sh index 21180949..1087a595 100644 --- a/Scripts/Common/Optimize.sh +++ b/Scripts/Common/Optimize.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Attempts to increase performance and battery life #Last verified: 2018-04-27 @@ -35,4 +36,4 @@ sed -i "s/#define VM_MAX_READAHEAD\t128/#define VM_MAX_READAHEAD\t512/" ./*/*/in fi; cd "$DOS_BUILD_BASE"; -echo "Optimizing complete!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Optimizing complete\e[0m"; diff --git a/Scripts/Common/Patch_CVE.sh b/Scripts/Common/Patch_CVE.sh index 2951dc8c..1169fd5f 100644 --- a/Scripts/Common/Patch_CVE.sh +++ b/Scripts/Common/Patch_CVE.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -uo pipefail; #Attempts to patch kernels to be more secure @@ -37,4 +38,4 @@ for patcher in "$DOS_SCRIPTS_CVES"/*.sh; do done; cd "$DOS_BUILD_BASE"; -echo "Patched CVEs!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Patched CVEs\e[0m"; diff --git a/Scripts/Common/Post.sh b/Scripts/Common/Post.sh index db84c963..efe407ea 100644 --- a/Scripts/Common/Post.sh +++ b/Scripts/Common/Post.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; echo "Post tweaks..."; @@ -37,4 +38,4 @@ sed -i 's/static bool slab_nomerge __ro_after_init = !IS_ENABLED(CONFIG_SLAB_MER cd "$DOS_BUILD_BASE"; -echo "Post tweaks complete!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Post tweaks complete\e[0m"; diff --git a/Scripts/Generate_Signing_Keys.sh b/Scripts/Generate_Signing_Keys.sh index c3f546c9..6e5c4365 100644 --- a/Scripts/Generate_Signing_Keys.sh +++ b/Scripts/Generate_Signing_Keys.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Reference (MIT): https://grapheneos.org/build#generating-release-signing-keys diff --git a/Scripts/LineageOS-14.1/Defaults.sh b/Scripts/LineageOS-14.1/Defaults.sh index 15e597c7..fa1e5dc9 100644 --- a/Scripts/LineageOS-14.1/Defaults.sh +++ b/Scripts/LineageOS-14.1/Defaults.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Changes various default settings #Last verified: 2018-04-27 @@ -56,4 +57,4 @@ sed -i 's/ro.config.alarm_alert=Hassium.ogg/ro.config.alarm_alert=Alarm_Buzzer.o fi; cd "$DOS_BUILD_BASE"; -echo "Default settings changed!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Default settings changed\e[0m"; diff --git a/Scripts/LineageOS-14.1/Functions.sh b/Scripts/LineageOS-14.1/Functions.sh index 7f225a80..b9a90640 100644 --- a/Scripts/LineageOS-14.1/Functions.sh +++ b/Scripts/LineageOS-14.1/Functions.sh @@ -24,7 +24,7 @@ export -f patchAllKernels; resetWorkspace() { umask 0022; - repo forall -c 'git add -A && git reset --hard' && rm -rf out && repo sync -j8 --force-sync --detach; + repo forall -c 'git add -A && git reset --hard' && rm -rf out DOS_PATCHED_FLAG && repo sync -j8 --force-sync --detach; } export -f resetWorkspace; @@ -94,6 +94,8 @@ export -f buildAll; patchWorkspace() { umask 0022; + cd "$DOS_BUILD_BASE$1"; + touch DOS_PATCHED_FLAG; if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanForMalware false "$DOS_PREBUILT_APPS $DOS_BUILD_BASE/build $DOS_BUILD_BASE/device $DOS_BUILD_BASE/vendor/cm"; fi; source build/envsetup.sh; #repopick -it bt-sbc-hd-dualchannel-nougat; @@ -102,15 +104,15 @@ patchWorkspace() { repopick -it n-asb-2021-10; repopick -it tzdb2021c_N; - source "$DOS_SCRIPTS/Patch.sh"; - source "$DOS_SCRIPTS_COMMON/Copy_Keys.sh"; - source "$DOS_SCRIPTS/Defaults.sh"; - source "$DOS_SCRIPTS/Rebrand.sh"; - source "$DOS_SCRIPTS/Theme.sh"; - source "$DOS_SCRIPTS_COMMON/Optimize.sh"; - source "$DOS_SCRIPTS_COMMON/Deblob.sh"; - source "$DOS_SCRIPTS_COMMON/Patch_CVE.sh"; - source "$DOS_SCRIPTS_COMMON/Post.sh"; + sh "$DOS_SCRIPTS/Patch.sh"; + sh "$DOS_SCRIPTS_COMMON/Copy_Keys.sh"; + sh "$DOS_SCRIPTS/Defaults.sh"; + sh "$DOS_SCRIPTS/Rebrand.sh"; + sh "$DOS_SCRIPTS/Theme.sh"; + sh "$DOS_SCRIPTS_COMMON/Optimize.sh"; + sh "$DOS_SCRIPTS_COMMON/Deblob.sh"; + sh "$DOS_SCRIPTS_COMMON/Patch_CVE.sh"; + sh "$DOS_SCRIPTS_COMMON/Post.sh"; source build/envsetup.sh; } export -f patchWorkspace; diff --git a/Scripts/LineageOS-14.1/Patch.sh b/Scripts/LineageOS-14.1/Patch.sh index 919d796a..d82ec180 100644 --- a/Scripts/LineageOS-14.1/Patch.sh +++ b/Scripts/LineageOS-14.1/Patch.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Last verified: 2018-04-27 @@ -430,3 +431,4 @@ sed -i 's/^YYLTYPE yylloc;/extern YYLTYPE yylloc;/' kernel/*/*/scripts/dtc/dtc-l # #END OF DEVICE CHANGES # +echo -e "\e[0;32m[SCRIPT COMPLETE] Primary patching finished\e[0m"; diff --git a/Scripts/LineageOS-14.1/Rebrand.sh b/Scripts/LineageOS-14.1/Rebrand.sh index 33649fad..6e62c202 100644 --- a/Scripts/LineageOS-14.1/Rebrand.sh +++ b/Scripts/LineageOS-14.1/Rebrand.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Updates select user facing strings #Last verified: 2018-04-27 @@ -68,4 +69,4 @@ rm -rf bootanimation; fi; cd "$DOS_BUILD_BASE"; -echo "Rebranding complete!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Rebranding complete\e[0m"; diff --git a/Scripts/LineageOS-14.1/Theme.sh b/Scripts/LineageOS-14.1/Theme.sh index d651f25d..412628f1 100644 --- a/Scripts/LineageOS-14.1/Theme.sh +++ b/Scripts/LineageOS-14.1/Theme.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Replaces teal accents with orange/yellow ones #Last verified: 2018-04-27 @@ -61,4 +62,4 @@ mogrify -format png -fill "#$DOS_THEME_500" -opaque "#26a69a" -fuzz 10% java/res fi; cd "$DOS_BUILD_BASE"; -echo "Applied theme!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Applied theme\e[0m"; diff --git a/Scripts/LineageOS-15.1/Defaults.sh b/Scripts/LineageOS-15.1/Defaults.sh index fb101ff6..6e649411 100644 --- a/Scripts/LineageOS-15.1/Defaults.sh +++ b/Scripts/LineageOS-15.1/Defaults.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Changes various default settings #Last verified: 2018-04-27 @@ -50,4 +51,4 @@ sed -i 's/ro.config.alarm_alert=Hassium.ogg/ro.config.alarm_alert=Alarm_Buzzer.o fi; cd "$DOS_BUILD_BASE"; -echo "Default settings changed!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Default settings changed\e[0m"; diff --git a/Scripts/LineageOS-15.1/Functions.sh b/Scripts/LineageOS-15.1/Functions.sh index 304f061d..b4b08a89 100644 --- a/Scripts/LineageOS-15.1/Functions.sh +++ b/Scripts/LineageOS-15.1/Functions.sh @@ -24,7 +24,7 @@ export -f patchAllKernels; resetWorkspace() { umask 0022; - repo forall -c 'git add -A && git reset --hard' && rm -rf out && repo sync -j8 --force-sync --detach; + repo forall -c 'git add -A && git reset --hard' && rm -rf out DOS_PATCHED_FLAG && repo sync -j8 --force-sync --detach; } export -f resetWorkspace; @@ -83,19 +83,21 @@ export -f buildAll; patchWorkspace() { umask 0022; + cd "$DOS_BUILD_BASE$1"; + touch DOS_PATCHED_FLAG; if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanForMalware false "$DOS_PREBUILT_APPS $DOS_BUILD_BASE/build $DOS_BUILD_BASE/device $DOS_BUILD_BASE/vendor/lineage"; fi; source build/envsetup.sh; repopick -it O_asb_2021-10; - source "$DOS_SCRIPTS/Patch.sh"; - source "$DOS_SCRIPTS_COMMON/Copy_Keys.sh"; - source "$DOS_SCRIPTS/Defaults.sh"; - source "$DOS_SCRIPTS/Rebrand.sh"; - source "$DOS_SCRIPTS_COMMON/Optimize.sh"; - source "$DOS_SCRIPTS_COMMON/Deblob.sh"; - source "$DOS_SCRIPTS_COMMON/Patch_CVE.sh"; - source "$DOS_SCRIPTS_COMMON/Post.sh"; + sh "$DOS_SCRIPTS/Patch.sh"; + sh "$DOS_SCRIPTS_COMMON/Copy_Keys.sh"; + sh "$DOS_SCRIPTS/Defaults.sh"; + sh "$DOS_SCRIPTS/Rebrand.sh"; + sh "$DOS_SCRIPTS_COMMON/Optimize.sh"; + sh "$DOS_SCRIPTS_COMMON/Deblob.sh"; + sh "$DOS_SCRIPTS_COMMON/Patch_CVE.sh"; + sh "$DOS_SCRIPTS_COMMON/Post.sh"; source build/envsetup.sh; } export -f patchWorkspace; diff --git a/Scripts/LineageOS-15.1/Patch.sh b/Scripts/LineageOS-15.1/Patch.sh index 9a20e842..1afd9a15 100644 --- a/Scripts/LineageOS-15.1/Patch.sh +++ b/Scripts/LineageOS-15.1/Patch.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Last verified: 2018-04-27 @@ -321,3 +322,4 @@ rm -v kernel/*/*/drivers/staging/greybus/tools/Android.mk; # #END OF DEVICE CHANGES # +echo -e "\e[0;32m[SCRIPT COMPLETE] Primary patching finished\e[0m"; diff --git a/Scripts/LineageOS-15.1/Rebrand.sh b/Scripts/LineageOS-15.1/Rebrand.sh index 6401b97f..3d7458d1 100644 --- a/Scripts/LineageOS-15.1/Rebrand.sh +++ b/Scripts/LineageOS-15.1/Rebrand.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Updates select user facing strings #Last verified: 2018-04-27 @@ -23,7 +24,7 @@ echo "Rebranding..."; if enter "bootable/recovery"; then git revert --no-edit bc57208dfcd0958d03a00bbcf5345be6ceac9988 6ac3bb48f9d10e604d4b2d6c4152be9d35d17ea0; applyPatch "$DOS_PATCHES/android_bootable_recovery/0001-Remove_Logo.patch"; #Remove logo rendering code -rm res*/images/logo_image.png; #Remove logo images +rm res*/images/logo_image.png || true; #Remove logo images mogrify -format png -fill "#FF5722" -opaque "#167C80" -fuzz 10% res-*/images/*sel.png; #Recolor icons sed -i 's|grid_h \* 2 / 3|grid_h * 0.25|' screen_ui.cpp; #Center icons sed -i 's|0x16, 0x7c, 0x80|0x03, 0xa9, 0xf4|' screen_ui.cpp; #Recolor text @@ -80,4 +81,4 @@ rm -rf bootanimation; fi; cd "$DOS_BUILD_BASE"; -echo "Rebranding complete!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Rebranding complete\e[0m"; diff --git a/Scripts/LineageOS-16.0/Defaults.sh b/Scripts/LineageOS-16.0/Defaults.sh index 5fe7a16c..b15b947c 100644 --- a/Scripts/LineageOS-16.0/Defaults.sh +++ b/Scripts/LineageOS-16.0/Defaults.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Changes various default settings #Last verified: 2019-03-04 @@ -46,4 +47,4 @@ sed -i 's/ro.config.alarm_alert=Hassium.ogg/ro.config.alarm_alert=Alarm_Buzzer.o fi; cd "$DOS_BUILD_BASE"; -echo "Default settings changed!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Default settings changed\e[0m"; diff --git a/Scripts/LineageOS-16.0/Functions.sh b/Scripts/LineageOS-16.0/Functions.sh index 9aec370e..2535609b 100644 --- a/Scripts/LineageOS-16.0/Functions.sh +++ b/Scripts/LineageOS-16.0/Functions.sh @@ -24,7 +24,7 @@ export -f patchAllKernels; resetWorkspace() { umask 0022; - repo forall -c 'git add -A && git reset --hard' && rm -rf out && repo sync -j8 --force-sync --detach; + repo forall -c 'git add -A && git reset --hard' && rm -rf out DOS_PATCHED_FLAG && repo sync -j8 --force-sync --detach; } export -f resetWorkspace; @@ -71,20 +71,22 @@ export -f buildAll; patchWorkspace() { umask 0022; + cd "$DOS_BUILD_BASE$1"; + touch DOS_PATCHED_FLAG; if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanForMalware false "$DOS_PREBUILT_APPS $DOS_BUILD_BASE/build $DOS_BUILD_BASE/device $DOS_BUILD_BASE/vendor/lineage"; fi; source build/envsetup.sh; #repopick -it pie-firewall; repopick -it P_asb_2021-10; - source "$DOS_SCRIPTS/Patch.sh"; - source "$DOS_SCRIPTS_COMMON/Copy_Keys.sh"; - source "$DOS_SCRIPTS/Defaults.sh"; - source "$DOS_SCRIPTS/Rebrand.sh"; - source "$DOS_SCRIPTS_COMMON/Optimize.sh"; - source "$DOS_SCRIPTS_COMMON/Deblob.sh"; - source "$DOS_SCRIPTS_COMMON/Patch_CVE.sh"; - source "$DOS_SCRIPTS_COMMON/Post.sh"; + sh "$DOS_SCRIPTS/Patch.sh"; + sh "$DOS_SCRIPTS_COMMON/Copy_Keys.sh"; + sh "$DOS_SCRIPTS/Defaults.sh"; + sh "$DOS_SCRIPTS/Rebrand.sh"; + sh "$DOS_SCRIPTS_COMMON/Optimize.sh"; + sh "$DOS_SCRIPTS_COMMON/Deblob.sh"; + sh "$DOS_SCRIPTS_COMMON/Patch_CVE.sh"; + sh "$DOS_SCRIPTS_COMMON/Post.sh"; source build/envsetup.sh; } export -f patchWorkspace; diff --git a/Scripts/LineageOS-16.0/Patch.sh b/Scripts/LineageOS-16.0/Patch.sh index 54059773..6ab01aea 100644 --- a/Scripts/LineageOS-16.0/Patch.sh +++ b/Scripts/LineageOS-16.0/Patch.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Last verified: 2019-03-04 @@ -319,3 +320,4 @@ rm -v kernel/*/*/drivers/staging/greybus/tools/Android.mk; # #END OF DEVICE CHANGES # +echo -e "\e[0;32m[SCRIPT COMPLETE] Primary patching finished\e[0m"; diff --git a/Scripts/LineageOS-16.0/Rebrand.sh b/Scripts/LineageOS-16.0/Rebrand.sh index e5f9fa58..5db76ee4 100644 --- a/Scripts/LineageOS-16.0/Rebrand.sh +++ b/Scripts/LineageOS-16.0/Rebrand.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Updates select user facing strings #Last verified: 2019-03-04 @@ -23,7 +24,7 @@ echo "Rebranding..."; if enter "bootable/recovery"; then git revert --no-edit c9ab109b6b6c502238ec88badc1fbed2644480f2 cb5b7cc0b04c445dbc189e28575bba50638433b5; applyPatch "$DOS_PATCHES/android_bootable_recovery/0002-Remove_Logo.patch"; #Remove logo rendering code -rm res*/images/logo_image.png; #Remove logo images +rm res*/images/logo_image.png || true; #Remove logo images mogrify -format png -fill "#FF5722" -opaque "#167C80" -fuzz 10% res-*/images/*sel.png; #Recolor icons sed -i 's|grid_h \* 2 / 3|grid_h * 0.25|' screen_ui.cpp; #Center icons sed -i 's|0x16, 0x7c, 0x80|0x03, 0xa9, 0xf4|' screen_ui.cpp; #Recolor text @@ -80,4 +81,4 @@ rm -rf bootanimation; fi; cd "$DOS_BUILD_BASE"; -echo "Rebranding complete!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Rebranding complete\e[0m"; diff --git a/Scripts/LineageOS-17.1/Defaults.sh b/Scripts/LineageOS-17.1/Defaults.sh index 018690d5..58e5201d 100644 --- a/Scripts/LineageOS-17.1/Defaults.sh +++ b/Scripts/LineageOS-17.1/Defaults.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Changes various default settings #Last verified: 2020-04-14 @@ -46,4 +47,4 @@ sed -i 's/ro.config.alarm_alert=Hassium.ogg/ro.config.alarm_alert=Alarm_Buzzer.o fi; cd "$DOS_BUILD_BASE"; -echo "Default settings changed!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Default settings changed\e[0m"; diff --git a/Scripts/LineageOS-17.1/Functions.sh b/Scripts/LineageOS-17.1/Functions.sh index 2f370b9d..0546ff2b 100644 --- a/Scripts/LineageOS-17.1/Functions.sh +++ b/Scripts/LineageOS-17.1/Functions.sh @@ -24,7 +24,7 @@ export -f patchAllKernels; resetWorkspace() { umask 0022; - repo forall -c 'git add -A && git reset --hard' && rm -rf out && repo sync -j8 --force-sync --detach; + repo forall -c 'git add -A && git reset --hard' && rm -rf out DOS_PATCHED_FLAG && repo sync -j8 --force-sync --detach; } export -f resetWorkspace; @@ -90,20 +90,22 @@ export -f buildAll; patchWorkspace() { umask 0022; + cd "$DOS_BUILD_BASE$1"; + touch DOS_PATCHED_FLAG; if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanForMalware false "$DOS_PREBUILT_APPS $DOS_BUILD_BASE/build $DOS_BUILD_BASE/device $DOS_BUILD_BASE/vendor/lineage"; fi; #source build/envsetup.sh; #repopick -it ten-firewall; #repopick -it Q_tzdb2021a1; - source "$DOS_SCRIPTS/Patch.sh"; - source "$DOS_SCRIPTS_COMMON/Copy_Keys.sh"; - source "$DOS_SCRIPTS/Defaults.sh"; - source "$DOS_SCRIPTS/Rebrand.sh"; - source "$DOS_SCRIPTS_COMMON/Optimize.sh"; - source "$DOS_SCRIPTS_COMMON/Deblob.sh"; - source "$DOS_SCRIPTS_COMMON/Patch_CVE.sh"; - source "$DOS_SCRIPTS_COMMON/Post.sh"; + sh "$DOS_SCRIPTS/Patch.sh"; + sh "$DOS_SCRIPTS_COMMON/Copy_Keys.sh"; + sh "$DOS_SCRIPTS/Defaults.sh"; + sh "$DOS_SCRIPTS/Rebrand.sh"; + sh "$DOS_SCRIPTS_COMMON/Optimize.sh"; + sh "$DOS_SCRIPTS_COMMON/Deblob.sh"; + sh "$DOS_SCRIPTS_COMMON/Patch_CVE.sh"; + sh "$DOS_SCRIPTS_COMMON/Post.sh"; source build/envsetup.sh; #Deblobbing fixes diff --git a/Scripts/LineageOS-17.1/Patch.sh b/Scripts/LineageOS-17.1/Patch.sh index d8993c55..3163a9b5 100644 --- a/Scripts/LineageOS-17.1/Patch.sh +++ b/Scripts/LineageOS-17.1/Patch.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Last verified: 2020-04-14 @@ -382,3 +383,4 @@ rm -v kernel/*/*/drivers/staging/greybus/tools/Android.mk; # #END OF DEVICE CHANGES # +echo -e "\e[0;32m[SCRIPT COMPLETE] Primary patching finished\e[0m"; diff --git a/Scripts/LineageOS-17.1/Rebrand.sh b/Scripts/LineageOS-17.1/Rebrand.sh index 54ff14e8..b8e62353 100644 --- a/Scripts/LineageOS-17.1/Rebrand.sh +++ b/Scripts/LineageOS-17.1/Rebrand.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Updates select user facing strings #Last verified: 2020-04-14 @@ -87,4 +88,4 @@ rm -rf bootanimation; fi; cd "$DOS_BUILD_BASE"; -echo "Rebranding complete!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Rebranding complete\e[0m"; diff --git a/Scripts/LineageOS-18.1/Defaults.sh b/Scripts/LineageOS-18.1/Defaults.sh index 8c69f73d..480edc33 100644 --- a/Scripts/LineageOS-18.1/Defaults.sh +++ b/Scripts/LineageOS-18.1/Defaults.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Changes various default settings #Last verified: 2021-03-22 @@ -54,4 +55,4 @@ sed -i 's/ro.config.alarm_alert=Hassium.ogg/ro.config.alarm_alert=Alarm_Buzzer.o fi; cd "$DOS_BUILD_BASE"; -echo "Default settings changed!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Default settings changed\e[0m"; diff --git a/Scripts/LineageOS-18.1/Functions.sh b/Scripts/LineageOS-18.1/Functions.sh index ba06da2e..02d798fe 100644 --- a/Scripts/LineageOS-18.1/Functions.sh +++ b/Scripts/LineageOS-18.1/Functions.sh @@ -24,7 +24,7 @@ export -f patchAllKernels; resetWorkspace() { umask 0022; - repo forall -c 'git add -A && git reset --hard' && rm -rf out && repo sync -j8 --force-sync --detach; + repo forall -c 'git add -A && git reset --hard' && rm -rf out DOS_PATCHED_FLAG && repo sync -j8 --force-sync --detach; } export -f resetWorkspace; @@ -124,20 +124,22 @@ export -f buildAll; patchWorkspace() { umask 0022; + cd "$DOS_BUILD_BASE$1"; + touch DOS_PATCHED_FLAG; if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanForMalware false "$DOS_PREBUILT_APPS $DOS_BUILD_BASE/build $DOS_BUILD_BASE/device $DOS_BUILD_BASE/vendor/lineage"; fi; #source build/envsetup.sh; #repopick -it eleven-firewall; #repopick -it R_tzdb2021a1; - source "$DOS_SCRIPTS/Patch.sh"; - source "$DOS_SCRIPTS_COMMON/Copy_Keys.sh"; - source "$DOS_SCRIPTS/Defaults.sh"; - source "$DOS_SCRIPTS/Rebrand.sh"; - source "$DOS_SCRIPTS_COMMON/Optimize.sh"; - source "$DOS_SCRIPTS_COMMON/Deblob.sh"; - source "$DOS_SCRIPTS_COMMON/Patch_CVE.sh"; - source "$DOS_SCRIPTS_COMMON/Post.sh"; + sh "$DOS_SCRIPTS/Patch.sh"; + sh "$DOS_SCRIPTS_COMMON/Copy_Keys.sh"; + sh "$DOS_SCRIPTS/Defaults.sh"; + sh "$DOS_SCRIPTS/Rebrand.sh"; + sh "$DOS_SCRIPTS_COMMON/Optimize.sh"; + sh "$DOS_SCRIPTS_COMMON/Deblob.sh"; + sh "$DOS_SCRIPTS_COMMON/Patch_CVE.sh"; + sh "$DOS_SCRIPTS_COMMON/Post.sh"; source build/envsetup.sh; #Deblobbing fixes diff --git a/Scripts/LineageOS-18.1/Patch.sh b/Scripts/LineageOS-18.1/Patch.sh index 8bec9b74..0b2849d6 100644 --- a/Scripts/LineageOS-18.1/Patch.sh +++ b/Scripts/LineageOS-18.1/Patch.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Last verified: 2021-03-22 @@ -466,3 +467,4 @@ rm -v kernel/*/*/drivers/staging/greybus/tools/Android.mk; # #END OF DEVICE CHANGES # +echo -e "\e[0;32m[SCRIPT COMPLETE] Primary patching finished\e[0m"; diff --git a/Scripts/LineageOS-18.1/Rebrand.sh b/Scripts/LineageOS-18.1/Rebrand.sh index fa644982..510aa79d 100644 --- a/Scripts/LineageOS-18.1/Rebrand.sh +++ b/Scripts/LineageOS-18.1/Rebrand.sh @@ -14,6 +14,7 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see . +set -euo pipefail; #Updates select user facing strings #Last verified: 2021-03-22 @@ -88,4 +89,4 @@ rm -rf bootanimation; fi; cd "$DOS_BUILD_BASE"; -echo "Rebranding complete!"; +echo -e "\e[0;32m[SCRIPT COMPLETE] Rebranding complete\e[0m"; diff --git a/Scripts/init.sh b/Scripts/init.sh index 04cf4b12..a382b6bd 100644 --- a/Scripts/init.sh +++ b/Scripts/init.sh @@ -32,6 +32,7 @@ export DOS_SIGNING_GPG=$DOS_WORKSPACE_ROOT"Signing_Keys/gnupg"; export CCACHE_COMPRESS=1; export CCACHE_COMPRESSLEVEL=1; #export DOS_BINARY_PATCHER=""; +export DOS_TOR_WRAPPER=""; #export DOS_TOR_WRAPPER="torsocks"; #Uncomment to perform select build operations over Tor export DOS_MALWARE_SCAN_ENABLED=true; #Set true to perform a fast scan on patchWorkspace() and a through scan on buildAll() export DOS_MALWARE_SCAN_SETTING="quick"; #buildAll() scan speed. Options: quick, extra, slow, full