memtest86plus 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/bash
  2. # helper script: Downloads MemTest86+ and patches it
  3. #
  4. # Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
  5. # Copyright (C) 2015 Joseph Michael Thompson <jmt@josepht.me>
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. # This script assumes that the working directory is the
  21. # root of libreboot_src or libreboot git.
  22. [ "x${DEBUG+set}" = 'xset' ] && set -v
  23. set -u -e
  24. # Get the last version of MemTest86+ used, apply patches, build it.
  25. # Remove the old version that may exist
  26. # ------------------------------------------------------------------------------
  27. printf "Downloading MemTest86+\n"
  28. rm -Rf "memtest86+-5.01/"
  29. # Get latest memtest86+:
  30. # ------------------------------------------------------------------------------
  31. # download it using wget
  32. wget http://www.memtest.org/download/5.01/memtest86+-5.01.tar.gz
  33. # extract it
  34. tar -xzf "memtest86+-5.01.tar.gz"
  35. # delete the tar file (no longer needed)
  36. rm -f "memtest86+-5.01.tar.gz"
  37. # there are modifications required
  38. cd "memtest86+-5.01/"
  39. # Apply necessary patches
  40. # ------------------------------------------------------------------------------
  41. # place the right config
  42. rm -f "config.h"
  43. cp "../resources/memtest86/patch/config.h" .
  44. # place the right Makefile
  45. rm -f "Makefile"
  46. cp "../resources/memtest86/patch/Makefile" .
  47. # (diff them with defaults to see what changed)
  48. # we're done
  49. cd "../"
  50. printf "\n\n"
  51. # ------------------- DONE ----------------------