bug-xorriso
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-xorriso] [bug #46716] Protective MBR partition is not marked as


From: Alexander E. Patrakov
Subject: Re: [Bug-xorriso] [bug #46716] Protective MBR partition is not marked as bootable
Date: Sat, 19 Dec 2015 19:09:50 +0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

19.12.2015 17:49, Andrei Borzenkov пишет:
19.12.2015 14:37, Alexander E. Patrakov пишет:

Some old BIOSes (including the one in Intel DG965SS desktop board) refuse to
treat a USB drive as bootable if it has no bootable MBR partitions. This
applies to all iso images that are created by grub-mkrescue and written to a
USB flash drive with dd.


It is not clear - do you attempt to boot in legacy BIOS or EFI mode?

Changing the byte at offset 0x1be to 0x80 in the resulting iso makes it
bootable on such boards.

Images produced by xorriso with isolinux as recommended at
http://www.syslinux.org/wiki/index.php/Isohybrid do have 0x80 at offset 0x1be,
so I think it is a bug in GRUB, not in xorriso.


Command from syslinux wiki does not create protective MBR; it creates
normal DOS partition of type 17 and marks it as bootable.

OK, I see.

If you use grub-mkrescue to create ISO for a single i386-pc platform (or
may be for any not including EFI, I have not tried it) it also creates
single partition that is marked as bootable. Did you test if it works
for you?

I use grub-mkrescue, and expect the resulting ISO to boot in the following scenarios:

1. From CD, on BIOS-based boards.
2. From CD, on UEFI-based boards.
3. From USB flash, on BIOS-based boards that don't check whether there are any bootable MBR partitions. 4. From USB flash, on BIOS-based boards that do check whether there are any bootable MBR partitions (such as DG965SS). 5. From USB flash, on UEFI boards that don't check that the partition with type 0xee is not bootable. 6. From USB flash, on UEFI boards that do check that the partition with type 0xee is not bootable (such as everything based on Tiano Core).

Currently, case 4 fails. With the modification proposed in https://savannah.gnu.org/bugs/?46716 , case 6 fails.


Marking protective partition as bootable may trigger bugs on EFI, so I
am not sure if it is reallu desirable.

You are right, because of Tiano Core. My point is, if we use a classical protective MBR that contains exactly one partition of type 0xee, then cases 4 and 6 are incompatible, and both cases exist in the wild.

So here is an alternative proposal. I was able to fix up the iso by creating a second partition of the same geometry, of type 0, and with bootable flag on. Here is now:

dd if=output.iso of=output.iso conv=notrunc bs=1 count=16 skip=446 seek=462
printf '\200' | dd of=output.iso conv=notrunc bs=1 seek=462
printf '\0' | dd of=output.iso conv=notrunc bs=1 seek=466

The resulting iso, unlike the original one, boots from USB drive on DG965SS (in BIOS mode), and also boots in KVM with OVMF (in UEFI mode).

Maybe other schemes with Hybrid MBR will also work. So far, I know of the following checks performed by various BIOSes and UEFIs:

1. The partition with type 0xee should start at sector 1 and be non-bootable, otherwise the GPT is treated as invalid.
2. There should be no overlap between partitions of type != 0.
3. There should be a bootable partition in the MBR.


In any case MBR is created by xorriso, so I Cc it there.


Thanks!

--
Alexander E. Patrakov



reply via email to

[Prev in Thread] Current Thread [Next in Thread]