coreboot 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. #!/bin/bash
  2. # helper script: downloads coreboot and patches/deblobs it
  3. #
  4. # Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org>
  5. # Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr>
  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. # This script assumes that the working directory is the
  21. # root of libreboot_src or libreboot git.
  22. [ "x${DEBUG+set}" = 'xset' ] && set -v
  23. set -u -e
  24. printf "Downloading coreboot, patching coreboot and deblobbing coreboot\n"
  25. # This grabs current base used, and applies patches
  26. # This is also used to run the deblob scripts.
  27. # Remove the old version that may exist
  28. # ------------------------------------------------------------------------------
  29. rm -Rf "coreboot/"
  30. # Get latest coreboot:
  31. # ------------------------------------------------------------------------------
  32. # download it using git
  33. git clone http://review.coreboot.org/coreboot
  34. # there are modifications required
  35. cd "coreboot/"
  36. # reset to previously tested revision
  37. git reset --hard 33fb4cf0ffb01be8bcb6b488872c87eb50e7d77f
  38. # vboot submodule is needed
  39. git submodule update --init --checkout -- 3rdparty/vboot/
  40. # there are modifications required
  41. cd "3rdparty/vboot/"
  42. # reset vboot to last known good revision
  43. git reset --hard fbf631c845c08299f0bcbae3f311c5807d34c0d6
  44. # Patch vboot
  45. # ------------------------------------------------------------------------------
  46. printf "firmware: Developer mode timeout delay shortening (down to 3 seconds)\n"
  47. git am "../../../resources/libreboot/patch/vboot/0001-firmware-Developer-mode-timeout-delay-shortening-dow.patch"
  48. printf "firmware: Text-based screen display in priority\n"
  49. git am "../../../resources/libreboot/patch/vboot/0002-firmware-Text-based-screen-display-in-priority.patch"
  50. printf "firmware: NV context pointer handoff to VbExDisplayScreen\n"
  51. git am "../../../resources/libreboot/patch/vboot/0003-firmware-NV-context-pointer-handoff-to-VbExDisplaySc.patch"
  52. printf "firmware: Hold key combination in developer mode\n"
  53. git am "../../../resources/libreboot/patch/vboot/0004-firmware-Hold-key-combination-in-developer-mode.patch"
  54. printf "firmware: Screen blank and wait at disabled USB boot warning\n"
  55. git am "../../../resources/libreboot/patch/vboot/0005-firmware-Screen-blank-and-wait-at-disabled-USB-boot-.patch"
  56. printf "firmware: Separate screen and wait at device information screen\n"
  57. git am "../../../resources/libreboot/patch/vboot/0006-firmware-Separate-screen-and-wait-at-device-informat.patch"
  58. printf "firmware: Localization keys removal\n"
  59. git am "../../../resources/libreboot/patch/vboot/0007-firmware-Localization-keys-removal.patch"
  60. # leave the vboot tree
  61. cd "../../"
  62. # Get patches from review.coreboot.org
  63. # ------------------------------------------------------------------------------
  64. printf "mainboard/lenovo/t400: Add initial hybrid graphics support\n"
  65. git am "../resources/libreboot/patch/misc/0001-mainboard-lenovo-t400-Add-initial-hybrid-graphics-su.patch"
  66. # git fetch http://review.coreboot.org/coreboot refs/changes/19/9319/18 && git cherry-pick FETCH_HEAD
  67. # not included, but keep an eye on it:
  68. # printf "mainboard/lenovo/t400: Increase backlight frequency to reduce flicker\n"
  69. # git fetch http://review.coreboot.org/coreboot refs/changes/31/9331/14 && git cherry-pick FETCH_HEAD
  70. printf "NOTFORMERGE: lenovo/t400: hard-code enable integrated-only video\n"
  71. git am "../resources/libreboot/patch/misc/0002-NOTFORMERGE-lenovo-t400-hard-code-enable-integrated-.patch"
  72. # git fetch http://review.coreboot.org/coreboot refs/changes/50/10550/1 && git cherry-pick FETCH_HEAD
  73. printf "lenovo/x60: use correct BLC_PWM_CTL value\n"
  74. git am "../resources/libreboot/patch/misc/0003-lenovo-x60-use-correct-BLC_PWM_CTL-value.patch"
  75. # git fetch http://review.coreboot.org/coreboot refs/changes/24/10624/2 && git cherry-pick FETCH_HEAD
  76. printf "lenovo/t60: Enable brightness controls (native graphics)\n"
  77. git am "../resources/libreboot/patch/misc/0004-lenovo-t60-Enable-brightness-controls-native-graphic.patch"
  78. # git fetch http://review.coreboot.org/coreboot refs/changes/52/10552/2 && git cherry-pick FETCH_HEAD
  79. printf "ec/lenovo/h8: permanently enable wifi/trackpoint/touchpad/bluetooth/wwan\n"
  80. git am "../resources/libreboot/patch/misc/0005-NOTFORMERGE-ec-lenovo-h8-wlan-trackpoint-touchpad-bl.patch"
  81. # git fetch http://review.coreboot.org/coreboot refs/changes/58/7058/9 && git cherry-pick FETCH_HEAD
  82. printf "northbridge/gm45/raminit.c: enable GS45 high-perf (i.e. add X200S support to libreboot)\n"
  83. git am "../resources/libreboot/patch/misc/0006-northbridge-gm45-raminit.c-enable-GS45-high-performa.patch"
  84. # git fetch http://review.coreboot.org/coreboot refs/changes/35/11135/3 && git cherry-pick FETCH_HEAD
  85. # Patch removed for now, affected by this patch:
  86. # http://review.coreboot.org/#/c/11702/
  87. # printf "fix uneven backlight on X200 (when setting brightness low)\n"
  88. # git fetch http://review.coreboot.org/coreboot refs/changes/79/7979/2 && git cherry-pick FETCH_HEAD
  89. printf "ThinkPad R400 support (clone of the T400)\n"
  90. git am "../resources/libreboot/patch/misc/0007-lenovo-r400-Add-clone-of-Lenovo-T400.patch"
  91. # git fetch http://review.coreboot.org/coreboot refs/changes/93/8393/5 && git cherry-pick FETCH_HEAD
  92. printf "ThinkPad T500 (depends on T400 patch)\n"
  93. git am "../resources/libreboot/patch/misc/0008-lenovo-t500-Add-clone-of-Lenovo-T400.patch"
  94. # git fetch http://review.coreboot.org/coreboot refs/changes/45/10545/1 && git cherry-pick FETCH_HEAD
  95. # CrOS:
  96. printf "chromeos: Allow disabling vboot firmware verification when ChromeOS is enabled\n"
  97. git am "../resources/libreboot/patch/cros/0001-chromeos-Allow-disabling-vboot-firmware-verification.patch"
  98. # KGPE-D16 patches
  99. # new versions can be found at https://raptorengineeringinc.com/coreboot/kgpe-d16-status.php
  100. for i in ../resources/libreboot/patch/kgpe-d16/*; do
  101. git am "${i}"
  102. done
  103. # Temporary fix (TODO: get tpearson to fix properly):
  104. # Remove code from coreboot that adds microcode updates
  105. # git fetch http://review.coreboot.org/coreboot refs/changes/90/12090/1 && git cherry-pick FETCH_HEAD
  106. git am "../resources/libreboot/patch/tmpfix/0001-NOTFORMERGE-don-t-add-CPU-microcode-on-fam10h-to-fam.patch"
  107. # Run coreboot-libre deblob scripts
  108. # ------------------------------------------------------------------------------
  109. printf "Deleting .git* in coreboot/ (history inside .git contains the blobs that were deleted)\n"
  110. rm -Rf ".git/"
  111. rm -f ".gitreview"
  112. rm -f ".gitmodules"
  113. rm -f ".gitignore"
  114. rm -Rf 3rdparty/*/.git*
  115. cd "../"
  116. printf "Deblobbing coreboot\n"
  117. ./resources/utilities/coreboot-libre/deblob
  118. if [ -f "version" ]; then
  119. # _src release archive is being used
  120. version="libreboot-$(cat version)"
  121. else
  122. # git repo is being used
  123. version="libreboot-$(git describe --tags HEAD)"
  124. fi
  125. printf '%s\n' "${version}" >"coreboot/.coreboot-version"
  126. printf "\n\n"