geninit.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #! /bin/sh
  2. #
  3. # Copyright (C) 2002,2005,2007 Free Software Foundation, Inc.
  4. #
  5. # This gensymlist.sh is free software; the author
  6. # gives unlimited permission to copy and/or distribute it,
  7. # with or without modifications, as long as this notice is preserved.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  11. # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  12. # PARTICULAR PURPOSE.
  13. cat <<EOF
  14. /* This file is automatically generated by geninit.sh. DO NOT EDIT! */
  15. /*
  16. * GRUB -- GRand Unified Bootloader
  17. * Copyright (C) 2002,2005,2007 Free Software Foundation, Inc.
  18. *
  19. * GRUB is free software: you can redistribute it and/or modify
  20. * it under the terms of the GNU General Public License as published by
  21. * the Free Software Foundation, either version 3 of the License, or
  22. * (at your option) any later version.
  23. *
  24. * GRUB is distributed in the hope that it will be useful,
  25. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. * GNU General Public License for more details.
  28. *
  29. * You should have received a copy of the GNU General Public License
  30. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  31. */
  32. #include <grub/emu/misc.h>
  33. EOF
  34. for mod in "$@"; do
  35. echo "extern void grub_${mod}_init (void);"
  36. echo "extern void grub_${mod}_fini (void);"
  37. done
  38. cat <<EOF
  39. void
  40. grub_init_all (void)
  41. {
  42. EOF
  43. for mod in "$@"; do
  44. echo "grub_${mod}_init ();"
  45. done
  46. cat <<EOF
  47. }
  48. EOF
  49. cat <<EOF
  50. void
  51. grub_fini_all (void)
  52. {
  53. EOF
  54. for mod in "$@"; do
  55. echo "grub_${mod}_fini ();"
  56. done
  57. cat <<EOF
  58. }
  59. EOF