Add function to always ensure discard mount option is enabled

This commit is contained in:
Tad 2018-09-11 19:53:50 -04:00
parent d231bd3172
commit e5b588265c
6 changed files with 12 additions and 3 deletions

View File

@ -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

@ -1 +1 @@
Subproject commit c6d6468c9bc54eba58921c9c2c4f59d626d41fcb
Subproject commit de9e4dbadab3032d09db2d14ea2d86df5f71a9b8

View File

@ -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;

View File

@ -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"' {} \;;

View File

@ -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

View File

@ -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"' {} \;;