Skip to content

Instantly share code, notes, and snippets.

@yoshimov
Created January 15, 2009 11:22
Show Gist options
  • Save yoshimov/47362 to your computer and use it in GitHub Desktop.
Save yoshimov/47362 to your computer and use it in GitHub Desktop.
Create bootable cd for specified device.
#!/bin/bash
MEDIA=$1
mkdir -p boot-cd/boot/grub
cp /usr/lib/grub/i386-pc/stage2_eltorito boot-cd/boot/grub
cp ${MEDIA}/boot/grub/menu.lst boot-cd/boot/grub
cp ${MEDIA}/boot/vmlinuz* boot-cd/boot
cp ${MEDIA}/boot/initrd.img* boot-cd/boot
cat ${MEDIA}/boot/grub/menu.lst | sed 's/^uuid.*/root \(cd\)/' | sed 's/^hiddenmenu/#hiddenmenu/' | sed 's/^timeout.*/timeout 20/' > boot-cd/boot/grub/menu.lst
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -input-charset utf-8 -o boot-cd.iso boot-cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment