Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

genliso 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/bash
  2. #
  3. # Generate a legacy floppy emulation ISO boot image
  4. #
  5. # genliso foo.liso foo.lkrn bar.lkrn ...
  6. #
  7. # The .liso image filename is the first argument followed by
  8. # a list of .lkrn images include in .liso image
  9. case $# in
  10. 0|1)
  11. echo Usage: $0 foo.liso foo.lkrn ...
  12. exit 1
  13. ;;
  14. esac
  15. case "`mtools -V`" in
  16. Mtools\ version\ 3.9.9*|Mtools\ version\ 3.9.1[0-9]*|[mM]tools\ *\ [4-9].*)
  17. ;;
  18. *)
  19. echo Mtools version 3.9.9 or later is required
  20. exit 1
  21. ;;
  22. esac
  23. out=$1
  24. shift
  25. dir=`mktemp -d bin/liso.dir.XXXXXX`
  26. img=$dir/boot.img
  27. mformat -f 1440 -C -i $img ::
  28. cfg=$dir/syslinux.cfg
  29. cat > $cfg <<EOF
  30. # These default options can be changed in the genliso script
  31. SAY iPXE ISO boot image generated by genliso
  32. TIMEOUT 30
  33. EOF
  34. first=
  35. for f
  36. do
  37. if [ ! -r $f ]
  38. then
  39. echo $f does not exist, skipping 1>&2
  40. continue
  41. fi
  42. # shorten name for 8.3 filesystem
  43. b=$(basename $f)
  44. g=${b%.lkrn}
  45. g=${g//[^a-z0-9]}
  46. g=${g:0:8}.krn
  47. case "$first" in
  48. "")
  49. echo DEFAULT $g
  50. ;;
  51. esac
  52. first=$g
  53. echo LABEL $b
  54. echo "" KERNEL $g
  55. mcopy -m -i $img $f ::$g
  56. done >> $cfg
  57. mcopy -i $img $cfg ::syslinux.cfg
  58. if ! syslinux $img
  59. then
  60. exit 1
  61. fi
  62. mkisofs -q -o $out -c boot.cat -b boot.img $dir
  63. rm -fr $dir