gluon-autoupdater: drop caches before upgrade

This will free about 5 to 12 MB of RAM even on lightly used devices
yielding plenty of RAM for autoupdate to succeed.
This commit is contained in:
Nils Schneider 2014-02-19 01:01:41 +01:00
parent 3712f8795c
commit 6a2e7d45d8

View File

@ -138,6 +138,10 @@ autoupdate() {
if newer_than "$fw_version" "$my_version"; then
echo "New version available"
# drop caches to make room for firmware image
sync
sysctl -w vm.drop_caches=3
local fw_image=$(mktemp)
fetch_firmware $MIRROR $fw_image || { rm -f $fw_image; return 1; }