Support diffing metal images with cosa
Add a --metal to cosa diff to look at the metal artifacts when diffing.
This will help with the bootc install --to-filesystem transition
Suggested by @jlebon
So two things worth diffing here:
- partition table, e.g. the output of
sfdisk --dump $file? As--metal-gpt. - "untracked files", i.e. files outside of the pure ostree deployment checkout, notably content in
/bootand immediate/sysrootcontent (like the aleph JSON). Maybe to follow the same convention, as--metal-ls(for just ls output diffing) and--metal(for full content diffing).
For that second one, I would probably just e.g. use libguestfs to mount the images for ls and git diff. It'll also diff over ostree content, but the expectation anyway with cosa diff is that you built the exact same content set so those should mostly cancel out.
Add a
--metaltocosa diff
Just in case we want to add more artifacts in the future, maybe the option should be --artifact and accept a value. i.e. initially --artifact=metal would be the only thing we would implement and anything else would error as not implemented, but it paves the way for future additions if we desire.
Unfortunately I saw your comments only today, after merging #4226 I'll try to apply these great suggestions in a follow-up PR :)
Allright look like my cosa diff --metal implementation is flawed as we found this with @jlebon :
[osbuild] cat zzz/ostree/deploy/fedora-coreos/deploy/80a0826445177b95bd24ed30a7ddb32bbec237fcb91565abaf8f8afccba3e6c9.0/etc/fstab
UUID=96d15588-3596-4b3c-adca-a2ff7279ea63 /boot auto ro 0 0