[syslinux] Bootable ISO with extra data outside the ISO?

Thomas Schmitt scdbackup at gmx.net
Fri Aug 4 10:20:39 PDT 2017


Hi,

> I'd like to create a Linux bootable ISO disc
> with an extra chunk of data **outside** the ISO space.
> [...]
> The goal would be to boot into Linux in RAM off
> the disc and mount the extra chunk of data to access it.  Is this a hybrid
> ISO?

If you have data outside the ISO but inside the image file or disc,
then it is some kind of hybrid, of course.
It is not "isohybrid" necessarily, because that term is for ISOs bootable
from USB stick via an MBR and from CD/DVD/BD via an El Torito boot image.
It is not "ISO 9660 / UDF hybrid", either.


> maybe a "yes, this is simple,

This depends on your further needs. :))


> use xorriso and check out feature XXXX" would be helpful.

You could simply append the extra data to the produced ISO image
file. The data would have to offer information about their valid
size, then. The data start could be deduced by the ISO size reported
by programs like /sbin/isosize.


A matching xorriso feature is native command -append_partition or the
mkisofs emulation option of the same name:

  xorriso -as mkisofs \
    -o test.iso -R \
    -append_partition 2 0xc0 /file/with/partition/content/on/disk \
    /iso/payload/directory/on/disk

will produce an ISO about which fdisk says:

  Units: sectors of 1 * 512 = 512 bytes
  ...
  Device     Boot Start   End Sectors  Size Id Type
  test.iso1           0   735     736  368K 83 Linux
  test.iso2         736  1567     832  416K  c W95 FAT32 (LBA)

The first 736 blocks are the ISO, the blocks from 736 to end are the
appended partition. If these blocks constitute a FAT filesystem (as
my second argument 0x0c to -append_partition suggests) then you can mount
it from the image file by the --offset option of losetup.
On USB stick it will be mountable as partition 2.

Of course you can put a tar archive directly into the partition.
The partition size will give an upper limit for the archive size.

You may have to use partition number 3 if there is EFI boot equipment in
the ISO, which usually gets into partition 2.

Be aware that multi-session on that ISO will overwrite the partition
and that the ISO filesystem size inquired by e.g. program /sbin/isosize
will be smaller than the size of the image file ...

> I need this because I want the Linux ISO to be constant and verifiable with
> an SHA hash... the extra stuff will vary from customer to customer.

... on the other hand, /sbin/isosize will tell you the size that is
covered by your checksum.


Have a nice day :)

Thomas



More information about the Syslinux mailing list