Firmware upgrade supports XZ compressed image
jasaw opened this issue · 4 comments
Current GZ disk images are around 70MB each for Raspberry Pis. When upgrading firmware, most of the time is spent downloading the disk image.
Using XZ compression, the same image can be compressed down to 45MB.
Example compression command:
XZ_OPT=-9 tar cJf motioneyeos-raspberrypi.tar.xz motioneyeos-raspberrypi.img
I don't know how much memory is required and how long it takes to extract an XZ file, but it may be a feasible option. If memory and CPU does become a concern, motionEye can always kill off motion software before starting the extract and upgrade process (not sure if it's already doing this).
@ccrisan Have you tested fwupdate with XZ compressed image? Alright to close this issue?
@jasaw yes, I did and things work well (after I changed the firmware listing helpers to deal well with .xz files). In theory we could do the next (motionEyeOS) release using .xz files; at least that's my plan.
@ccrisan I just noticed after a successful fwupdate, firmware.img[.xz|.gz] files in /data/.fwupdate are not deleted. The two files combined take up to 300 MB. Is this intentional?
It is somewhat intentional. I mean I never thought to remove it (them) after the upgrade. I guess there's no harm in removing them from the initramfs image, after a successful upgrade.