I have a device with rootfs mounted readonly and with an overlay on top of it to do the factory reset.
There's A/B partitioning. So there is a duplicate set of partitions.
There's an OTA engine to deploy atomics images.
I have the following usecase: 1. I flash a minimal image 2. I write the device type into a file (mutiple variant but same HW setup) to a persistent data partition. 3. I deploy the common product image via OTA engine. The whole rootfs is deployed atomically 4. I copy the current overlay partition content to the next overlay partition 5. Reboot 6. System boots to the next slot to the common product image
Currently, the common product image is the minimal image with the addition of this test-deployment package: