summaryrefslogtreecommitdiffstats
path: root/docs/maintain/index.html
blob: fb47bcd9af1e1c0c6e432683dd86241b9ddfbf41 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<style type="text/css">
		@import url('../css/main.css');
	</style>

	<title>Maintaining libreboot</title>
</head>

<body>

	<div class="section">
		<h1 id="pagetop">Maintaining libreboot</h1>
			<p>
				This section relates to maintaining libreboot. <b>Work-in-progress</b>
			</p>
			<p>
				Do not follow anything here to the letter; is it only a guide
				representing how libreboot is maintained (for reference). This
				will be added to frequently from now on.
			</p>
			<p>
				Or <a href="../index.html">Back to main index</a>.
			</p>
			<ul>
				<li><a href="#updating_coreboot">Updating coreboot-libre</a></li>
			</ul>
	</div>
	
	<div class="section">
	
		<h1 id="updating_coreboot">Updating coreboot-libre</h1>
		
			<p>
				Coreboot-libre is the name of the deblobbed coreboot sources
				used in libreboot. It is also the name of the collection
				of scripts used for deblobbing coreboot, on each new update.
			</p>
			
			<p>
				This section shows an example of how to update (re-base) to
				the latest version of coreboot, how to update the deblobbing
				scripts, and so on. <b>This does not teach you how to
				change what custom patches are used, nor does it tell
				you how to add new boards to libreboot. It assumes that you
				simply want to re-base to the latest version (for instance,
				there could be bug fixes that you want). For those things
				not listed in this section, you can refer to other sections
				on this page instead.</b>
			</p>
		
			<p>
				Open these files in your editor (you will most likely be editing them):
			</p>
				<ul>
					<li>resources/scripts/helpers/download/coreboot</li>
					<li>resources/scripts/helpers/build/module/coreboot</li>
					<li>resources/utilities/coreboot-libre/deblob</li>
					<li>resources/utilities/coreboot-libre/nonblobs</li>
					<li>resources/utilities/coreboot-libre/nonblobs_notes</li>
					<li>resources/scripts/helpers/build/roms/helper</li>
					<li>resources/scripts/helpers/build/roms/withgrub</li>
				</ul>
				
			<p>
				If you already had a coreboot/ directory in your libreboot
				tree, delete it:<br/>
				$ <b>rm -rf coreboot/</b>
			</p>
				
			<p>
				Firstly, download coreboot. Do <b>not</b> use <b>./download coreboot</b>
				for this, just clone coreboot, as it does in that script, like so:<br/>
				$ <b>git clone http://review.coreboot.org/coreboot</b>
			</p>
			
			<p>
				$ <b>cd coreboot/</b><br/>
				Get the ID of the latest commit in this clone, by reading the commit ID using
				e.g.:<br/>
				$ <b>git log</b><br/>
				In <i>resources/scripts/helpers/download/coreboot</i> you will
				find a line that says <i><b>git reset --hard</b></i> and then
				a commit ID next to it. Replace this with the commit ID of the latest
				commit from the coreboot version that you just downloaded.
			</p>
			<p>
				Delete the .git* resources. For example:<br/>
				$ <b>rm -rf .git*</b><br/>
				...this is to avoid the deblobbing script from picking up files
				in there as blobs, which would be only false positives and
				increase the amount of time taken. Now come out of coreboot:<br/>
				$ <b>cd ../</b>
			</p>
				
			<p>
				Check all coreboot file names/paths in <i>deblob</i>; if any
				of them no longer exist at that name/path in the coreboot tree that you downloaded, 
				delete the reference(s) in <i>deblob</i>.
			</p>
			
			<p>
				Check all coreboot file names/paths in <i>nonblobs</i>; if
				any of them no longer exist at that name/path in the coreboot tree that you downloaded,
				delete the reference in <i>nonblobs</i>.
			</p>
			
			<p>
				Now, back in the main root directory of libreboot (git repository),
				run the deblob script. This is to prevent the <i>findblobs</i>
				scripts from finding the blobs that are already deleted
				when running the <i>deblob</i> script. Like so:<br/>
				$ <b>./resources/utilities/coreboot-libre/deblob</b>
			</p>
				
			<p>
				Now search for new blobs:<br/>
				$ <b>cd resources/utilities/coreboot-libre/</b><br/>
				$ <b>./findblobs</b><br/>
				WARNING: this will take a <b>*long*</b> time. Be patient!
				What this will do is look through the coreboot source directory,
				looking for blobs. It will not find the blobs that you deleted
				before (because they no longer exist), and it will ignore any
				files listed in <i>nonblobs</i>.
			</p>
			
			<p>
				Once the <i>findblobs</i> script has finished, check the file
				<i>tocheck</i> (from the root, this will be <i>resources/utilities/coreboot-libre/tocheck</i>).
				These are the files detected as blobs; some might be blobs, some not.
				The <i>findblobs</i> script doesn't know how to determine between blobs
				and non-blobs, it only knows patterns. Distinguishing between blobs and
				non-blobs must be performed by you, the human being.
			</p>
				<ul>
					<li>
						Files in <i>tocheck</i> that you identify as blobs,
						should be added appropriately to <i>resources/utilities/coreboot-libre/deblob</i>
					</li>
					<li>
						Files in <i>tocheck</i> that you identify as non-blobs,
						should be added appropriately to <i>resources/utilities/coreboot-libre/nonblobs</i> -
						also, if you feel it necessary, add an explanation of it in
						<i>resources/utilities/coreboot-libre/nonblobs_notes</i>
					</li>
				</ul>
			
			<p>
				Now come back to the main libreboot root directory (root
				of the git clone). If you are still in resources/utilities/coreboot-libre/
				for instance, you would do something like:<br/>
				$ <b>cd ../../../</b>
			</p>
			
			<p>
				Now delete the coreboot directory:<br/>
				$ <b>rm -rf coreboot/</b>
			</p>
			
			<p>
				Download coreboot again, only this time, using the download
				script. The download script also applies custom patches
				to coreboot (see resources/scripts/helpers/download/coreboot);
				if they do not apply anymore, you will have to re-base them
				and then update <i>resources/scripts/helpers/download/coreboot</i>
				accordingly. Anyway, download coreboot like so:<br/>
				$ <b>./download coreboot</b>
			</p>
			
			<p>
				If the custom patches no longer apply, and you have to re-base
				(or replace?) some patches, please do this in coreboot upstream,
				not in libreboot. Then re-include new patches from upstream,
				into libreboot. Here is coreboot's guide for contributing
				patches:<br/>
				<a href="http://www.coreboot.org/Git">http://www.coreboot.org/Git</a>.
			</p>
			
			<p>
				Update all configs:<br/>
				$ <b>./build config corebootupdate</b><br/>
				This simply takes all of the coreboot <b>.config</b> files from
				<i>resources/libreboot/config/</i> and does <b>make oldconfig</b>
				on them. It usually works. If it doesn't, you'll need to recreate
				those configs from scratch using <b>make menuconfig</b> in coreboot
				(see <a href="../git/index.html#config">../git/index.html#config</a>)
			</p>
			
			<p>
				<a href="#pagetop">Back to top of page</a>.
			</p>
	
	</div>

	<div class="section">

		<p>
			Copyright &copy; 2015 Francis Rowe &lt;info@gluglug.org.uk&gt;<br/>
			This document is released under the Creative Commons Attribution-ShareAlike 4.0 International Public License and all future versions.
			A copy of the license can be found at <a href="../license.txt">../license.txt</a>.
		</p>

		<p>
			This document 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 <a href="../license.txt">../license.txt</a> for more information.
		</p>
		
	</div>

</body>
</html>