bug-xorriso
[Top][All Lists]
Advanced

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

Re: [Bug-xorriso] Test Proposal for [bug #46716] Protective MBR partitio


From: Alexander E. Patrakov
Subject: Re: [Bug-xorriso] Test Proposal for [bug #46716] Protective MBR partition is not marked as bootable
Date: Mon, 21 Dec 2015 23:14:16 +0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

21.12.2015 22:37, Thomas Schmitt пишет:
Hi,

first a helper in case repacking goes on with other ISOs.
To obtain the value for --modification-date= , do:

   $ xorriso -indev minimal-grub2.iso -pvd_info 2>/dev/null | \
       grep '^Modif\. Time  :' | sed -e 's/^Modif. Time  : //'
   2015121916023100


https://goo.gl/photos/GRS5khE8r7Xgat9L8

A dedicated user of Apple electronics. :))
Do i get the USB symbol right that the image was presented on USB stick ?

I wonder how the machine came to "Windows".
This might be the HFS+ filesystem advertised by APM partition 2.

The first "EFI Boot" is possibly the MBR partition 1, which
your patching advertises as bootable but isn't by HDD habits.
But i wonder from where that "grub rescue>" started.
Maybe the Apple EFI offers the El Torito boot image /efi.img here
which contains GRUB2.

The second "EFI Boot" is probably MBR partition 2 of type 0xef.

Maybe.

Since then, I have produced two other images:

First = http://82.193.153.141/minimal-grub2-repacked-nohfsplus.iso

Contains MBR only. Produced with:

xorriso -as mkisofs \
-o minimal-grub2-repacked-nohfsplus.iso \
-r --modification-date=2015121916023100 \
-b /boot/grub/i386-pc/eltorito.img -no-emul-boot -boot-load-size 4 -boot-info-table \
--grub2-boot-info --grub2-mbr /usr/lib/grub/i386-pc/boot_hybrid.img \
-c '/boot.catalog' \
-eltorito-alt-boot \
-e '/efi.img' \
-no-emul-boot \
-append_partition 2 0xef /mnt/iso/efi.img \
--sort-weight 0 / --sort-weight 1 /boot \
/mnt/iso

...plus manual patching to mark the non-efi partition as bootable.

Result: "Windows" + "EFI Boot", both entries work on Mac 2012.



Second = http://82.193.153.141/minimal-grub2-repacked-nohfsplus-v2.iso

Contains hacked MBR and GPT. Produced with:

xorriso -as mkisofs \
-o minimal-grub2-repacked-nohfsplus-v2.iso \
-r --modification-date=2015121916023100 \
-b /boot/grub/i386-pc/eltorito.img -no-emul-boot -boot-load-size 4 -boot-info-table \
--grub2-boot-info --grub2-mbr /usr/lib/grub/i386-pc/boot_hybrid.img \
-c '/boot.catalog' \
-eltorito-alt-boot \
--efi-boot '/efi.img' -efi-boot-part --efi-boot-image \
--protective-msdos-label \
--sort-weight 0 / --sort-weight 1 /boot \
/mnt/iso

...plus manual patching to create a "bootable" MBR partition of type 0 (for DG965SS).

Result: only "EFI Boot" is shown on Mac 2012. So, for eliminating any potential confusion that could result from multiple boot entries for the same USB stick, my approach may be better.

Still no luck with the 2007 Mac.



OK, the 2007 Mac does not recognize any of the isos below.
http://82.193.153.141/minimal.iso

That's still the original one from grub-mkrescue, i assume.


The 2012 Mac shows two working "EFI Boot" options on this ISO:
http://82.193.153.141/minimal-grub2-repacked-fdisked.iso

Seems to like type 0x00 and start LBA 1 better than 0x83 and LBA 0.
One should try which of the two differences does the trick.

But still not clear what GRUB2 is started by that first "EFI Boot"
offer. Obviously it gets confused by the mountable partition 1
of type 0x83.

To let the partition 1 start at LBA 1 even if no -hfsplus is given,
add option  --protective-msdos-label  to your repack run.


Oh ... without -hfsplus this keeps you from the plight of patching.
Directly out of xorriso:

   MBR partition table:   N Status  Type        Start       Blocks
   MBR partition      :   1   0x80  0xcd            1        31619
   MBR partition      :   2   0x00  0xef        31620         5760

Because --protective-msdos-label is an option meant for GRUB2
and no GPT is present (or suspected), this produces partition 1
in GRUB2 BIOS-only style. With boot flag.

The command was

   xorriso-1.3.2 -as mkisofs \
      -o /dvdbuffer/minimal-grub2-repacked.iso \
      -r \
      --modification-date='2015121916023100' \
      --grub2-mbr /dvdbuffer/minimal-grub2.mbr \
      -c '/boot.catalog' \
      -b '/boot/grub/i386-pc/eltorito.img' \
         -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info \
      -eltorito-alt-boot \
      -e '/efi.img' \
         -no-emul-boot \
      -append_partition 2 0xef /mnt/iso/efi.img \
      -no-pad \
      --protective-msdos-label \
      /mnt/iso

Tested, this is similar to minimal-grub2-repacked-nohfsplus.iso, which has:

MBR partition table:   N Status  Type        Start       Blocks
MBR partition      :   1   0x80  0x83            0        32220
MBR partition      :   2   0x00  0xef        32220         5760

"Directly out of xorriso" is indeed an advantage.

--
Alexander E. Patrakov



reply via email to

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