You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/bin/bash
  2. #
  3. # Generate a isolinux ISO boot image
  4. #
  5. # geniso foo.iso foo.lkrn
  6. #
  7. # the ISO image is the first argument so that a list of .lkrn images
  8. # to include can be specified
  9. #
  10. case $# in
  11. 0|1)
  12. echo Usage: $0 foo.iso foo.lkrn ...
  13. exit 1
  14. ;;
  15. esac
  16. # This should be the default location of the isolinux.bin file
  17. isolinux_bin=${ISOLINUX_BIN:-util/isolinux.bin}
  18. if [ ! -r $isolinux_bin ]
  19. then
  20. echo $0: $isolinux_bin not found, please install, or set ISOLINUX_BIN in arch/i386/Makefile correctly
  21. exit 1
  22. fi
  23. # There should either be mkisofs or the compatible genisoimage program
  24. mkisofs=`which mkisofs genisoimage 2>/dev/null | head -n1`
  25. if [ -z $mkisofs ]
  26. then
  27. echo $0: mkisofs or genisoimage not found, please install or set PATH
  28. exit 1
  29. fi
  30. out=$1
  31. shift
  32. dir=`mktemp -d bin/iso.dir.XXXXXX`
  33. cfg=$dir/isolinux.cfg
  34. cp -p $isolinux_bin $dir
  35. cat > $cfg <<EOF
  36. # These default options can be changed in the geniso script
  37. SAY Etherboot ISO boot image generated by geniso
  38. TIMEOUT 30
  39. EOF
  40. first=
  41. for f
  42. do
  43. if [ ! -r $f ]
  44. then
  45. echo $f does not exist, skipping 1>&2
  46. continue
  47. fi
  48. b=$(basename $f)
  49. g=${b%.lkrn}
  50. g=${g//[^a-z0-9]}.krn
  51. case "$first" in
  52. "")
  53. echo DEFAULT $g
  54. ;;
  55. esac
  56. first=$g
  57. echo LABEL $b
  58. echo "" KERNEL $g
  59. cp -p $f $dir/$g
  60. done >> $cfg
  61. $mkisofs -quiet -l -o $out -c boot.cat -b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table $dir
  62. rm -fr $dir