1

I am following steps from Ubuntu documentation https://help.ubuntu.com/community/LiveCDInternetKiosk

I have tried replacing final step that uses mkisofs with xorriso, did not help. My USB stick won't book, I get blank prompt. Think it may be related to filesystem (Hidden NTFS/FAT instead of VFAT) but changing it using cfdisk does not reslove the problem. The partition table is "dos", looks fine and /dev/sdb1 is active aka bootable. The original .iso image is new Ubuntu server 17.10 and modified one is copied using dd. System files are untouched on a modified version.

If I try to install syslinx on USB afterwards (syslinux -i /dev/sdb) i get following error: "syslinux: invalid media signature (not an FAT/NTFS volume?)"

If I upload the .iso to USB using unetbootin the system loads fine. I only had to do isolinux -> sysline rename to avoid default unetbootin's default boot prompt.

I would like to be able to script this last step without using X or user interaction at all.

Some relevant steps:

sudo rm extract-cd/casper/filesystem.squashfs
sudo mksquashfs edit extract-cd/casper/filesystem.squashfs

sudo chmod a+w extract-cd/casper/filesystem.size
printf $(sudo du -sx --block-size=1 edit | cut -f1) > extract-cd/casper/filesystem.size


cd extract-cd
sudo rm md5sum.txt
find -type f -print0 | sudo xargs -0 md5sum | grep -v syslinux/boot.cat | sudo tee md5sum.txt
cd ..

xorriso -as mkisofs \
  -o xgogi.iso \
  -isohybrid-mbr /usr/lib/SYSLINUX/mbr.bin \
  -c syslinux/boot.cat \
  -b syslinux/syslinux.bin \
   -no-emul-boot -boot-load-size 4 -boot-info-table \
  extract-cd/

#copy to USB works, needs X
sudo unetbootin lang=en method=diskimage isofile=xgogi.iso installtype=USB targetdrive=/dev/sdb1 autoinstall=yes

# doesn't work and I am badly frustrated why
sudo dd bs=4M if=gogi.iso of=/dev/sdb
kometonja
  • 155

2 Answers2

2

As you found out, you need a specially prepared MBR as input for xorriso. It has the unusual job to find and start program "isolinux.bin" inside the ISO.

The SYSLINUX project offers a suitable MBR under the name "isohdpfx.bin". Debian binary package "isolinux" has it as /usr/lib/ISOLINUX/isohdpfx.bin .

Although there is few development in SYSLINUX, one should take care to combine isohdpfx.bin and isolinux.bin only from compatible versions. So when modifying an ISO and keeping its file isolinux.bin it is wise to extract the first 432 bytes from that ISO and use them as MBR input. (It is not harmful to copy all 512 bytes of the first block. xorriso will overwrite the surplus bytes with appropriate values.)

1

My mbr.bin was incorrect. Instead, I had to create a new one from the original .iso. Like this:

$ sudo dd if=ubuntu-16.04-desktop-amd64.iso bs=512 count=1 of=custom-iso/isolinux/isohdpfx.bin

Found on this beautiful article: https://linuxconfig.org/legacy-bios-uefi-and-secureboot-ready-ubuntu-live-image-customization

kometonja
  • 155