seabios 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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://git.seabios.org/seabios.git
  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 b0d61ecef66eb05bd7a4eb7ada88ec5dab06dfee
  40. for patchfile in ../resources/seabios/patches/*.patch; do
  41. git am "${patchfile}" || touch ../build_error
  42. if [ -f ../build_error ]; then
  43. git am --abort
  44. break
  45. fi
  46. done
  47. )
  48. if [ -f build_error ]; then
  49. rm -f build_error
  50. exit 1
  51. fi
  52. exit 0