[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-xorriso] Adding files to an ISO image
From: |
Thomas Schmitt |
Subject: |
Re: [Bug-xorriso] Adding files to an ISO image |
Date: |
Sun, 09 Nov 2014 15:09:29 +0100 |
Hi,
the answer is lenghty, i fear, because booting is a wide field.
> in=grml96-full_2014.03.iso
> out=grml96-full_2014.03.custom.iso
> xorriso -indev $in -outdev $out -add $add
> But resulting ISO image is not bootable. It's grml 2014.03 live CD.
By default, El Torito boot equipment is discarded and not preserved,
because this equipment often has peculiar demands towards the ISO
image producing program.
grml96-full_2014.03.iso obviously uses the ISOLINUX boot loader suite
for BIOS and GRUB2 to UEFI.
See below for my hopefully sufficient proposal with command
-boot_image isolinux patch
See more below for the case of unknown boot equipment a proposal with
-boot_image any keep
--------------------------------------------------------------------
First an assessment of grml96-full_2014.03.iso:
Regrettably my download of grml96-full_2014.03.iso stalled
2 percent before the end.
With xorriso-1.3.8 i do
xorriso -indev grml96-full_2014.03.iso \
-report_el_torito plain -report_system_area plain
and see as El Torito equipment:
El Torito catalog : 113 1
El Torito cat path : /boot/isolinux/boot.cat
El Torito images : N Pltf B Emul Ld_seg Hdpt Ldsiz LBA
El Torito boot img : 1 BIOS y none 0x0000 0x00 4 405799
El Torito boot img : 2 UEFI y none 0x0000 0x00 512 405572
El Torito img path : 1 /boot/isolinux/isolinux.bin
El Torito img opts : 1 boot-info-table isohybrid-suitable
El Torito img path : 2 /boot/efi.img
The system area hosts an MBR and a GPT. The latter is not shown
because a read error happens when the backup table shall be loaded
from the end of the image (which is still not downloaded).
System area options: 0x00000102
System area summary: MBR isohybrid cyl-align-on
ISO image size/512 : 1671632
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 0x17 0 1673216
I downloaded grml96-small_2014.03.iso in the hope that it bears
the same boot equipment.
There i see additionally:
GPT : N Info
GPT backup problems: Implausible header LBA 774142
GPT disk GUID : 9bfd233becc3a9499251c27b33141bbf
GPT entry array : 2 128 overlapping
GPT lba range : 34 774110 774142
GPT partition name : 1
49534f4879627269642049534f0049534f487962726964004170706c
GPT partition GUID : 1 729360d32dc5884a89e744a164c1df4f
GPT type GUID : 1 a2a0d0ebe5b9334487c068b6b72699c7
GPT partition flags: 1 0x0000000000000000
GPT start and size : 1 0 772901
GPT partition name : 2 49534f487962726964004170706c65004170706c
GPT partition GUID : 2 c56d584556bb664bbb0ccecee8e155ab
GPT type GUID : 2 a2a0d0ebe5b9334487c068b6b72699c7
GPT partition flags: 2 0x0000000000000000
GPT start and size : 2 725276 512
GPT partition path : 2 /boot/efi.img
Looks like the post-processing result of SYSLINUX program isohybrid
with option --efi (and its old GPT bugs).
--------------------------------------------------------------------
A repacking run with the current release xorriso-1.3.8:
xorriso -indev grml96-small_2014.03.iso -outdev test_patch.iso \
-boot_image isolinux patch \
-add $something
yields an ISO with:
El Torito catalog : 193222 1
El Torito cat path : /boot/isolinux/boot.cat
El Torito images : N Pltf B Emul Ld_seg Hdpt Ldsiz LBA
El Torito boot img : 1 BIOS y none 0x0000 0x00 4 181541
El Torito boot img : 2 UEFI y none 0x0000 0x00 512 181314
El Torito img path : 1 /boot/isolinux/isolinux.bin
El Torito img opts : 1 boot-info-table isohybrid-suitable
El Torito img path : 2 /boot/efi.img
System area options: 0x00000102
System area summary: MBR isohybrid cyl-align-on GPT
ISO image size/512 : 774144
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 0x17 0 774144
GPT : N Info
GPT backup problems: Not a GPT 1.0 header of 92 bytes for 128 bytes per
ent
ry
GPT disk GUID : 9bfd233becc3a9499251c27b33141bbf
GPT entry array : 2 128 overlapping
GPT lba range : 34 774110 774142
GPT partition name : 1
49534f4879627269642049534f0049534f48796272696400417070
6c
GPT partition GUID : 1 729360d32dc5884a89e744a164c1df4f
GPT type GUID : 1 a2a0d0ebe5b9334487c068b6b72699c7
GPT partition flags: 1 0x0000000000000000
GPT start and size : 1 0 772901
GPT partition name : 2 49534f487962726964004170706c65004170706c
GPT partition GUID : 2 c56d584556bb664bbb0ccecee8e155ab
GPT type GUID : 2 a2a0d0ebe5b9334487c068b6b72699c7
GPT partition flags: 2 0x0000000000000000
GPT start and size : 2 725276 512
GPT partition path : 2 /boot/efi.img
which looks quite promising for boot success.
Try it.
Some details need my attention, though:
The complaint
GPT backup problems: Not a GPT 1.0 header of 92 bytes for 128 bytes per
ent
indicates some bug in libisofs about the backup GPT. I'll have
to investigate.
Normally the backup GPT is ignored by boot firmware (but not by
partition editors). GPT is used by some UEFI if the ISO is presented
on USB-Stick or hard disk.
The block address in
El Torito catalog : 193222 1
does not look optimal either. Some rare BIOS does not like high ones.
I'll have to investigate.
--------------------------------------------------------------------
More general approach:
If one does not know much about the boot equipment in the ISO,
then it is worth a try to add a session with
-boot_image any keep
to a copy of the original ISO. This leaves all old files in
their old positions and gives hope that the system area still
points to useful addresses and that boot image files need no
adjustments.
cp grml96-small_2014.03.iso test_keep.iso
xorriso -dev test_keep.iso \
-boot_image any keep \
-add $something
The result looks ok, except that the partitions end at the
end of the first ISO session.
--------------------------------------------------------------------
Future:
I am currently (and slowly) working on a feature to produce the
necessary xorriso commands resp. -as mkisofs options from
the assessment of the boot equipment in the loaded ISO.
This will allow to manipulate particular properties of the
boot equipment.
The inquiry of xorriso native commands
xorriso -indev grml96-small_2014.03.iso -report_system_area cmd
yields
-boot_image isolinux partition_table=on
-boot_image any partition_cyl_align=on
-boot_image any partition_offset=0
-boot_image any partition_hd_cyl=64
-boot_image any partition_sec_hd=32
-boot_image any cat_path='/boot/isolinux/boot.cat'
-boot_image isolinux bin_path='/boot/isolinux/isolinux.bin'
-boot_image any platform_id=0x00
-boot_image any emul_type=no_emulation
-boot_image any load_size=2048
-boot_image any boot_info_table=on
-boot_image any next
-boot_image any efi_path='/boot/efi.img'
-boot_image any platform_id=0xef
-boot_image any emul_type=no_emulation
-boot_image any load_size=262144
-boot_image isolinux partition_entry=gpt_basdat
Whereas
xorriso -indev grml96-small_2014.03.iso -report_system_area as_mkisofs
yields
-isohybrid-mbr .
-partition_cyl_align on
-partition_offset 0
-partition_hd_cyl 64
-partition_sec_hd 32
-c '/boot/isolinux/boot.cat'
-b '/boot/isolinux/isolinux.bin'
-no-emul-boot
-boot-load-size 4
-boot-info-table
-eltorito-alt-boot
-e '/boot/efi.img'
-no-emul-boot
-boot-load-size 512
-isohybrid-gpt-basdat
The "." as argument to -isohybrid-mbr is a placeholder for the
disk file path of the SYSLINUX MBR template file. E.g. isohdpfx.bin
One may cut it out of the ISO image:
dd if=grml96-small_2014.03.iso bs=512 count=1 of=isohdpfx.bin
--------------------------------------------------------------------
Have a nice day :)
Thomas