post_boot: update zram setting avoid 32 bit overflow.
Change-Id: I790b5ef9fcf091e4af3ebaaac3341b8d4050c47e
This commit is contained in:
parent
3c2400960f
commit
b0de734ae5
1 changed files with 3 additions and 1 deletions
|
@ -371,7 +371,9 @@ function configure_zram_parameters() {
|
|||
|
||||
RamSizeGB=`echo "($MemTotal / 1048576 ) + 1" | bc`
|
||||
zRamSizeBytes=`echo "$RamSizeGB * 1024 * 1024 * 1024 / 2" | bc`
|
||||
if [ $zRamSizeBytes -gt 4294967296 ]; then
|
||||
zRamSizeMB=`echo "$RamSizeGB * 1024 / 2" | bc`
|
||||
# use MB avoid 32 bit overflow
|
||||
if [ $zRamSizeMB -gt 4096 ]; then
|
||||
zRamSizeBytes=4294967296
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue