Building Bootable USB for Custom Fedora IoT 39 ISO

I’m reaching out for assistance with a project I’m working on. I’m trying to make a bootable USB drive with a custom Fedora IoT 39 ISO. Here’s what I’ve done so far:

  1. Downloaded the Fedora IoT 39 ISO.
  2. Manually installed the ISO and obtained the Anaconda kickstart (KS) file to serve as the foundational configuration file.
  3. Implemented necessary modifications to the KS file.
  4. Updated the grub.cfg file to introduce a new menu item that would facilitate installation using the modified KS file.
  5. Executed the Xorriso command as prescribed.
xorriso -indev Fedora-IoT-ostree-x86_64-39-20231103.1.iso \
        -overwrite "on" \
        -compliance no_emul_toc \
        -map "./anaconda-ks.cfg" "/ks.cfg"  \
        -map "./EFI/grub.cfg" "/EFI/BOOT/grub.cfg" \
        -map "./grub.cfg" "/boot/grub2/grub.cfg" \
        -map "./extras" "/extras" \
        -volid "Fedora-iot-ostree-x86_64-39" \
        -outdev Fedora-IoT-ostree-x86_64-39.iso \
        -boot_image any replay
  1. Burned the custom ISO to the USB drive, utilizing Fedora Media Writer and Rufus. However, both methods yielded identical results.

Regrettably, I have encountered a significant obstacle in the form of the custom menu failing to appear within the grub boot menu when booting in EFI mode. Interestingly, the menu solely manifests itself in legacy BIOS mode, albeit selecting it results in failure.

I am earnestly seeking your expertise and guidance to navigate this predicament. Any insights or suggestions you may offer would be immensely appreciated.

Furthermore, I wish to highlight that while the ISO functions seamlessly within VirtualBox and VMware environments, its performance on physical PCs via USB is suboptimal.

Your assistance in evaluating the efficacy of the aforementioned procedure or identifying a more streamlined alternative would be invaluable.

Thank you for your attention and anticipated support.

Update 1: when I burn the ISO in ISO mode instead DD mode the menu starts to appear but the installation failed because I was not able to mount the USB to copy some files from it!

grub.cfg :

set default="1"

function load_video {
  insmod all_video
}

load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
insmod chain

set timeout=60
### END /etc/grub.d/00_header ###

search --no-floppy --set=root -l 'Fedora-iot-ostree-x86_64-39'

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Install Fedora-IoT 39' --class fedora --class gnu-linux --class gnu --class os {
        linux /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-iot-ostree-x86_64-39 quiet
        initrd /images/pxeboot/initrd.img
}
menuentry 'Install custom Fedora-IoT 39' --class fedora --class gnu-linux --class gnu --class os {
        linux /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-iot-ostree-x86_64-39 inst.ks=hd:LABEL=Fedora-iot-ostree-x86_64-39:/ks.cfg quiet
        initrd /images/pxeboot/initrd.img
}
menuentry 'Test this media & install Fedora-IoT 39' --class fedora --class gnu-linux --class gnu --class os {
        linux /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-iot-ostree-x86_64-39 rd.live.check quiet
        initrd /images/pxeboot/initrd.img
}
submenu 'Troubleshooting -->' {
        menuentry 'Install Fedora-IoT 39 in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
                linux /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-iot-ostree-x86_64-39 nomodeset quiet
                initrd /images/pxeboot/initrd.img
        }
        menuentry 'Rescue a Fedora-IoT system' --class fedora --class gnu-linux --class gnu --class os {
                linux /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-iot-ostree-x86_64-39 inst.rescue quiet
                initrd /images/pxeboot/initrd.img
        }
        menuentry 'Boot first drive' --class fedora --class gnu-linux --class gnu --class os {
                chainloader (hd0)+1
        }
        menuentry 'Boot second drive' --class fedora --class gnu-linux --class gnu --class os {
                chainloader (hd1)+1
        }
}

EFI/grub.cfg

set default="1"

function load_video {
  insmod efi_gop
  insmod efi_uga
  insmod video_bochs
  insmod video_cirrus
  insmod all_video
}

load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2

set timeout=60
### END /etc/grub.d/00_header ###

search --no-floppy --set=root -l 'Fedora-iot-ostree-x86_64-39'

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Install Fedora-IoT 39' --class fedora --class gnu-linux --class gnu --class os {
	linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-iot-ostree-x86_64-39 quiet
	initrdefi /images/pxeboot/initrd.img
}
menuentry 'Install Fedora-IoT 39 - EFI' --class fedora --class gnu-linux --class gnu --class os {
        #linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-iot-ostree-x86_64-39 rd.live.check quiet 
        linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-iot-ostree-x86_64-39 inst.ks=hd:LABEL=Fedora-iot-ostree-x86_64-39:/ks.cfg quiet
        initrdefi /images/pxeboot/initrd.img
}
menuentry 'Test this media & install Fedora-IoT 39' --class fedora --class gnu-linux --class gnu --class os {
	linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-iot-ostree-x86_64-39 rd.live.check quiet
	initrdefi /images/pxeboot/initrd.img
}
submenu 'Troubleshooting -->' {
	menuentry 'Install Fedora-IoT 39 in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
		linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-iot-ostree-x86_64-39 nomodeset quiet
		initrdefi /images/pxeboot/initrd.img
	}
	menuentry 'Rescue a Fedora-IoT system' --class fedora --class gnu-linux --class gnu --class os {
		linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-iot-ostree-x86_64-39 inst.rescue quiet
		initrdefi /images/pxeboot/initrd.img
	}
}

Added isoinfo and removed virtualbox