Syslinux is simple and works great, but I wasted a lot of time today with a setup that refused to boot. Apparently if you install syslinux on a bootable partition, that just isn’t enough for the PC to boot.
By any means necessary find the mbr.bin file that came with your version of syslinux and cat it to the disk device (not the partition of course). For me “any means” meant a simple
apt-get source syslinux. install-mbr simply did not work despite what debian’s guide said.
Most of what I know was given to me by rolling a custom debian installer. Of course I read all the way through their guide except the very bottom where there was a user contributed note expressing what I just explained. But I wanted to drop that note here just for the sake of polluting the Internet.
Here’s an example of what I’m working with for this project.
development:~/usb-disk# find . . ./mbr.bin ./mkinstalldisk.sh ./boot-contents ./boot-contents/boot.txt ./boot-contents/initrd.gz ./boot-contents/vmlinuz ./boot-contents/initrd-autodisk.gz ./boot-contents/syslinux.cfg
And the script “mkinstalldisk.sh” … note that this is very crude…
#!/bin/bash if whiptail --yesno "This is a dangerous tool... do you want to quit?" 8 40 then exit 1 fi if whiptail --yesno "Are you SURE you want to wipe all data on disk $1 ???" 8 40 then # Destroy whatever's going on with this disk dd if=/dev/zero of=$1 bs=512 count=1 # Add a FAT32 partition for the size of the disk echo -e "n\np\n1\n\n\nt\nc\na\n1\nw" | fdisk $1 # Format.... mkdosfs $11 # Install SYSLINUX on this bootable partition syslinux $11 # Install a valid MBR on the disk itself cat mbr.bin > /dev/sdb # Add the boot environment mntdir=/mnt/target-`date +%s`/ mkdir $mntdir mount $11 $mntdir cp `dirname $0`/boot-contents/* $mntdir umount $mntdir rmdir $mntdir fi