seabios 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/usr/bin/env bash
  2. #
  3. # Copyright (C) 2015, 2016, 2021 Leah Rowe <info@minifree.org>
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. #
  18. [ "x${DEBUG+set}" = 'xset' ] && set -v
  19. set -u -e
  20. # Get SeaBIOS, revert to commit last used and apply patches.
  21. # Remove the old version that may still exist
  22. # ------------------------------------------------------------------------------
  23. printf "Downloading SeaBIOS\n"
  24. rm -f build_error
  25. rm -rf "seabios/"
  26. # Get latest SeaBIOS
  27. # ------------------------------------------------------------------------------
  28. # download it using git
  29. git clone https://review.coreboot.org/seabios || git clone https://github.com/coreboot/seabios
  30. if [ ! -d "seabios" ]; then
  31. printf "seabios not downloaded; check network connection?\n\n"
  32. exit 1
  33. fi
  34. (
  35. # modifications are required
  36. cd "seabios/"
  37. # Reset to the last commit that was tested (we use stable releases for seabios)
  38. # ------------------------------------------------------------------------------
  39. git reset --hard 64f37cc530f144e53c190c9e8209a51b58fd5c43
  40. for patchfile in ../resources/seabios/patches/*.patch; do
  41. if [ ! -f "${patchfile}" ]; then continue; fi
  42. git am "${patchfile}" || touch ../build_error
  43. if [ -f ../build_error ]; then
  44. git am --abort
  45. break
  46. fi
  47. done
  48. )
  49. if [ -f build_error ]; then
  50. rm -f build_error
  51. exit 1
  52. fi
  53. exit 0