grub_script_expansion.in 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #! @BUILD_SHEBANG@
  2. set -e
  3. # Run GRUB script in a Qemu instance
  4. # Copyright (C) 2010 Free Software Foundation, Inc.
  5. #
  6. # GRUB is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # GRUB is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. disks=`echo ls | @builddir@/grub-shell| grep -av '^Network protocols:$'| grep -av '^tftp http $'`
  19. other=`echo insmod regexp\; echo \* | @builddir@/grub-shell`
  20. for d in $disks; do
  21. if echo "$d" |grep ',' >/dev/null; then
  22. if echo "$other" | grep -F -- "$d" >/dev/null; then
  23. echo "$d should not occur in * expansion" >&2
  24. exit 1
  25. fi
  26. else
  27. if ! echo "$other" | grep -F -- "$d" >/dev/null; then
  28. echo "$d missing from * expansion" >&2
  29. exit 1
  30. fi
  31. fi
  32. done
  33. other=`echo insmod regexp\; echo '(*)' | @builddir@/grub-shell`
  34. for d in $disks; do
  35. if ! echo "$other" | grep -F -- "$d" >/dev/null; then
  36. echo "$d missing from (*) expansion" >&2
  37. exit 1
  38. fi
  39. done