[WP7702] Recovery Mechanisms

Hi,

I have a system that tends to reboot a lot:

After some time the recovery mechanism is activated and we lose all our applications
For our application, it looks like we can embed them in the legato.cwe .

But we also lose our files in the /home directory.
The datasheet is not very clear on the effect of the recovery mode.

Is there a command that protects the files from the recovery mechanism or is there a directory that is unaffected by the recovery mechanism?

Thank,
Jérémy

I have done a test to see if a text file in /home/root will be lost after rollback, but i cannot reproduce your issue.
Can you double confirm if your lost file is due to system rollback?

root@swi-mdm9x28-wp:~# ls /home/root/
123.txt
root@swi-mdm9x28-wp:~# legato status
Systems installed:
  6 [good]
  17 [tried 4] <-- current
Legato framework is running.
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# cm info
Device:                        WP7608
IMEI:                          352913090501857
IMEISV:                        6
FSN:                           XG207430721010
Firmware Version:              SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
Bootloader Version:            SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
MCU Version:                   002.011
PRI Part Number (PN):          9908665
PRI Revision:                  001.004
Carrier PRI Name:              GENERIC
Carrier PRI Revision:          002.068_003
SKU:                           1104194
Last Reset Cause:              Reset, User Requested
Resets Count:                  Expected: 13     Unexpected: 0
root@swi-mdm9x28-wp:~# legato version
19.02.0_4cb954265427b8c2c668a010ff5be274_modified
root@swi-mdm9x28-wp:~#




//here I reset the board





//the text file is still here
root@swi-mdm9x28-wp:~# ls /home/root/
123.txt
//system rollback and the legato app disappeared.
root@swi-mdm9x28-wp:~# legato status
Systems installed:
  6 [good] <-- current
Legato framework is running.

Hi,

I don’t lose a file when I do a reset (command or button or switch) but I lose my file when the system got corrupted (when I reboot a lot I guess)

Like in this case:

I think that to much reboot can create a file system corruption and activate the recovery mechanism that install a backup.

and when this happened my apps disappear and home directory is empty just with home directory /root

The system is in the same state as when the Mangoh was new and I had used WP77xx_Release14.1_SIERRA.exe or mangOH-yellow-wp77xx_0.7.0.exe to update the board.

Jérémy

does this help by using the “reserved” partition?


