I'm working on a script to abstract the creation of 24.04 Ubuntu remixes, similar to Cubic. The commands I'm using are summarized below, and the resulting ISO is barely bootable in VirtualBox [everything I've produced has not made it past the error "Unable to Find a Medium Containing a Live File System"]. To those who create custom Ubuntu ISOs beyond > 22.04 in the post-isolinux era, any suggestions? These commands should be relatively straightforward (given, I haven't even made an attempt to modify minimal.squashfs yet):
cd ~/Desktop
sudo mkdir /mnt/iso
sudo mount -o loop ubuntu-24.04-desktop-amd64.iso /mnt/iso
mkdir ~/custom-ubuntu
cp -r /mnt/iso/* ~/custom-ubuntu/
sudo umount /mnt/iso
cd ~/custom-ubuntu
chmod +w -R .
cd ~/custom-ubuntu/casper
mkdir extract
sudo unsquashfs -d extract minimal.squashfs
sudo chroot extract glib-compile-schemas /usr/share/glib-2.0/schemas/
sudo rm minimal.squashfs
sudo mksquashfs extract minimal.squashfs -comp xz -e boot
sudo rm -rf extract
sudo sed -i "s/^[0-9]* .*/$(sudo du -sx --block-size=1 extract | cut -f1) minimal.squashfs/" filesystem.size
cd ~/Desktop
orig=ubuntu-24.04-desktop-amd64.iso
mbr=ubuntu-mbr.img
efi=ubuntu-efi.img
dd if="$orig" bs=1 count=446 of="$mbr"
skip=$(fdisk -l "$orig" | fgrep '.iso2 ' | awk '{print $2}')
size=$(fdisk -l "$orig" | fgrep '.iso2 ' | awk '{print $4}')
dd if="$orig" bs=512 skip="$skip" count="$size" of="$efi"
new=~/Desktop/ubuntu-custom.iso
disk_title="Ubuntu Custom"
sudo xorriso -as mkisofs
-r -V "$disk_title" -J -joliet-long -l
-iso-level 3
-partition_offset 16
--grub2-mbr "$mbr"
--mbr-force-bootable
-append_partition 2 0xEF "$efi"
-appended_part_as_gpt
-c /boot.catalog
-b /boot/grub/i386-pc/eltorito.img
-no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info
-eltorito-alt-boot
-e '--interval:appended_partition_2:all::'
-no-emul-boot
-o "$new"
~/custom-ubuntu