OpenSDE Packages Database (without history before r20070)
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.

74 lines
2.1 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../syslinux/boot/boot.in
  5. # Copyright (C) 2008 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; version 2 of the License. A copy of the
  12. # GNU General Public License can be found in the file COPYING.
  13. # --- SDE-COPYRIGHT-NOTE-END ---
  14. # converts a filename into norock,nojoliet names
  15. isolinux_filename() {
  16. local dir= name= ext= extlen=
  17. # only the last dot is kept, the rest are converted into _s
  18. # and -s are also overted into _s
  19. echo "$1" |
  20. sed -e 's,\(.*/\)\?\([^/]*\)\.\([^\.]\+\)$,\1\t\2\t\3,' -e 's,\.,_,g' -e 's,-,_,g' |
  21. while read dir name ext; do
  22. # we have dir, name, ext separated and encoded now
  23. # to be able to restrict to len( name + '.' + ext ) < 32
  24. if [ -n "$ext" ]; then
  25. extlen=$( echo -n "$ext" | wc -c )
  26. name=$( echo -n "$name" | cut -c1-`expr 30 - $extlen` )
  27. else
  28. name=$( echo -n "$name" | cut -c1-31 )
  29. fi
  30. echo "${dir}${name}${ext:+.$ext}"
  31. done
  32. }
  33. # generates a label isolinux can understand
  34. isolinux_label() {
  35. echo "$1" | md5sum | cut -d' ' -f1
  36. }
  37. boot_cd_pre() {
  38. local isolinuxdir="$isofsdir/boot/isolinux"
  39. mkdir -p "$isolinuxdir"
  40. cp -f "$build_root/usr/lib/syslinux/"{isolinux.bin,menu.c32} "$isolinuxdir"
  41. cat > "$isolinuxdir/isolinux.cfg" <<-EOT
  42. DEFAULT menu.c32
  43. PROMPT 0
  44. MENU TITLE OpenSDE Installer
  45. EOT
  46. }
  47. boot_cd_add() {
  48. cat >> "$1/boot/isolinux/isolinux.cfg" <<-EOT
  49. LABEL $( isolinux_label "$3 (Kernel: $2)" )
  50. MENU LABEL $3 (Kernel: $2)
  51. KERNEL $( isolinux_filename $4 )
  52. APPEND initrd=$( isolinux_filename $5 )
  53. EOT
  54. }
  55. boot_cd_post() {
  56. echo_status "Creating isofs_arch.txt file .."
  57. cat > $build_toolchain/isofs_arch.txt <<- EOT
  58. BOOT -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -no-emul-boot
  59. BOOTx -boot-load-size 4 -boot-info-table
  60. DISK1 $isofsdir/ /
  61. EOT
  62. }