coreboot 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. #!/bin/bash
  2. # helper script: downloads coreboot and patches/deblobs it
  3. #
  4. # Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
  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. # This script assumes that the working directory is the
  20. # root of libreboot_src or libreboot git.
  21. [ "x${DEBUG+set}" = 'xset' ] && set -v
  22. set -u -e
  23. printf "Downloading coreboot, patching coreboot and deblobbing coreboot\n"
  24. # This grabs current base used, and applies patches
  25. # This is also used to run the deblob scripts.
  26. # Remove the old version that may exist
  27. # ------------------------------------------------------------------------------
  28. rm -Rf "coreboot/"
  29. # Get latest coreboot:
  30. # ------------------------------------------------------------------------------
  31. # download it using git
  32. git clone http://review.coreboot.org/coreboot
  33. # there are modifications required
  34. cd "coreboot/"
  35. # reset to previously tested revision
  36. git reset --hard cd5cdd3ba42371cc97b1464fd7b98de5bef05a6a
  37. # Get patches from review.coreboot.org
  38. # ------------------------------------------------------------------------------
  39. # ----
  40. # check on coreboot mailing list (see "favourites" in mail client):
  41. # [coreboot] macbook21: broken by 10385 (Make DSDT a file in CBFS rather than embedding it into ramstage.)
  42. # -- probably affects the X60 and T60 as well, if this is not already fixed.
  43. # seems to be related to normal/fallback payload mechanism
  44. # KEEP ON EYE ON:
  45. # http://review.coreboot.org/#/c/7549
  46. # ----
  47. printf "southbridge/intel/common/spi: Add Flash lockdown option\n"
  48. # git fetch http://review.coreboot.org/coreboot refs/changes/70/9370/4 && git cherry-pick FETCH_HEAD
  49. git am "../resources/libreboot/patch/0001-southbridge-intel-common-spi-Add-Flash-lockdown-opti.patch"
  50. printf "mainboards/lenovo/t400: Enable serial debug option for use with dock\n"
  51. printf "NOTE: doesn't actually work at the moment. see docs/tasks.html\n"
  52. printf "Only including so that .config doesn't have to change\n"
  53. # git fetch http://review.coreboot.org/coreboot refs/changes/17/9317/13 && git cherry-pick FETCH_HEAD
  54. git am "../resources/libreboot/patch/0002-mainboards-lenovo-t400-Enable-serial-debug-option-fo.patch"
  55. printf "mainboard/lenovo/t400: Add initial hybrid graphics support\n"
  56. # git fetch http://review.coreboot.org/coreboot refs/changes/19/9319/18 && git cherry-pick FETCH_HEAD
  57. git am "../resources/libreboot/patch/0003-mainboard-lenovo-t400-Add-initial-hybrid-graphics-su.patch"
  58. # not included, but keep an eye on it:
  59. # printf "mainboard/lenovo/t400: Increase backlight frequency to reduce flicker\n"
  60. # git fetch http://review.coreboot.org/coreboot refs/changes/31/9331/14 && git cherry-pick FETCH_HEAD
  61. printf "NOTFORMERGE: lenovo/t400: hard-code enable integrated-only video\n"
  62. # git fetch http://review.coreboot.org/coreboot refs/changes/50/10550/1 && git cherry-pick FETCH_HEAD
  63. git am "../resources/libreboot/patch/0004-NOTFORMERGE-lenovo-t400-hard-code-enable-integrated-.patch"
  64. # ----
  65. printf "lenovo/x60: Enable VESA framebuffer mode (native graphics)\n"
  66. # git fetch http://review.coreboot.org/coreboot refs/changes/53/10553/1 && git cherry-pick FETCH_HEAD
  67. git am "../resources/libreboot/patch/0005-lenovo-x60-Enable-VESA-framebuffer-mode-native-graph.patch"
  68. # NOTE: merged in master
  69. # NOTE: Investigate what mono and mtjm wrote about bit 16 in BLC_PWM_CTL
  70. printf "lenovo/x60: Enable legacy brightness controls (native graphics)\n"
  71. # git fetch http://review.coreboot.org/coreboot refs/changes/48/7048/9 && git cherry-pick FETCH_HEAD
  72. git am "../resources/libreboot/patch/0006-lenovo-x60-Enable-brightness-controls-native-graphic.patch"
  73. # NOTE: http://review.coreboot.org/#/c/10624 is a follow-up. re-include 7048 (latest one) then include 10624
  74. # NOTE: 7048 is now merged in coreboot master
  75. printf "Enable T60 native graphics\n"
  76. # git fetch http://review.coreboot.org/coreboot refs/changes/45/5345/10 && git cherry-pick FETCH_HEAD
  77. git am "../resources/libreboot/patch/0007-lenovo-t60-Enable-native-intel-gfx-init.patch"
  78. printf "lenovo/t60: Enable VESA framebuffer mode (native graphics)\n"
  79. # git fetch http://review.coreboot.org/coreboot refs/changes/51/10551/1 && git cherry-pick FETCH_HEAD
  80. git am "../resources/libreboot/patch/0008-lenovo-t60-Enable-VESA-framebuffer-mode-native-graph.patch"
  81. printf "lenovo/t60: Enable brightness controls (native graphics)\n"
  82. # git fetch http://review.coreboot.org/coreboot refs/changes/52/10552/1 && git cherry-pick FETCH_HEAD
  83. git am "../resources/libreboot/patch/0009-lenovo-t60-Enable-brightness-controls-native-graphic.patch"
  84. printf "ec/lenovo/h8: permanently enable wifi/trackpoint/touchpad/bluetooth/wwan\n"
  85. # git fetch http://review.coreboot.org/coreboot refs/changes/58/7058/9 && git cherry-pick FETCH_HEAD
  86. git am "../resources/libreboot/patch/0010-NOTFORMERGE-ec-lenovo-h8-wlan-trackpoint-touchpad-bl.patch"
  87. # printf "i945: permanently set tft_brightness to 0xff. this fixes the issue with X60 and 'scrolling' backlight\n"
  88. # git fetch http://review.coreboot.org/coreboot refs/changes/61/7561/2 && git cherry-pick FETCH_HEAD
  89. # The patch was accidentally merged in coreboot. See
  90. # http://review.coreboot.org/#/c/8697/ for the revert commit. rebase 7561 and re-include it in
  91. # libreboot, once 8697 is merged in coreboot.
  92. printf "northbridge/gm45/raminit.c: enable GS45 high-perf (i.e. add X200S support to libreboot)\n"
  93. # git fetch http://review.coreboot.org/coreboot refs/changes/86/7786/11 && git cherry-pick FETCH_HEAD
  94. git am "../resources/libreboot/patch/0011-northbridge-gm45-raminit.c-enable-GS45-high-performa.patch"
  95. printf "fix uneven backlight on X200 (when setting brightness low)\n"
  96. # git fetch http://review.coreboot.org/coreboot refs/changes/79/7979/2 && git cherry-pick FETCH_HEAD
  97. git am "../resources/libreboot/patch/0012-gm45-fix-uneven-backlight-native-gfx-init.patch"
  98. printf "ThinkPad R400 support (clone of the T400)\n"
  99. # git fetch http://review.coreboot.org/coreboot refs/changes/93/8393/5 && git cherry-pick FETCH_HEAD
  100. git am "../resources/libreboot/patch/0013-lenovo-r400-Add-clone-of-Lenovo-T400.patch"
  101. printf "ThinkPad T500 (depends on T400 patch)\n"
  102. # git fetch http://review.coreboot.org/coreboot refs/changes/45/10545/1 && git cherry-pick FETCH_HEAD
  103. git am "../resources/libreboot/patch/0014-lenovo-t500-Add-clone-of-Lenovo-T400.patch"
  104. # Misc:
  105. printf "ec/lenovo/h8: re-factor handling of power_management_beeps\n"
  106. # git fetch http://review.coreboot.org/coreboot refs/changes/31/10531/8 && git cherry-pick FETCH_HEAD
  107. git am "../resources/libreboot/patch/0015-ec-lenovo-h8-re-factor-handling-of-power_management_.patch"
  108. # Run coreboot-libre deblob scripts
  109. # ------------------------------------------------------------------------------
  110. printf "Deleting .git* in coreboot/ (history inside .git contains the blobs that were deleted)\n"
  111. rm -Rf ".git/"
  112. rm -f ".gitreview"
  113. rm -f ".gitmodules"
  114. rm -f ".gitignore"
  115. # Strictly overkill. libreboot doesn't even checkout this submodule
  116. rm -Rf "3rdparty/"
  117. cd "../"
  118. printf "Deblobbing coreboot\n"
  119. ./resources/utilities/coreboot-libre/deblob
  120. printf "\n\n"
  121. # ------------------- DONE ----------------------