#1138611 grub2: reproducible builds: debian/platform-subst uses non-deterministic readdir

Package:
src:grub2
Source:
src:grub2
Submitter:
Vagrant Cascadian
Date:
2026-06-01 05:33:02 UTC
Severity:
normal
Tags:
#1138611#5
Date:
2026-06-01 05:30:34 UTC
From:
To:
The debian/platform-subst script used to generate .postinst for grub-xen
uses readdir to determine which platform to embed. The directory
ordering may not be deterministic, and can result in differences between
the resulting .postinst script. (/boot/grub/i386-xen_pvh/core.img
vs. /boot/grub/i386-xen/core.img):

https://reproduce.debian.net/amd64/api/v1/builds/153376/artifacts/383901/diffoscope

The attached patch sorts the list of platforms before picking the first
one, so it can at least pick consistently. Perhaps there is a more
elegant way to pull this off, but I believe this ought to work. :)

live well,
  vagrant