Flash Usage on failed updates

I am having an issue with the update command filling up the flash unnecessarily on failed updates. How can remove any files associated with a failed update?

Prior to an update attempt the flash was at 90% usage

root@p0xx-119-nosn:~# df | grep flash
df: /dev/mqueue: No such file or directory
df: /dev/mqueue: No such file or directory
/dev/ubi3_0             107036     90952     11248  89% /mnt/flash

The update failes and i no longer have any flash space:

root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# ./WP77XX.sh
Unpacking package: 100% ++++++++++++++++++++++++++++++++++++++++++++++++++
***Error: Internal error during update. See log for details.

FAILED
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# df | grep flash
df: /dev/mqueue: No such file or directory
df: /dev/mqueue: No such file or directory
/dev/ubi3_0             107036    107028         0 100% /mnt/flash

I need to audit the flash/overlay in general to figure out where i can get more space; however, as a failed update eats up 10% of the flash, I need to know how to free that memory.

how about erasing the userapp partition?

Can’t do that as there are other files i need to keep. So let’s try to scope this to figuring out how the update command works and see if its behavior can be modified.

Right now the issue is that there are basically 3 versions of my app on the device at any time. The app is currently 50MB uncompressed so the combined 150MB is primary reason the flash is filling up. Is there any way to delete the old version of the app (in the case below it would be 1.0.0.9891.dockerbld) to free up flash?

root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# cat /mnt/flash/legato/apps/f575dd67a793f2e5ff176a0d672ded39/info.properties
app.name=pawp77xx
app.md5=f575dd67a793f2e5ff176a0d672ded39
app.version=1.0.0.9892.dockerbld
legato.version=21.05.0
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# cat /mnt/flash/legato/apps/591db520c025e609609549a1670beb94/info.properties
app.name=pawp77xx
app.md5=591db520c025e609609549a1670beb94
app.version=1.0.0.9891.dockerbld
legato.version=21.05.0
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# cat /mnt/flash/legato/apps/unpack/info.properties
app.name=pawp77xx
app.md5=74baec72572702bcb66f3af224897b5a
app.version=1.0.0.9893.dockerbld
legato.version=21.05.0

not quite sure why there are three version of the app at the same time…

How about “app remove” your app and then install the new .update file?

using app remove, the app is no longer listed in app list; however, the files are still in flash (except unpack may have been cleaned up).

root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# app list | grep pawp
pawp77xx
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# app remove pawp77xx
Removing app 'pawp77xx'...
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# app list | grep pawp
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# cat /mnt/flash/legato/apps/591db520c025e609609549a1670beb94/info.properties
app.name=pawp77xx
app.md5=591db520c025e609609549a1670beb94
app.version=1.0.0.9891.dockerbld
legato.version=21.05.0
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# cat /mnt/flash/legato/apps/f575dd67a793f2e5ff176a0d672ded39/info.properties
app.name=pawp77xx
app.md5=f575dd67a793f2e5ff176a0d672ded39
app.version=1.0.0.9892.dockerbld
legato.version=21.05.0

you can use “update -g” to remove it:

root@fx30:~# find /mnt/flash/legato/apps/ -name "info.properties" | xargs grep -
l "modemDemo1"
/mnt/flash/legato/apps/5e257f3becbff2790340d277c789a674/info.properties
root@fx30:~# app status
[running] atAirVantage
[running] atQmiLinker
[running] atService
[running] audioService
[running] avcService
[running] cellNetService
[running] dataConnectionService
[running] fwupdateService
[running] gpioService
[running] modemService
[running] portService
[running] positioningService
[running] powerMgr
[running] powerService
[running] qmiAirVantage
[running] secStore
[stopped] smsInboxService
[stopped] spiService
[stopped] tools
[stopped] voiceCallService
[stopped] wifi
[stopped] wifiApTest
[stopped] wifiClientTest
[running] wifiService
[stopped] wifiWebAp
[stopped] UART_TCP_Demo1
[running] hello1
[running] modemDemo1
root@fx30:~# app remove modemDemo1
Removing app 'modemDemo1'...
root@fx30:~# app status
[running] atAirVantage
[running] atQmiLinker
[running] atService
[running] audioService
[running] avcService
[running] cellNetService
[running] dataConnectionService
[running] fwupdateService
[running] gpioService
[running] modemService
[running] portService
[running] positioningService
[running] powerMgr
[running] powerService
[running] qmiAirVantage
[running] secStore
[stopped] smsInboxService
[stopped] spiService
[stopped] tools
[stopped] voiceCallService
[stopped] wifi
[stopped] wifiApTest
[stopped] wifiClientTest
[running] wifiService
[stopped] wifiWebAp
[stopped] UART_TCP_Demo1
[running] hello1
root@fx30:~# find /mnt/flash/legato/apps/ -name "info.properties" | xargs grep -
l "modemDemo1"
/mnt/flash/legato/apps/5e257f3becbff2790340d277c789a674/info.properties
root@fx30:~# update -g
System is now marked 'Good'.
root@fx30:~# find /mnt/flash/legato/apps/ -name "info.properties" | xargs grep -
l "modemDemo1"
root@fx30:~#