seabios 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 silentoldconfig -j$(nproc)
  35. make -j$(nproc)
  36. mv out/bios.bin.elf ../payload/seabios/seabios_libgfxinit.elf
  37. mv out/vgabios.bin ../payload/seabios/seavgabios.bin
  38. rm .config
  39. # for vgarom setup:
  40. [[ -f Makefile ]] && make distclean
  41. cp ../resources/seabios/config/vgarom .config
  42. make silentoldconfig -j$(nproc)
  43. make -j$(nproc)
  44. mv out/bios.bin.elf ../payload/seabios/seabios_vgarom.elf
  45. rm .config
  46. # clean it again. gotta keep it clean!
  47. [[ -f Makefile ]] && make distclean
  48. printf "Done! SeaBIOS files are in payload/seabios/\n\n"
  49. # done. go back to main directory
  50. cd ../
  51. # ------------------- DONE ----------------------