coreboot 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #!/usr/bin/env bash
  2. # Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. arguments() {
  17. project_arguments_targets "$project" "$@"
  18. }
  19. usage() {
  20. project_usage_actions "$project"
  21. project_usage_arguments "$project" "$@"
  22. }
  23. dependencies() {
  24. project_dependencies "$project" "$@"
  25. }
  26. download() {
  27. local repository=$project
  28. project_download_git "$project" "$repository" "https://review.coreboot.org/coreboot https://github.com/coreboot/coreboot.git" "$@"
  29. }
  30. download_check() {
  31. local repository=$project
  32. project_download_check_git "$project" "$repository" "$@"
  33. }
  34. extract() {
  35. project_extract "$project" "$@"
  36. }
  37. extract_check() {
  38. project_extract_check "$project" "$@"
  39. }
  40. update() {
  41. local repository=$project
  42. project_update_git "$project" "$repository" "$@"
  43. }
  44. update_check() {
  45. local repository=$project
  46. project_update_check_git "$project" "$repository" "$@"
  47. }
  48. build() {
  49. local board="$1"
  50. shift
  51. local repository=$project
  52. project_sources_directory_missing_empty_error "$project" "$repository" "$board" "$@"
  53. local sources_path=$(project_sources_path "$project" "$repository" "$board" "$@")
  54. local build_path=$(project_build_path "$project" "$board" "$@")
  55. local base_config_path=$(coreboot_config_path "$board" "$@")
  56. local variant_config_path="$(coreboot_variant_config_path "$board" "$@")"
  57. local arch=$(coreboot_arch "$board" "$@")
  58. local crossgcc_build_path=$(project_build_path "crossgcc" "$arch")
  59. local crossgcc_bin_path="$crossgcc_build_path/bin/"
  60. local vboot_sources_path=$(project_sources_path "vboot" "vboot" "devices")
  61. local -i base_config_line_count="$(wc -l < "$base_config_path")"
  62. local -a base_config_overrides
  63. local -a board_variant_config
  64. # To only get overrides, trim out base config since
  65. # we cannot skip it in project_file_contents_herit()
  66. mapfile -t base_config_overrides \
  67. < <(tail -n +$(($base_config_line_count+1)) \
  68. < <(coreboot_config "$board" "$@") \
  69. 2>/dev/null)
  70. if [[ -n "$variant_config_path" ]]; then
  71. mapfile -t board_variant_config < "$variant_config_path"
  72. fi
  73. if git_project_check "$repository"
  74. then
  75. git_project_checkout "$project" "$repository" "$board" "$@"
  76. fi
  77. project_action_arguments "checkout" "vboot" "devices"
  78. rm -f "$sources_path/.xcompile"
  79. mkdir -p "$build_path"
  80. make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" XGCCPATH="$crossgcc_bin_path" BUILD_TIMELESS=1 KERNELVERSION="$VERSION" KBUILD_DEFCONFIG="$base_config_path" "${board_variant_config[@]}" "${base_config_overrides[@]}" "defconfig"
  81. make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" XGCCPATH="$crossgcc_bin_path" BUILD_TIMELESS=1 KERNELVERSION="$VERSION" "${board_variant_config[@]}" "${base_config_overrides[@]}" -j$TASKS # VBOOT_SOURCE="$vboot_sources_path"
  82. rm -f "$sources_path/.xcompile"
  83. }
  84. build_check() {
  85. project_build_check "$project" "$@"
  86. }
  87. install() {
  88. project_install "$project" "$@"
  89. }
  90. install_check() {
  91. project_install_check "$project" "$@"
  92. }
  93. release() {
  94. local repository=$project
  95. project_release_install_archive "$project" "$IMAGES" "$@"
  96. project_release_sources_git "$project" "$repository" "$@"
  97. }
  98. release_check() {
  99. local repository=$project
  100. project_release_install_archive_check "$project" "$IMAGES" "$@"
  101. project_release_check_sources_git "$project" "$repository" "$@"
  102. }
  103. clean() {
  104. project_clean "$project" "$@"
  105. }