Hi, Luigi,
Short Answer
After you’ve installed the new firmware image, delete /legato/mntLegatoVersion
and reboot.
root@swi-mdm9x15:~# rm /legato/mntLegatoVersion
root@swi-mdm9x15:~# reboot
Or: After you’ve installed the new firmware image, stop Legato, delete everything under /mnt/flash/legato
and reboot.
root@swi-mdm9x15:~# legato stop
Stopping Legato...
DONE.
root@swi-mdm9x15:~# rm -rf /mnt/flash/legato/*
root@swi-mdm9x15:~# reboot
Long Answer
Your module (and other Qualcomm 9x15-based modules by Sierra Wireless) have 2 places where Legato systems are installed:
- On the writeable flash file system mounted at
/mnt/flash
, under the legato
directory (which is also bind-mounted at /legato
). This can hold up to two Legato systems at the same time (one “good” and one “trying”), and is where the files are kept that indicate the statuses of the installed systems, among other things.
- On a read-only flash file system mounted at
/mnt/legato
.
When you install a firmware image “containing Legato”, it replaces your /mnt/legato
system.
Every time you boot, the init scripts will run the start
program in /mnt/legato
. This program will check to make sure that /mnt/flash/legato
(aka /legato
) is set up properly before launching /legato/systems/current/bin/supervisor
.
If you have nothing in /mnt/flash/legato
yet, then the start
program will create a new /mnt/flash/legato/
directory and create a bunch of symlinks pointing to the files it needs on /mnt/legato
. When this is all set up, it will copy /mnt/legato/system/version
to /mnt/flash/legato/mntLegatoVersion
(you’ll see why in a minute) before starting /mnt/flash/legato/systems/current/bin/supervisor
.
At this point, if you were to reboot, the start
program can see that /mnt/legato/system/version
is the same as /mnt/flash/legato/mntLegatoVersion
, so it knows that it doesn’t have to install that system into /mnt/flash/legato
this time.
Later, when you use the update
tool to install a new system, it will be installed into /mnt/flash/legato
and Legato will shut down. The start
program sees that Legato shut down cleanly due to an update, selects this new system to be the “current” system, and runs it.
Again, if you were to reboot now, the start
program can see that /mnt/legato/system/version
is the same as /mnt/flash/legato/mntLegatoVersion
, so it knows that it doesn’t have to install that version of Legato into /mnt/flash/legato
. This ensures that your new updated version of Legato doesn’t get replaced with whatever is in /mnt/legato
on reboot.
If you were to now replace /mnt/legato
with a different Legato system and reboot, the start
program would see that /mnt/legato/system/version
is different than /mnt/flash/legato/mntLegatoVersion
and know that it has to install that new Legato system from /mnt/legato
(finishing that by copying /mnt/legato/system/version
to /mnt/flash/legato/mntLegatoVersion
).
The problem you’re running into is that you’ve replaced /mnt/legato
with exactly the same image you had in there before. So, when the start
program runs, it sees that /mnt/legato/system/version
is the same as /mnt/flash/legato/mntLegatoVersion
, and it ignores /mnt/legato
, keeping your “current” system at your 17.06-based version.
If you delete /mnt/flash/legato/mntLegatoVersion
(or change it in any way, really) and reboot, the start
program will see a mismatch between /mnt/legato/system/version
and /mnt/flash/legato/mntLegatoVersion
and will install the system from /mnt/legato
(copying over configuration settings and other writeable files for apps that have not been removed between versions).
Of course, if you delete everything under /mnt/flash/legato
, then this will be an even cleaner reset back to the old “factory” state, because any persistent app-specific settings will also be removed. But, don’t delete everything under /mnt/flash
, because you could wipe out some other factory settings unrelated to Legato.
I hope this demystifies this a bit for you.
Cheers,
–Jen