I'm trying to conceive a firmware update mechanism for a Linux-based embedded system without an additional initrd/initramfs/whatever. From within the running system, which has a read-only mounted root, I use dd to copy the new root image (residing on a secondary data partition).
The problem is that half of the times I end up with a corrupted root filesystem. I don't get why this is happening, knowing that the partition is read-only and that I do a sync right before rebooting (I reboot by writing 'b' to /proc/sysrq-trigger). Someone please enlighten me.