This works for me, but might be wrong:
First, I create a disk.iso with two partitions on it, an EFI partition and a SYSTEM partition, the whole img will be 1.4GB (100MB for the EFI partition, the rest for the SYSTEM partition):
dd if=/dev/zero of=disk.iso bs=1M count=1400
Then I partition the disk.iso file with fdisk GPT Table:
fdisk disk.iso
# press
g # create GPT-Table
n # new partition
1 # partition number
ENTER # select default
+100M # set size to 100MB
t # set partition type
1 # to EFI SYSTEM
n # new partition
ENTER # default partition number
ENTER # default 1st sector
ENTER # default last sector
w # write changes to file and exit
Then show the partition layout:
fdisk -l disk.iso
Disk disk.iso: 1.4 GiB, 1468006400 bytes, 2867200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: D7DD43FA-30B6-2445-B34C-F4DB7B5D6F37
Device Start End Sectors Size Type
disk.iso1 2048 206847 204800 100M EFI System
disk.iso2 206848 2867166 2660319 1.3G Linux filesystem
Use losetup to loop-mount both partitions from disk.iso to format both partitions to your desired format (fat16 for EFI and ext4 for SYSTEM) and additionally assign labels to them if needed... Use fdisk START END values multiplied with sectorsize to set boundaries:
losetup --offset $((512*2048)) --sizelimit $((512*206847)) --show --find disk.iso
# /dev/loop0
losetup --offset $((512*206848)) --sizelimit $((512*2867166)) --show --find disk.iso
# /dev/loop1
mkfs.fat -F16 /dev/loop0
mkfs.ext4 /dev/loop1
tune2fs -L "SYSTEM" /dev/loop1 # assign label SYSTEM to SYSTEM-Partition
Mount both partitions and copy the corresponding content to them:
mkdir /mnt/p1 /mnt/p2
mount /dev/loop0 /mnt/p1/
mount /dev/loop1 /mnt/p2/
cp -a efi /mnt/p1/
cp -a system/* /mnt/p2/
umount /mnt/p1 /mnt/p2
Unmount both loop devices:
losetup -d /dev/loop0 /dev/loop1
The disk.iso is now ready for booting. Iso tested with qemu-kvm & virt-manager, inserted as CDROM medium. Not Tested with real burned disks!