configs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #!/usr/bin/env sh
  2. #
  3. # helper script: update coreboot configs (run make oldconfig)
  4. #
  5. # Copyright (C) 2021 Leah Rowe <info@minifree.org>
  6. # Copyright (C) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
  7. #
  8. # This program is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation, either version 3 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. #
  21. # This script assumes that the working directory is the root
  22. # of git or release archive
  23. [ "x${DEBUG+set}" = 'xset' ] && set -v
  24. set -u -e
  25. printf "Updating coreboot configs\n"
  26. # Build ROM images for supported boards
  27. updateconf() {
  28. board="$1"
  29. if [ -f "resources/coreboot/${board}/board.cfg" ]; then
  30. cbtree="undefined"
  31. . "resources/coreboot/${board}/board.cfg" # source
  32. if [ "${cbtree}" = "undefined" ]; then
  33. return 0
  34. fi
  35. if [ ! -d "coreboot/${cbtree}" ]; then
  36. ./download coreboot ${cbtree}
  37. fi
  38. for cbcfg in resources/coreboot/${board}/config/*; do
  39. if [ ! -f ${cbcfg} ]; then
  40. continue
  41. fi
  42. (
  43. cd coreboot/${cbtree}/
  44. rm -f .config*
  45. make distclean
  46. )
  47. mv $cbcfg coreboot/${cbtree}/.config
  48. (
  49. cd coreboot/${cbtree}/
  50. make oldconfig
  51. )
  52. mv coreboot/${cbtree}/.config $cbcfg
  53. rm -f coreboot/${cbtree}/.config*
  54. (
  55. cd coreboot/${cbtree}/
  56. make distclean
  57. )
  58. done
  59. else
  60. printf "\nupdate/config/coreboot: no board.cfg for: %s\n" "${board}"
  61. fi
  62. }
  63. if [ $# -gt 0 ]; then
  64. for board in "${@}"; do
  65. updateconf "${board}"
  66. done
  67. else
  68. for board in resources/coreboot/*; do
  69. if [ ! -d "${board}" ]; then
  70. continue
  71. fi
  72. updateconf "${board##*/}"
  73. done
  74. fi
  75. printf "\n\n"