Comment 63 for bug 1899308

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 1899308] Re: failure to boot groovy daily (again)

On Thu, Oct 15, 2020 at 05:31:08PM -0000, Thomas Schmitt wrote:

> > sfdisk --no-reread -q $DEVICE -A 1 -X dos || true

> If this attributes the boot flag to the first partion of type EE, then
> this is a semi-violation of EFI specs and known to be punished by some
> firmwares. UEFI 2.8 says:
>
> "Table 20. Protective MBR Partition Record protecting the entire disk
> BootIndicator 0 1 Set to 0x00 to indicate a non-bootable partition
> [...]
> Must be ignored by UEFI implementations."
>
> It turned out back in 2015 that some EFIs interpret the latter statement
> as instruction to ignore the device if BootIndicator is present in the
> only existing partition. That's why --mbr-force-bootable was invented to
> mark a nearly non-existent partition as bootable.
>
> The changelog description is wrong in these aspects:
>
> > "If our partition table is GPT, we *may* have a protective MBR;"
>
> We *must* have a protective MBR to have a valid GPT.
>
> > "we mark the iso9660 partition as bootable"
>
> The ISO 9660 partition is number 1 in the GPT. Partition 1 in MBR is not
> mountable as ISO 9660 because it starts at LBA 1. 0 or 64 would be ok for
> mounting, but then it would not mark a valid GPT any more.
>
> -----------------------------------------------------------------------
>
> Casper needs to bring these bytes (decimal) into bytes 462 to 477 of
> the ISO image (i.e. the MBR):
>
> 128 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0
>
> With bash i could do this by help of dd if=/dev/zero and echo -n $'\x80'
> $'\x01'. But with dash ...

This works under dash (and bash):

echo -n '\0200\00\01\00\00\00\01\00\00\00\00\00\01\00\00\00' | dd of="$DEVICE" bs=1 seek=462 conv=notrunc

I'll switch to using that.

Thanks,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer https://www.debian.org/
<email address hidden> <email address hidden>