seabios 1.9 KB

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