From e5b588265c09d5c44e72b5079baae6f6a1559d6a Mon Sep 17 00:00:00 2001 From: Tad Date: Tue, 11 Sep 2018 19:53:50 -0400 Subject: [PATCH] Add function to always ensure discard mount option is enabled --- Patches/Common/android_vendor_divested/packages.mk | 2 +- PrebuiltApps | 2 +- Scripts/Common/Functions.sh | 8 ++++++++ Scripts/LineageOS-14.1/Patch.sh | 1 + Scripts/LineageOS-15.1/Functions.sh | 1 - Scripts/LineageOS-15.1/Patch.sh | 1 + 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Patches/Common/android_vendor_divested/packages.mk b/Patches/Common/android_vendor_divested/packages.mk index b7db7781..b3465050 100644 --- a/Patches/Common/android_vendor_divested/packages.mk +++ b/Patches/Common/android_vendor_divested/packages.mk @@ -27,7 +27,7 @@ PRODUCT_PACKAGES += \ LocalCalendar # Notes -# - Available: DNS66, K9Mail, NetMonitor, OpenKeychain, Shelter, TalkBack +# - Available (via PrebuiltApps submodule): DNS66, K9Mail, NetMonitor, OpenKeychain, Orbot, Orfox, Shelter, TalkBack # - Official F-Droid will be included once #843 is implemented # - $DOS_HOSTS_BLOCKING should become a tristate and support DNS66 # - K-9 Mail Will be included after 5.5xx release diff --git a/PrebuiltApps b/PrebuiltApps index c6d6468c..de9e4dba 160000 --- a/PrebuiltApps +++ b/PrebuiltApps @@ -1 +1 @@ -Subproject commit c6d6468c9bc54eba58921c9c2c4f59d626d41fcb +Subproject commit de9e4dbadab3032d09db2d14ea2d86df5f71a9b8 diff --git a/Scripts/Common/Functions.sh b/Scripts/Common/Functions.sh index a2e69400..e4f30629 100644 --- a/Scripts/Common/Functions.sh +++ b/Scripts/Common/Functions.sh @@ -206,6 +206,14 @@ enableZram() { } export -f enableZram; +enableDiscard() { + cd "$DOS_BUILD_BASE$1"; + sed -i '/\/data/{/discard/!s|nosuid|discard,nosuid|}' fstab.* root/fstab.* rootdir/fstab.* rootdir/etc/fstab.* &>/dev/null || true; + echo "Enabled discard for $1"; + cd "$DOS_BUILD_BASE"; +} +export -f enableDiscard; + enableForcedEncryption() { cd "$DOS_BUILD_BASE$1"; sed -i 's|encryptable=/|forceencrypt=/|' fstab.* root/fstab.* rootdir/fstab.* rootdir/etc/fstab.* &>/dev/null || true; diff --git a/Scripts/LineageOS-14.1/Patch.sh b/Scripts/LineageOS-14.1/Patch.sh index 69621e10..d084853b 100755 --- a/Scripts/LineageOS-14.1/Patch.sh +++ b/Scripts/LineageOS-14.1/Patch.sh @@ -232,6 +232,7 @@ if [ "$DOS_LOWRAM_ENABLED" = true ]; then find "device" -maxdepth 2 -mindepth 2 find "hardware/qcom/gps" -name "gps\.conf" -type f -exec bash -c 'enhanceLocation "$0"' {} \;; find "device" -name "gps\.conf" -type f -exec bash -c 'enhanceLocation "$0"' {} \;; find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableDexPreOpt "$0"' {} \;; +find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableDiscard "$0"' {} \;; find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableForcedEncryption "$0"' {} \;; #if [ "$STRONG_ENCRYPTION_ENABLED" = true ]; then find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableStrongEncryption "$0"' {} \;; fi; find "kernel" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'hardenDefconfig "$0"' {} \;; diff --git a/Scripts/LineageOS-15.1/Functions.sh b/Scripts/LineageOS-15.1/Functions.sh index ac08c477..f6811449 100644 --- a/Scripts/LineageOS-15.1/Functions.sh +++ b/Scripts/LineageOS-15.1/Functions.sh @@ -85,7 +85,6 @@ patchWorkspace() { 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 -t android-8.1.0_r46; #repopick 219020 219022; #ab-neverallow-user repopick -f 214824 209584 209585 215010 214300; #g3-common repopick -f 211404 211405 211406 211407 211408 211409; #d852 diff --git a/Scripts/LineageOS-15.1/Patch.sh b/Scripts/LineageOS-15.1/Patch.sh index 40590ddf..1a9b7cd6 100755 --- a/Scripts/LineageOS-15.1/Patch.sh +++ b/Scripts/LineageOS-15.1/Patch.sh @@ -214,6 +214,7 @@ if [ "$DOS_LOWRAM_ENABLED" = true ]; then find "device" -maxdepth 2 -mindepth 2 find "hardware/qcom/gps" -name "gps\.conf" -type f -exec bash -c 'enhanceLocation "$0"' {} \;; find "device" -name "gps\.conf" -type f -exec bash -c 'enhanceLocation "$0"' {} \;; find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableDexPreOpt "$0"' {} \;; +find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableDiscard "$0"' {} \;; find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableForcedEncryption "$0"' {} \;; #if [ "$STRONG_ENCRYPTION_ENABLED" = true ]; then find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableStrongEncryption "$0"' {} \;; fi; find "kernel" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'hardenDefconfig "$0"' {} \;;