[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-xorriso] Mountable ISO and GRUB2
From: |
Thomas Schmitt |
Subject: |
Re: [Bug-xorriso] Mountable ISO and GRUB2 |
Date: |
Tue, 27 Dec 2016 13:51:16 +0100 |
Hi,
Carlo Caione wrote:
> -isohybrid-mbr empty.mbr -b boot/grub/i386-pc/eltorito.img
This will not work because the -isohybrid-mbr feature wants to see the
magic number of isolinux.bin in the -b file. Then it patches the address
of the isolinux.bin file into the MBR x86 code at byte 432 to 439 so that
code execution hops onto the isolinux.bin boot image.
Lots of ISOLINUX specifics in there.
----------------------------------------------------------------------
There is nevertheless prepared an mjg-like layout in grub-mkrescue-sed.sh
export MKRESCUE_SED_MODE=mjg
export MKRESCUE_SED_PROTECTIVE=no
export MKRESCUE_SED_PARTNO=2
grub-mkrescue -o output.iso minimal --xorriso=/home/.../grub-mkrescue-sed.sh
This yields
System area summary: MBR grub2-mbr cyl-align-off GPT APM
ISO image size/512 : 24436
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 24436
MBR partition : 2 0x00 0xef 24436 5760
GPT : N Info
GPT disk GUID : 39461e450154884aa4babdf2f2404792
GPT entry array : 16 192 separated
GPT lba range : 64 30198 30247
GPT partition name : 1 48004600530050004c0055005300
GPT partname local : 1 HFSPLUS
GPT partition GUID : 1 39461e450154884aa4bbbdf2f2404792
GPT type GUID : 1 005346480000aa11aa1100306543ecac
GPT partition flags: 1 0x1000000000000001
GPT start and size : 1 336 24100
GPT partition name : 2 490053004f004800790062007200690064003100
GPT partname local : 2 ISOHybrid1
GPT partition GUID : 2 39461e450154884aa4b8bdf2f2404792
GPT type GUID : 2 a2a0d0ebe5b9334487c068b6b72699c7
GPT partition flags: 2 0x1000000000000001
GPT start and size : 2 24436 5760
APM : N Info
APM block size : 2048
APM gap fillers : 0
APM partition name : 1 HFSPLUS_Hybrid
APM partition type : 1 Apple_HFS
APM start and size : 1 84 6025
APM partition name : 2 Appended2
APM partition type : 2 Data
APM start and size : 2 6109 1440
The decisive option for getting mjg without ISOLINUX software is
-part_like_isohybrid
The trick to get a mountable NBR partition is to append the EFI partition
as number 2.
The xorriso arguments are:
-as mkisofs
-o output.iso -r
-graft-points -no-pad
--sort-weight 0 / --sort-weight 1 /boot
--grub2-mbr /usr/lib/grub/i386-pc/boot_hybrid.img
-part_like_isohybrid
-append_partition 2 0xef /tmp/grub-mkrescue-sed-efi-img.32559
-hfsplus -apm-block-size 2048
-hfsplus-file-creator-type chrp tbxj /System/Library/CoreServices/.disk_label
-hfs-bless-by i /System/Library/CoreServices/boot.efi
--modification-date=2016122712245900
-b boot/grub/i386-pc/eltorito.img
-no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info
-eltorito-alt-boot
-e --interval:appended_partition_2:all::
-no-emul-boot -isohybrid-gpt-basdat
/tmp/grub.8niQjo minimal
The file
/tmp/grub-mkrescue-sed-efi-img.32559
is the efi.img file prepared by grub-mkrescue and moved out of directory
/tmp/grub.8niQjo
by grub-mkrescue-sed.sh so that it gets not as file into the ISO.
----------------------------------------------------------------------
I am now testing a new mode "gpt_appended" which produces a pure GPT
layout with Protective MBR and mountable ISO filesystem in GPT partition 1.
(No overlapping partitions, of course.)
Decisive are two options added to the "mbr_only" proposal:
-partition_offset 16
-appended_part_as_gpt
It already works with xorriso >= 1.4.4 but some fine tuning is necessary to
improve it and prepare -report_system_area "as_mkisofs" for properly
proposing reproduction options.
Have a nice day :)
Thomas
- Re: [Bug-xorriso] Mountable ISO and GRUB2, (continued)
Re: [Bug-xorriso] Mountable ISO and GRUB2, Thomas Schmitt, 2016/12/23