[syslinux] xorriso or genisoimage syntax assistance

Mattias Schlenker ms at mattiasschlenker.de
Sun Feb 2 10:37:41 PST 2014


Am 02.02.2014 17:49, schrieb Dean Graff:
> This also is perfect, i found  `xorriso -as mkisofs' last night, and it
> worked great. And `xorrisofs' seemed to work even better. But I really want
> to push xorriso to its limits. And utilize its capability to make a .iso
> that when written to a USB, one can "claim the extra space" as another
> partition. As they are using in the current debian-live.
>

Xooriso has the option to add another partition beyond the space 
occopied by the ISO9660 filesystem. This basically just appends (and 
aligns) the given image and adds an entry  to the partition table. This 
is however static in size and will result in some limitations.

A common problem with partitioning tools is that they are not very eager 
to support nested partitions. Besides ISOhybrid boot I do not see any 
need for nested partitions, so their decision to treat nested partitions 
as a kind of error and to delete them is reasonable. I am sure there are 
some possibities to move the EFI image to the end of the filesystem and 
build a dual ISO/UDF filesystem with the UDF using the first partition 
(EFI boot second) and the ISO spanning the whole disk.

But this would lead to some failures on some UEFI implementations that 
cannot cope with EFI boot images located at high LBAs...

Since the size of a target thumb drive with an ISOhybrid system is never 
known and some strange operating systems so only the first no hidden 
partition on removable devices I decided to put some logic for changing 
partitioning (to GPT) to the initramfs. On my live systems I basically 
do upon first boot:

 1. zero the first 32k of the ISOhybrid thumb drive - this kills the GPT
    but leaves the ISO intact and thus avoids confusion for partitioning
    tools
 2. move the ISO to the end of the device (don't forget to remember
    where you put it) in 8MB blocks beginning from the end keeps RAM
    used for moving low and allows overlaps between the old position and
    the new position (eg. if the ISO is ~700MB and the drive is 1GB)
 3. Create some partitions (in my case at least four):
     1. FAT32 of flexible size, allows to continue using the thumb drive
        with all operating systems including MS Windows
     2. legacy_boot for extlinux and kernel files (do not to put
        gptmbr.bin to the first sector of the device)
     3. boot for EFI boot - I just "dd" the efi.img there
     4. system - partition that starts where the moved ISO image starts

  (on my systems there are actually eight partitions in the end, added 
are: spare system for easier updates, one for encrypted /home, one for 
encrypted swap, and one for nonfree binary extensions that can be added 
by users or customers).

If you want to look at the whole process, download this live system:

http://download.lesslinux.org/incoming/lesslinux-search-and-rescue-uluru-20140123-134238.iso

Boot it, then take a look at the function iso_gpt_convert in:

/etc/rc.d/0110-searchsys.sh

BTW: Using GPT should be not a problem these days, since only Windows XP 
is the last operating system to support MBR only. If you really want to 
support Windows XP with this layout you should probably install a 
"synced" MBR that just exposes the first partition.

Regards,
Mattias



-- 
Mattias Schlenker - Redaktion + EDV-Beratung + Linux-CD/DVD-Konzepte
August-Bebel-Str. 74 - 04275 LEIPZIG - GERMANY

Bitte fuer geschaeftliche Telefonate vorzugsweise die VoIP-Telefonnummer
+49 341 39290767 verwenden, da ich diese aufs Mobiltelefon routen kann!



More information about the Syslinux mailing list