bug-grub
[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 17:51:24 +0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

20.12.2015 19:57, Alexander E. Patrakov пишет:
20.12.2015 19:07, Thomas Schmitt пишет:
Hi,

xorriso wrote under my insufficient control:
    MBR partition      :   1   0x80  0xee            1        32803

Alexander E. Patrakov wrote:
OK, this is the bug. You have a 0xee partition, that indicates that GPT

Yep. Looks like a xorriso bug.
(How could this slip through when i looked at it ?)

-----------------------------------------------------------------
The presence of HFS+ lets it expect GPT and thus causes type 0xee
for the first partition.
Else it would have put out 0x83 or 0xcd.
Poorly tested in other situations because grub-mkrescue is my
only HFS+ user and is eager to really produce GPT.
-----------------------------------------------------------------

I was too lazy to check again after i added the -hfsplus options
in the second mail.
I now tested that my first proposal would have worked with OVMF
and would then have failed if HFS+ had been produced in later runs.
In that first mail of today, the resulting partition type was 0x83.

Shall i count this as good luck or as bad luck ?





A pebkac error was to omit xorriso command -hfsplus "on"
before letting the option proposer work.

   $ xorriso -hfsplus on -indev minimal-grub2.iso \
             -report_el_torito as_mkisofs

correctly proposes

   -hfsplus-file-creator-type chrp tbxj
'/System/Library/CoreServices/.disk_label'
   -hfs-bless-by intel_bootfile '/System/Library/CoreServices/boot.efi'

Please add these options if you make further tests with
option -hfsplus enabled.
(Patching for now: boot flag in partition 1, type 0x83 in partition 1.)

I will be too far from the Intel DG965SS board for the rest of the day,
so please expect the test results tomorrow. Sorry!

I have tested this:

xorriso -as mkisofs \
-o minimal-grub2-repacked.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 \
-hfsplus -apm-block-size 2048 \
-c '/boot.catalog' \
-hfsplus-file-creator-type chrp tbxj \
/System/Library/CoreServices/.disk_label \
-hfs-bless-by i /System/Library/CoreServices/boot.efi \
-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

...of course followed by editing the partition table by hand. It passes all my tests in qemu, uses no "hybrid MBR" hack, has no GPT, no overlapping partitions, boots on DG965SS from USB flash, and even behaves sensibly when looked at by udisks2. GRUB can also read files from apple partition 3 as hfsplus. From my viewpoint, that's a perfect result, but it would be even better if someone with a real Intel-based Mac also looked at it.

Download: http://82.193.153.141/minimal-grub2-repacked-v2.iso

The xorriso report is below:

$ xorriso -indev minimal-grub2-repacked-v2.iso -report_system_area plain -report_el_torito plain
xorriso 1.4.2 : RockRidge filesystem manipulator, libburnia project.

xorriso : NOTE : Loading ISO image tree from LBA 0
xorriso : UPDATE : 841 nodes read in 1 seconds
xorriso : NOTE : Detected El-Torito boot information which currently is set to be discarded
Drive current: -indev 'minimal-grub2-repacked-v2.iso'
Media current: stdio file, overwriteable
Media status : is written , is appendable
Boot record  : El Torito , MBR APM
Media summary: 1 session, 8201 data blocks, 16.0m data, 2824m free
Volume id    : 'ISOIMAGE'
System area options: 0x00004200
System area summary: MBR APM
ISO image size/512 : 32804
Partition offset   : 0
MBR heads per cyl  : 64
MBR secs per head  : 32
MBR partition table:   N Status  Type        Start       Blocks
MBR partition      :   1   0x80  0x83            0        32804
MBR partition      :   2   0x00  0xef        32804         5760
APM                :   N  Info
APM block size     :      2048
APM gap fillers    :      2
APM partition name :   1  Gap0
APM partition type :   1  ISO9660_data
APM start and size :   1  16  68
APM partition name :   2  HFSPLUS_Hybrid
APM partition type :   2  Apple_HFS
APM start and size :   2  84  7967
APM partition name :   3  Gap1
APM partition type :   3  ISO9660_data
APM start and size :   3  8051  150
El Torito catalog  : 229  1
El Torito cat path : /boot.catalog
El Torito images   :   N  Pltf  B   Emul  Ld_seg  Hdpt  Ldsiz         LBA
El Torito boot img :   1  BIOS  y   none  0x0000  0x00      4        2599
El Torito boot img :   2  UEFI  y   none  0x0000  0x00   5760        6491
El Torito img path :   1  /boot/grub/i386-pc/eltorito.img
El Torito img opts :   1  boot-info-table grub2-boot-info
El Torito img path :   2  /efi.img

Swapping the two partitions using dd and a temporary file also yields an iso that boots on a DG965SS.

Thanks! It only remains to find out how to make the same iso from scratch, using command-line tools from GRUB and xorriso as found on Debain Jessie, and not using the "loop-mounting and repacking" technique.

--
Alexander E. Patrakov



reply via email to

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