home *** CD-ROM | disk | FTP | other *** search
/ host-198-236-40-254.wlwv.k12.or.us / host-198-236-40-254.wlwv.k12.or.us.tar / host-198-236-40-254.wlwv.k12.or.us / tsv / BareMetalInstall.iso / make_iso.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2013-12-03  |  1KB  |  39 lines

  1. #!/bin/bash
  2. # ---------------------------------------------------
  3. # Script to create bootable ISO in Linux
  4. # usage: make_iso.sh [ /tmp/slax.iso ]
  5. # author: Tomas M. <http://www.linux-live.org>
  6. # ---------------------------------------------------
  7.  
  8. if [ "$1" = "--help" -o "$1" = "-h" ]; then
  9.   echo "This script will create bootable ISO from files in curent directory."
  10.   echo "Current directory must be writable."
  11.   echo "example: $0 /mnt/hda5/slax.iso"
  12.   exit
  13. fi
  14.  
  15. ISONAME="$1"
  16.  
  17. if [ "$ISONAME" = "" ]; then
  18.    SUGGEST="../`basename \`pwd\``.iso"
  19.    echo -ne "Target ISO file name [ Hit enter for $SUGGEST ]: "
  20.    read ISONAME
  21.    if [ "$ISONAME" = "" ]; then ISONAME="$SUGGEST"; fi
  22. fi
  23.  
  24. # isolinux.bin is changed during the ISO creation,
  25. # so we need to restore it from backup.
  26. cp -f boot/isolinux.bi_ boot/isolinux.bin
  27. if [ $? -ne 0 ]; then
  28.    echo "Can't recreate isolinux.bin, make sure your current directory is writable!"
  29.    exit 1
  30. fi
  31.  
  32. echo "Creating iso file $ISONAME"
  33. echo " app id:$ISO_VOLID"
  34. echo " vol id:$ISO_VOLID"
  35.  
  36. mkisofs -o "$ISONAME" -v -J -R -D -A "$ISO_VOLID" -V "$ISO_VOLID" \
  37. -no-emul-boot -boot-info-table -boot-load-size 4 \
  38. -b boot/isolinux.bin -c boot/isolinux.boot .
  39.