Analysing differences in images produced with mkimg and makefs

Chris Lamb chris at reproducible-builds.org
Wed Dec 8 01:21:03 UTC 2021


Hi Fabian,

>>   $ virt-list-filesystems FreeBSD-12.3-STABLE-amd64-20211125-r371091-mini-memstick.img
>>   list_filesystems: sfdisk exited with status 1: sfdisk: /dev/sda: partition 5: partition table contains only 4 partitions at /usr/bin/virt-list-filesystems line 166.
[..]
> I suspect that virt-list-partitions gets the "partition" count wrong.
>
> According to gpart the images only have two "slices":
>
> [fk at elektrobier3 ~/scratch/freebsd-12.3]$ sudo mdconfig -o readonly -f 
> FreeBSD-12.3-STABLE-amd64-20211125-r371091-mini-memstick.img 
> md0
> [fk at elektrobier3 ~/scratch/freebsd-12.3]$ gpart show md0
> =>     1  805200  md0  MBR  (393M)
>        1    1600    1  efi  (800K)
>     1601  803600    2  freebsd  [active]  (392M)
>
> [fk at elektrobier3 ~/scratch/freebsd-12.3]$ ls -l /dev/md0*
> crw-r-----  1 root  operator  0x32c 2021-12-07 08:53:21 /dev/md0
> crw-r-----  1 root  operator  0x330 2021-12-07 08:53:21 /dev/md0s1
> crw-r-----  1 root  operator  0x332 2021-12-07 08:53:21 /dev/md0s2
> crw-r-----  1 root  operator  0x337 2021-12-07 08:53:21 /dev/md0s2a
>
> Apparently the memstick images used to have partitions in the past
> but in 2018 the creation process got changed and now they have slices.
>
> Apparently I had to adjust image-checksum.sh back then:
> <https://www.fabiankeil.de/sourcecode/electrobsd/ElectroBSD-20211130-817fe7d130ce/0223-image-checksum.sh-Adjust-to-deal-with-slices-instead-.diff>
>
> The following FreeBSD commit seems relevant:
> <https://svnweb.freebsd.org/base?view=revision&revision=334337>
>
> I suspect the images now contain some "compatibility goo" so
> old BIOSes are able to boot from them and it seems conceivable
> that the guestfs tools behave similar to an old BIOS and thus
> don't "see" the real disk layout.

>From some experience when doing other ISO/USB stick stuff in the past,
your "compatibility goo" theory around slices vs partitions sounds
more than credible.

Unfortunately, though, partition and booting blah is not quite my
technical area. I wonder what the next best step is here: getting in
touch with the libguestfs folks?


Best wishes,

-- 
      o
    ⬋   ⬊      Chris Lamb
   o     o     reproducible-builds.org 💠
    ⬊   ⬋
      o


More information about the rb-general mailing list