sm6250-common: don't configure zram parameters with init.qcom.post_boot.sh

* let it use whatever is set in fstab
This commit is contained in:
Volodymyr Zhdanov 2020-09-09 12:52:37 +03:00 committed by Nick C
parent 26805408b6
commit 8b15e1d876
2 changed files with 4 additions and 21 deletions

View File

@ -27,25 +27,6 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
function configure_zram_parameters() {
MemTotalStr=`cat /proc/meminfo | grep MemTotal`
MemTotal=${MemTotalStr:16:8}
# Zram disk - 75% for Go devices.
# For >=2GB Non-Go devices, size = 50% of RAM size. Limit the size to 4GB.
RamSizeGB=`echo "($MemTotal / 1048576 ) + 1" | bc`
zRamSizeBytes=`echo "$RamSizeGB * 1024 * 1024 * 1024 / 2" | bc`
if [ $zRamSizeBytes -gt 4294967296 ]; then
zRamSizeBytes=4294967296
fi
echo 1 > /sys/block/zram0/use_dedup
echo $zRamSizeBytes > /sys/block/zram0/disksize
mkswap /dev/block/zram0
swapon /dev/block/zram0 -p 32758
}
function configure_read_ahead_kb_values() {
# set 512 for >= 4GB targets.
echo 512 > /sys/block/mmcblk0/bdi/read_ahead_kb
@ -137,8 +118,6 @@ function configure_memory_parameters() {
# wsf Range : 1..1000 So set to bare minimum value 1.
echo 1 > /proc/sys/vm/watermark_scale_factor
configure_zram_parameters
configure_read_ahead_kb_values
}

View File

@ -112,6 +112,10 @@ on late-fs
exec_start wait_for_keymaster
mount_all /vendor/etc/fstab.qcom --late
on property:sys.boot_completed=1
# Enable ZRAM on boot_complete
swapon_all /vendor/etc/fstab.qcom
service sec_nvm /vendor/bin/sec_nvm
class core
user system