retitle 788364 diffoscope: garbled output when comparing some Coreboot images
clone 788364 -1
reassign -1 libmagic1
severity -1 libmagic1 normal
retitle -1 libmagic1: misdetect Coreboot images as text files

Hi Christoph,

diffoscope is the tool that we have created as part of the “reproducible
builds” effort to understand differences between two builds. We now also
use it to compare builds of Coreboot images.

diffoscope uses libmagic (through its Python bindings) to identify the
format of the files its trying to compare. Some coreboot images are
misdetected as text files which results in garbled diffoscope output.

Proper way to detect Coreboot images is probably to look for a CBFS
header. cbfs_find_header() is how upstream does it:;a=blob;f=util/cbfstool/cbfs_image.c;h=c40bd6641

I could tell diffoscope to detect Coreboot images with a similar
mechanism but it would probably be better to teach libmagic to do it.
Is that easily doable?

Reiner Herrmann:
> file detects them as plain-text:
> > /tmp/b1_coreboot.rom: ISO-8859 text, with very long lines, with no line 
> > terminators
> > /tmp/b2_coreboot.rom: ISO-8859 text, with very long lines, with no line 
> > terminators
> That's why diffoscope also treats them as text.
> I'm not sure this can/should be fixed inside diffoscope, as we rely on
> libmagic detecting them correctly.

Reiner, I remember you had a look into this during DebConf. Have you
made any progress?

Lunar                                .''`.                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 

Attachment: signature.asc
Description: Digital signature

Reproducible-builds mailing list

Reply via email to