Hi all,
I have a UBIFS root file system using an image created via Yocto recipes with the Digi Embedded Yocto minimal (non-graphical) build as a starting point.
As part of a firmware update procedure, I’d like to be able to update the root file system from within Linux using the update_flash utility. Ideally, this can be done in place.
This seems to work fine if I uses a JFFS2 root file system, viz.
CCARDIMX28 # flpart
Nr | Name | Start | Size | Type | FS | Flags
0 | Bstrm-U-Boot | 0 | 3 MiB | Bootstream | | fixed
1 | NVRAM | 3 MiB | 512 KiB | NVRAM | | fixed
2 | FDT | 3584 KiB | 512 KiB | Device Tree | |
3 | Kernel | 4 MiB | 5 MiB | Linux/Android-Kernel | |
4 | RootFS | 9 MiB | 50 MiB | Filesystem | JFFS2 | mounted readonly rootfs
5 | Kernel-s | 59 MiB | 5 MiB | Linux/Android-Kernel | |
6 | RootFS-s | 64 MiB | 50 MiB | Filesystem | UBIFS | mounted readonly rootfs
7 | UserFS | 114 MiB | 14 MiB | Filesystem | JFFS2 |
root@ccardimx28js:~# update_flash /dev/dey-image-minimal-ccardimx28js-20150923215237.128.rootfs.jffs2.sum 4
Partition 4 is NAND ()
Full Size: 51200 KiB
Good Size: 51200 KiB
— JFFS2 partition 4 will be fully erased
Verifying File(s): /dev/dey-image-minimal-ccardimx28js-20150923215237.128.rootfs.jffs2.sum
!!! Remounting /
Updating:
/dev/dey-image-minimal-ccardimx28js-20150923215237.128.rootfs.jffs2.sum (27483 KiB)
Erasing: complete
Flashing: complete
CRC32: 0x25be97fe
Done
However, with UBIFS, I get errors about needing to detach the UBI volume. I cannot detach the volume to proceed as I get errors about the device being busy.
CARDIMX28 # flpart
Nr | Name | Start | Size | Type | FS | Flags
0 | Bstrm-U-Boot | 0 | 3 MiB | Bootstream | | fixed
1 | NVRAM | 3 MiB | 512 KiB | NVRAM | | fixed
2 | FDT | 3584 KiB | 512 KiB | Device Tree | |
3 | Kernel | 4 MiB | 5 MiB | Linux/Android-Kernel | |
4 | RootFS | 9 MiB | 50 MiB | Filesystem | UBIFS | mounted readonly rootfs
5 | Kernel-s | 59 MiB | 5 MiB | Linux/Android-Kernel | |
6 | RootFS-s | 64 MiB | 50 MiB | Filesystem | UBIFS | mounted readonly rootfs
7 | UserFS | 114 MiB | 14 MiB | Filesystem | JFFS2 |
t@ccardimx28js:~# update_flash /dev/dey-image-minimal-ccardimx28js-20150923215237.128.rootfs.ubifs 4
Partition 4 is NAND ()
Full Size: 51200 KiB
Good Size: 51200 KiB
Verifying File(s): /dev/dey-image-minimal-ccardimx28js-20150923215237.128.rootfs.ubifs
Updating:
/dev/dey-image-minimal-ccardimx28js-20150923215237.128.rootfs.ubifs (31496 KiB)
Flashing: FAILED! (ubiformat: error!: please, first detach mtd4 (/dev/mtd4) from ubi0)
Is there any procedure available to do this with a UBIFS rootfs? I don’t want to have to do things in uboot nor to make my firmware update state-machine more complex, i.e. I’d like to be able to run update_flash “in place” as I can do with a JFFS2 filesystem.
Thanks in advance.