genemuinit.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. nm="$1"
  14. shift
  15. cat <<EOF
  16. /* This file is automatically generated by geninit.sh. DO NOT EDIT! */
  17. /*
  18. * GRUB -- GRand Unified Bootloader
  19. * Copyright (C) 2002,2005,2007 Free Software Foundation, Inc.
  20. *
  21. * GRUB is free software: you can redistribute it and/or modify
  22. * it under the terms of the GNU General Public License as published by
  23. * the Free Software Foundation, either version 3 of the License, or
  24. * (at your option) any later version.
  25. *
  26. * GRUB is distributed in the hope that it will be useful,
  27. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  28. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  29. * GNU General Public License for more details.
  30. *
  31. * You should have received a copy of the GNU General Public License
  32. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  33. */
  34. #include "grub_emu_init.h"
  35. EOF
  36. cat <<EOF
  37. void
  38. grub_init_all (void)
  39. {
  40. EOF
  41. read mods
  42. for line in $mods; do
  43. if ${nm} --defined-only -P -p ${line} | grep grub_mod_init > /dev/null; then
  44. echo "grub_${line}_init ();" | sed 's,\.mod,,g;'
  45. fi
  46. done
  47. cat <<EOF
  48. }
  49. EOF
  50. cat <<EOF
  51. void
  52. grub_fini_all (void)
  53. {
  54. EOF
  55. for line in $mods; do
  56. if ${nm} --defined-only -P -p ${line} | grep grub_mod_fini > /dev/null; then
  57. echo "grub_${line}_fini ();" | sed 's,\.mod,,g;'
  58. fi
  59. done
  60. cat <<EOF
  61. }
  62. EOF