summaryrefslogtreecommitdiffstats
path: root/getcb
blob: c71cf1b4542ec50321e37b3359fef6380fd9da48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash

#  getcb script: downloads coreboot and patches/deblobs it
#
#	Copyright (C) 2014 Francis Rowe <info@gluglug.org.uk>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# This grabs current base used, and applies patches
# This is also used to run deblob scripts.

# (the idea is that this script will reproduce the coreboot directory included with this version of libreboot)

# You need the dependencies from ./builddeb or ./buildpac to use this script.

# Remove the old version that may exist
# ----------------------------------------------------------------------------------

echo "DOWNLOADING AND PATCHING COREBOOT"

rm -rf coreboot

# Get latest coreboot:
# ----------------------------------------------------------------------------------

# download it using git
git clone http://review.coreboot.org/coreboot

# there are modifications required
cd coreboot

# reset to previously tested revision
git reset --hard 9310df8d0351842e7bb9efe3cabc0ff82ec99c53

# Get patches from review.coreboot.org
# ----------------------------------------------------------------------------------

# Text mode patch for X60 native graphics (main patch already merged in coreboot. See 6723 on coreboot gerrit)
git fetch http://review.coreboot.org/coreboot refs/changes/25/6725/3 && git cherry-pick FETCH_HEAD

## lenovo/x60: Enable legacy brightness controls (native graphics)
## NOT NEEDED. SEE ACPI BRIGHTNESS PATCH BELOW
# git fetch http://review.coreboot.org/coreboot refs/changes/48/7048/4 && git cherry-pick FETCH_HEAD

# Enable T60 native graphics
git fetch http://review.coreboot.org/coreboot refs/changes/45/5345/9 && git cherry-pick FETCH_HEAD
# Enable text-mode graphics for T60
git fetch http://review.coreboot.org/coreboot refs/changes/50/7050/2 && git cherry-pick FETCH_HEAD
## lenovo/t60: Enable legacy brightness controls (native graphics)
## NOT NEEDED. SEE ACPI BRIGHTNESS PATCH BELOW
# git fetch http://review.coreboot.org/coreboot refs/changes/51/7051/1 && git cherry-pick FETCH_HEAD

# ec/lenovo/h8: permanently enable wifi/trackpoint/touchpad, disable bluetooth/wwan
git fetch http://review.coreboot.org/coreboot refs/changes/58/7058/1 && git cherry-pick FETCH_HEAD

# ACPI brightness for i945 targets (x60/t60/x60t/x60s/macbook21):
git fetch http://review.coreboot.org/coreboot refs/changes/31/6731/7 && git cherry-pick FETCH_HEAD
# Fix uneven backlight levels:
git fetch http://review.coreboot.org/coreboot refs/changes/49/7049/1 && git cherry-pick FETCH_HEAD
## note that the 2 changes above are abandoned. Libreboot might have to revert to legacy brightness later on (see above)
## 6731 and and 7049 are still used for now, since they work in GNU/Linux. The author of 6731 abandoned it
## because of incompatibility with Windows, but obviously libreboot doesn't care about that.

# Apply necessary patches (from resources/libreboot/patch/)
# ---------------------------------------------------------------------------------

# T60: fix compilation when using 6731 from review.coreboot.org
git apply ../resources/libreboot/patch/t60_6731buildfix.diff
## 6731 is abandoned and there's no point putting this in coreboot gerrit.
## there is no harm in it being a diff

# Run coreboot-libre deblob scripts
# ---------------------------------------------------------------------------------

# Deblobbing was done manually for this pre-release (will re-tool linux-libre deblob scripts later):
cd ../
echo "deblobbing coreboot"
./DEBLOB
# The git history (git diff command) shows what blobs were deleted (including the blobs themselves) which is a freedom issue. Just delete .git altogether:
cd coreboot
rm -rf .git
rm -rf .gitreview
rm -rf .gitmodules
rm -rf .gitignore
cd ../
echo "finished deblobbing coreboot"

# we're done
echo "FINISHED DOWNLOADING AND PATCHING COREBOOT"

# ------------------- DONE ----------------------