coreos-assembler icon indicating copy to clipboard operation
coreos-assembler copied to clipboard

Support diffing metal images with cosa

Open jbtrystram opened this issue 5 months ago • 4 comments

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

jbtrystram avatar Jul 15 '25 14:07 jbtrystram

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 /sysroot content (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.

jlebon avatar Jul 15 '25 16:07 jlebon

Add a --metal to cosa 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.

dustymabe avatar Jul 15 '25 18:07 dustymabe

Unfortunately I saw your comments only today, after merging #4226 I'll try to apply these great suggestions in a follow-up PR :)

jbtrystram avatar Jul 22 '25 09:07 jbtrystram

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

jbtrystram avatar Jul 22 '25 13:07 jbtrystram