update-binary: Selectively remove Google's SuW
* This is done based on the total memory as reported by /proc/meminfo * If the memory in the MemTotal field is less than 1572864 kB (1.5 GB), then Google's SuW is removed as a precaution, as it is known to crash on devices that don't have much memory available to use * Thanks to cdesai for the solution idea Change-Id: If0d5b9dff7f9536f78d4069df8665b19209fea52 Signed-off-by: Paul Keith <javelinanddart@bestas.gr>
This commit is contained in:
@@ -53,10 +53,17 @@ if [ -d /system/lib64 ]; then
|
|||||||
LD_PATH=/system/lib64
|
LD_PATH=/system/lib64
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
LOWMEM=1572864
|
||||||
|
MEM=`cat /proc/meminfo | head -1 | sed 's/[^0-9]*//g'`
|
||||||
|
|
||||||
ui_print "Extracting files"
|
ui_print "Extracting files"
|
||||||
cd /tmp
|
cd /tmp
|
||||||
unzip -o "$ZIP" system/*
|
unzip -o "$ZIP" system/*
|
||||||
cd system
|
cd system
|
||||||
|
if [ "$MEM" -lt "$LOWMEM" ]; then
|
||||||
|
ui_print "Low RAM device detected, removing Google SuW"
|
||||||
|
exec_util "rm -rf priv-app/SetupWizard"
|
||||||
|
fi
|
||||||
ui_print "Generating addon.d file"
|
ui_print "Generating addon.d file"
|
||||||
cat addon.d/addond_head > addon.d/30-gapps.sh
|
cat addon.d/addond_head > addon.d/30-gapps.sh
|
||||||
for f in `exec_util "find . -type f"`; do
|
for f in `exec_util "find . -type f"`; do
|
||||||
|
Reference in New Issue
Block a user