grub-kbdcomp.in 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/bin/sh
  2. prefix="@prefix@"
  3. exec_prefix="@exec_prefix@"
  4. bindir="@bindir@"
  5. datarootdir="@datarootdir@"
  6. datadir="@datadir@"
  7. if [ "x$pkgdatadir" = x ]; then
  8. pkgdatadir="${datadir}/@PACKAGE@"
  9. fi
  10. grub_mklayout="${bindir}/@grub_mklayout@"
  11. ckbcomp_options=""
  12. export TEXTDOMAIN=@PACKAGE@
  13. export TEXTDOMAINDIR="@localedir@"
  14. . "${pkgdatadir}/grub-mkconfig_lib"
  15. self=`basename $0`
  16. usage () {
  17. gettext_printf "Usage: %s -o OUTPUT CKBMAP_ARGUMENTS...\n" "$self"
  18. gettext "Make GRUB keyboard layout file."; echo
  19. echo
  20. print_option_help "-h, --help" "$(gettext "print this message and exit")"
  21. print_option_help "-V, --version" "$(gettext "print the version information and exit")"
  22. print_option_help "-o, --output=$(gettext FILE)" "$(gettext "save output in FILE [required]")"
  23. echo
  24. gettext_printf "%s generates a keyboard layout for GRUB using ckbcomp\n" "$self"
  25. echo
  26. gettext "Report bugs to <bug-grub@gnu.org>."; echo
  27. }
  28. argument () {
  29. opt=$1
  30. shift
  31. if test $# -eq 0; then
  32. gettext_printf "%s: option requires an argument -- \`%s'\n" "$0" "$opt" 1>&2
  33. exit 1
  34. fi
  35. echo $1
  36. }
  37. output=
  38. while test $# -gt 0
  39. do
  40. option=$1
  41. shift
  42. case "$option" in
  43. -h | --help)
  44. usage
  45. exit 0 ;;
  46. -V | --version)
  47. echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
  48. exit 0 ;;
  49. -o | --output)
  50. output=`argument $option "$@"`; shift ;;
  51. --output=*)
  52. output=`echo "$option" | sed 's/--output=//'` ;;
  53. *)
  54. ckbcomp_options="$ckbcomp_options $option";;
  55. esac
  56. done
  57. if [ "x${output}" = x ] ; then
  58. gettext "output file must be specified" >&2
  59. echo >&2
  60. usage
  61. exit 1
  62. fi
  63. ckbcomp $ckbcomp_options | "$grub_mklayout" -o "${output}"