We were playing on IRC with a way to write the backup file directly out alongside the root file system for block devices, similar to the way that it happens with 'mtd write -j sysupgrade.tgz'.
A lot of devices currently put it in a FAT "recovery" partition but it's not clear that will always be big enough for large backups. Doing this in platform_copy_config() seems to work... RAMFS_COPY_BIN="mount_root ln mkfs.f2fs" platform_copy_config() { rmdir /tmp/overlay # Or mount_root bails out mkdir -p /rom mount $rootdev /rom PREINIT=1 mount_root # 'mount_root done', if it worked, would just do this ln -sf 2 /overlay/.fs_state cp -af "$UPGRADE_BACKUP" "/$BACKUP_FILE" sync # We should unmount it properly echo done We got that working but I'm slightly reticent about it — it limits the things we can change from one version of OpenWrt to the next... and indeed to all future versions. After all, we don't *know* that OpenWrt 21.xx will still be using f2fs for its overlay, and we'd be making that part of the defined ABI for sysupgrade. Instead of using the overlay filesystem du jour, perhaps it makes more sense to simply put the tarball itself, raw, on the loop device immediately after the end of the squashfs? Or if the rootfs is a writeable file system, then we write it directly to the root of the new file system just like 'mtd -j' does?
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel