[Reproducible-builds] Bug#788364: libmagic1: misdetect some Coreboot images as text

Jérémy Bobbio lunar at debian.org
Thu Sep 3 14:26:57 UTC 2015


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
thanks

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:
http://review.coreboot.org/gitweb?p=coreboot.git;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                                .''`. 
lunar at debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20150903/e376c732/attachment.sig>


More information about the Reproducible-builds mailing list