[WP7702] Recovery Mechanisms

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:~#