root@swi-mdm9x28-wp:~#  more /proc/mtd
dev:    size   erasesize  name
mtd0: 00280000 00040000 "sbl"
mtd1: 00280000 00040000 "mibib"
mtd2: 00680000 00040000 "backup"
mtd3: 00100000 00040000 "security"
mtd4: 00200000 00040000 "persist"
mtd5: 01180000 00040000 "efs2"
mtd6: 04f40000 00040000 "swifota"
mtd7: 00180000 00040000 "tz"
mtd8: 000c0000 00040000 "devcfg"
mtd9: 000c0000 00040000 "rpm"
mtd10: 02000000 00040000 "modem"
mtd11: 00100000 00040000 "aboot"
mtd12: 00f00000 00040000 "boot"
mtd13: 01e00000 00040000 "system"
mtd14: 008c0000 00040000 "lefwkro"
mtd15: 01900000 00040000 "swirw"
mtd16: 08300000 00040000 "userapp"
mtd17: 03680000 00040000 "reserved"
mtd18: 02180000 00040000 "slot_2"
mtd19: 02180000 00040000 "slot_1"
mtd20: 02180000 00040000 "slot_0"
root@swi-mdm9x28-wp:~# ubiformat /dev/mtd17 -y
ubiformat: mtd17 (nand), size 57147392 bytes (54.5 MiB), 218 eraseblocks of 262144 bytes (256.0 KiB), min. I/O size 4096 bytes
libscan: scanning eraseblock 217 -- 100 % complete
ubiformat: 218 eraseblocks are supposedly empty
ubiformat: formatting eraseblock 217 -- 100 % complete
root@swi-mdm9x28-wp:~# ls /dev/ubi*
/dev/ubi0         /dev/ubi1_0       /dev/ubi4         /dev/ubiblock1_0
/dev/ubi0_0       /dev/ubi2         /dev/ubi4_0       /dev/ubiblock2_0
/dev/ubi0_1       /dev/ubi2_0       /dev/ubi_ctrl
/dev/ubi0_2       /dev/ubi3         /dev/ubiblock0_0
/dev/ubi1         /dev/ubi3_0       /dev/ubiblock0_1
root@swi-mdm9x28-wp:~# ls /dev/ubi* -l
crw-rw----    1 root     root      238,   0 Jan  1  1970 /dev/ubi0
crw-rw----    1 root     root      238,   1 Jan  1  1970 /dev/ubi0_0
crw-rw----    1 root     root      238,   2 Jan  1  1970 /dev/ubi0_1
crw-rw----    1 root     root      238,   3 Jan  1  1970 /dev/ubi0_2
crw-rw----    1 root     root      234,   0 Jan  1  1970 /dev/ubi1
crw-rw----    1 root     root      234,   1 Jan  1  1970 /dev/ubi1_0
crw-rw----    1 root     root      236,   0 Jan  1  1970 /dev/ubi2
crw-rw----    1 root     root      236,   1 Jan  1  1970 /dev/ubi2_0
crw-rw----    1 root     root      237,   0 Jan  1  1970 /dev/ubi3
crw-rw----    1 root     root      237,   1 Jan  1  1970 /dev/ubi3_0
crw-rw----    1 root     root      235,   0 Jan  1  1970 /dev/ubi4
crw-rw----    1 root     root      235,   1 Jan  1  1970 /dev/ubi4_0
crw-rw----    1 root     root       10,  57 Jan  1  1970 /dev/ubi_ctrl
brw-rw----    1 root     root      253,   0 Jan  1  1970 /dev/ubiblock0_0
brw-rw----    1 root     root      253,   1 Jan  1  1970 /dev/ubiblock0_1
brw-rw----    1 root     root      253,   3 Jan  1  1970 /dev/ubiblock1_0
brw-rw----    1 root     root      253,   2 Jan  1  1970 /dev/ubiblock2_0
root@swi-mdm9x28-wp:~# ubiattach -m 17 -d 7
UBI device number 7, total 218 LEBs (55361536 bytes, 52.7 MiB), available 174 LEBs (44187648 bytes, 42.1 MiB), LEB size 253952 bytes (248.0 KiB)
root@swi-mdm9x28-wp:~# ubimkvol /dev/ubi7 -N test -s 42MiB
Volume ID 0, size 174 LEBs (44187648 bytes, 42.1 MiB), LEB size 253952 bytes (248.0 KiB), dynamic, name "test", alignment 1
root@swi-mdm9x28-wp:~# mkdir -p /tmp/customer
root@swi-mdm9x28-wp:~# mount -t ubifs /dev/ubi7_0 /tmp/customer
root@swi-mdm9x28-wp:~# ls /tmp/customer/
root@swi-mdm9x28-wp:~# echo safsdfasdf > /tmp/customer/test.txt
root@swi-mdm9x28-wp:~# cm info
Device:                        WP7608
IMEI:                          352913090501857
IMEISV:                        6
FSN:                           XG207430721010
Firmware Version:              SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
Bootloader Version:            SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
MCU Version:                   002.011
PRI Part Number (PN):          9908665
PRI Revision:                  001.004
Carrier PRI Name:              GENERIC
Carrier PRI Revision:          002.068_003
SKU:                           1104194
Last Reset Cause:              Power Down
Resets Count:                  Expected: 15     Unexpected: 0
root@swi-mdm9x28-wp:~# cat /tmp/customer/test.txt
safsdfasdf






// power cycle the device


root@swi-mdm9x28-wp:~# mkdir -p /tmp/customer
root@swi-mdm9x28-wp:~# ubiattach -m 17 -d 7
UBI device number 7, total 218 LEBs (55361536 bytes, 52.7 MiB), available 0 LEBs (0 bytes), LEB size 253952 bytes (248.0 KiB)
root@swi-mdm9x28-wp:~# mount -t ubifs /dev/ubi7_0 /tmp/customer
root@swi-mdm9x28-wp:~# cat /tmp/customer/test.txt
safsdfasdf
root@swi-mdm9x28-wp:~#

Hi,

This could be a good solution.
I will try.

Jeremy

You can also see here to split the userapp partition or system partition: