genmodsrc.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #! /bin/sh
  2. #
  3. # Copyright (C) 2002,2007 Free Software Foundation, Inc.
  4. #
  5. # This genmodsrc.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. set -e
  14. mod_name="$1"
  15. deps="$2"
  16. cat <<EOF
  17. /* This file is automatically generated by genmodsrc.sh. DO NOT EDIT! */
  18. /*
  19. * GRUB -- GRand Unified Bootloader
  20. * Copyright (C) 2002,2007 Free Software Foundation, Inc.
  21. *
  22. * GRUB is free software: you can redistribute it and/or modify
  23. * it under the terms of the GNU General Public License as published by
  24. * the Free Software Foundation, either version 3 of the License, or
  25. * (at your option) any later version.
  26. *
  27. * GRUB is distributed in the hope that it will be useful,
  28. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  29. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  30. * GNU General Public License for more details.
  31. *
  32. * You should have received a copy of the GNU General Public License
  33. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  34. */
  35. #include <grub/dl.h>
  36. EOF
  37. echo "GRUB_MOD_NAME(${mod_name});"
  38. for mod in `grep "^${mod_name}:" ${deps} | sed 's/^[^:]*://'`; do
  39. echo "GRUB_MOD_DEP(${mod});"
  40. done