So first, 'Debian' is not a reasonable fallback on Ubuntu. The fallback should be Ubuntu.
And second, the lsb-release package is not guaranteed to be installed whenever grub-install is called, because grub2-common does not depend on it. It's part of the minimal seed, but the buildd images don't use the minimal seed; they subset it.
Rather than depending on lsb-release, however, we should just change this to use the not-deprecated /etc/os-release interface, e.g.:
The path on the ESP is constructed from GRUB_DISTRIBUTOR, which in /etc/default/grub is set to:
GRUB_DISTRIBUTO R=`lsb_ release -i -s 2> /dev/null || echo Debian`
So first, 'Debian' is not a reasonable fallback on Ubuntu. The fallback should be Ubuntu.
And second, the lsb-release package is not guaranteed to be installed whenever grub-install is called, because grub2-common does not depend on it. It's part of the minimal seed, but the buildd images don't use the minimal seed; they subset it.
Rather than depending on lsb-release, however, we should just change this to use the not-deprecated /etc/os-release interface, e.g.:
GRUB_DISTRIBUTOR=`. /etc/os-release && echo $NAME || echo Ubuntu`