On 5.01.2022 23:16, Rafał Miłecki wrote:
From: Rafał Miłecki <ra...@milecki.pl>

1. Create "rootfs_data" dynamicaly

U-Boot firmware images can contain only kernel and rootfs volume
(squashfs in case of OpenWrt). There is no way to include "rootfs_data"
UBI volume or make firmware file tell U-Boot to create one.

For that reason "rootfs_data" needs to be created dynamically. Use
preinit script to handle that. Fire it right before "mount_root" one.

2. Relate "rootfs_data" to flashed firmware

As already explained flashing new firmware with U-Boot will do nothing
to the "rootfs_data". It could result in new firmware reusing old
overlay UBI volume and its file. Users expect a clean state after
flashing firmware (even if flashing the same one).

Solve that by reading flash counter of running firmware and storing it
in "rootfs_data" UBI volume. Every mismatch will result in wiping old
data.

Signed-off-by: Rafał Miłecki <ra...@milecki.pl>

Pushed cleaned up version with sysupgrade support:

93259e8ca261 ("bcm4908: support "rootfs_data" on U-Boot devices master")


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to