seabios 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/usr/bin/env bash
  2. # helper script: builds SeaBIOS source code
  3. #
  4. # Copyright (C) 2020, 2021 Leah Rowe <info@minifree.org>
  5. #
  6. # This program 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. # This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
  18. #
  19. [ "x${DEBUG+set}" = 'xset' ] && set -v
  20. set -u -e
  21. # Build SeaBIOS
  22. # ---------------------------------------------------------------------
  23. printf "Building SeaBIOS payloads and SeaVGABIOS\n"
  24. [ ! -d "payload/" ] && mkdir -p payload/
  25. [ ! -d "payload/seabios" ] && mkdir -p payload/seabios/
  26. rm -f payload/seabios/*
  27. if [ ! -d "seabios/" ]; then
  28. ./download seabios
  29. fi
  30. cd seabios/
  31. # for libgfxinit setup:
  32. [[ -f Makefile ]] && make distclean
  33. cp ../resources/seabios/config/libgfxinit .config
  34. make -j$(nproc)
  35. mv out/bios.bin.elf ../payload/seabios/seabios_libgfxinit.elf
  36. mv out/vgabios.bin ../payload/seabios/seavgabios.bin
  37. rm .config
  38. # for vgarom setup:
  39. [[ -f Makefile ]] && make distclean
  40. cp ../resources/seabios/config/vgarom .config
  41. make -j$(nproc)
  42. mv out/bios.bin.elf ../payload/seabios/seabios_vgarom.elf
  43. rm .config
  44. # clean it again. gotta keep it clean!
  45. [[ -f Makefile ]] && make distclean
  46. printf "Done! SeaBIOS files are in payload/seabios/\n\n"
  47. # done. go back to main directory
  48. cd ../
  49. # ------------------- DONE ----------------------