-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
568 lines (472 loc) · 19 KB
/
index.html
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Linux Kernel Patching - Part I</title>
<meta name="description" content="Introduction to Linux Kernel Patching">
<meta name="author" content="Luis Ibanez">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="revealjs/css/reveal.min.css">
<link rel="stylesheet" href="revealjs/css/theme/sky.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="revealjs/lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="revealjs/css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>Linux Kernel</h1>
<h2>Contributing</h2>
<h3>Part I</h3>
<p>
<small>Created by <a href="https://opensource.com/users/luis-ibanez">Luis Ibanez</a> / <a href="http://twitter.com/luisibanez">@luisibanez</a></small>
</p>
</section>
<section>
<a rel="license" href="http://creativecommons.org/licenses/by/3.0/deed.en_US">
<img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png" />
</a>
<br />
<span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/InteractiveResource" property="dct:title" rel="dct:type">Git Introduction</span>
by
<span xmlns:cc="http://creativecommons.org/ns#" property="cc:attributionName">Luis Ibanez</span>
is licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by/3.0/deed.en_US">Creative Commons Attribution 3.0 Unported License</a>.
</section>
<section>
<h3><a href="https://lkml.org/lkml/2004/12/20/255">Linus in Kernel mailing list...</a></h3>
<blockquote>
“
So at one level I absolutely _hate_ trivial patches: they take time and effort
to merge, and individually the patch itself is often not really obviously
"worth it"...
”
</blockquote>
</section>
<section>
<h3><a href="https://lkml.org/lkml/2004/12/20/255">Linus in Kernel mailing list...</a></h3>
<blockquote>
“
...But at the same time, I think the trivial patches are among the most important
ones - exactly because they are the "entry" patches for every new developer.
”
</blockquote>
</section>
<section>
<section>
<h3>Working with Friends ?</h3>
<h4>Learn how to share a terminal</h4>
<a href="#" class="image navigate-down">
<img width="89" height="119" src="https://s3.amazonaws.com/hakim-static/reveal-js/arrow.png" alt="Down arrow">
</a>
</section>
<section>
<h3>You may want to use</h3>
<h3><a href="http://en.wikipedia.org/wiki/Tmux">TMUX</a></h3>
</section>
<section>
<h3>Log with your friends</h3>
<h3>into the same server...</h3>
</section>
<section>
<h3>Pick one of you</h3>
<h3>to host the session</h3>
</section>
<section>
<h3>The host types...</h3>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
tmux -S /tmp/joyfulsession
</code></pre>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
chmod 777 /tmp/joyfulsession
</code></pre>
</section>
<section>
<h3>The friends type...</h3>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
tmux -S /tmp/joyfulsession attach
</code></pre>
</section>
<section>
<h3>At this point</h3>
<h3>you will be sharing...</h3>
</section>
<section>
<h3>the same screen</h3>
<h3>and</h3>
<h3>the same keyboard</h3>
</section>
<section>
<h3>Coordinate</h3>
<h3>who</h3>
<h3>is typing</h3>
</section>
<section>
<h3>be nice</h3>
<h3>and</h3>
<h3>stay calm !</h3>
</section>
</section>
<section>
<h1>The</h1>
<h1>Beginning...</h1>
</section>
<section>
<section>
<h3>The Kernel Community</h3>
<h3>Uses Git</h3>
</section>
<section>
<h4>You may want to</h4>
<h4>first follow</h4>
<h4>these two Git tutorials</h4>
<p><a href="http://www.opensourcesoftwarepractice.org/Git-Introduction-Part-I/#/">Git Introduction - Part I</a></p>
<p><a href="http://www.opensourcesoftwarepractice.org/Git-Introduction-Part-II/#/">Git Introduction - Part II</a></p>
</section>
<section>
<h4>Now that you know</h4>
<h4>Git basics,</h4>
<h4>we can start...</h4>
</section>
</section>
<section>
<section>
<h3>Getting the Kernel</h3>
<h3>Source Code</h3>
</section>
<section>
<h3>Configure Git</h3>
<p>Identify yourself...<p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
git config --global user.email “myemail@gmail.com”
git config --global user.name “My Name”
</code></pre>
</section>
<section>
<h3>Configure Git</h3>
<p>Configure it to be able to <a href="http://git-scm.com/docs/git-send-email">send email using an SMTP relay</a><p>
<p>for example, gmail:<p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
git config --global sendemail.smtpencryption tls
git config --global sendemail.smtpserver smtp.gmail.com
git config --global sendemail.smtpuser myemail@gmail.com
git config --global sendemail.smtpserverport 587
</code></pre>
<p>You could also use other SMTP relays...<p>
</section>
<section>
<h3>Clone the Repository...</h3>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
git clone git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
</code></pre>
</section>
<section>
<h3>Enter the Directory ...</h3>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
cd net-next
</code></pre>
</section>
<section>
<h3>Create a branch...</h3>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
git branch tutorial-devel
</code></pre>
</section>
<section>
<h3>Checkout that new branch...</h3>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
git branch tutorial-devel
</code></pre>
</section>
</section>
<section>
<section>
<h2>Review Process</h2>
<p> The Kernel Community has set up a review process by which a
patch is authored by one developer, and then reviewed by other more experienced
developers</p>
</section>
<section>
<h2>Review Process</h2>
<p>The role of developers is specified</p>
<p>by text in the Git commit messages</p>
</section>
<section>
<h2>Typical Roles</h2>
<p>The role of developers is specified</p>
<p>by text in the Git commit messages.</p>
</section>
<section>
<h2>Typical Roles</h2>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
Signed-off-by:
Reviewed-by:
Tested-by:
Suggested-by:
Reported-by:
</code></pre>
</section>
<section>
<h2>Signed Off By </h2>
<p>The primary developer uses the “Signed-off-by:” line</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
Signed-off-by:
</code></pre>
<p>provided by the “--signoff” flag</p>
<p>passed to git (shown later)</p>
</section>
</section>
<section>
<section>
<h2>Easy Patches</h2>
<p>Let's start with some easy patches...</p>
</section>
<section>
<h2>printk()</h2>
<p>print() is the standard function</p>
<p>to print messages from the Kernel code.</p>
</section>
<section>
<h2>printk()</h2>
<p>Recently, a standard was adopted</p>
<p>to add priority levels</p>
<p>in all printk() calls</p>
</section>
<section>
<h2>printk()</h2>
<p>There are about 10,000</p>
<p>printk() calls in the Kernel</p>
</section>
<section>
<h2>printk()</h2>
<p>Presently there are many examples of</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
printk("my message %d\n", int_arg);
</code></pre>
<p>The accepted standard now is</p>
<p> to use printk() with a leading argument.</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
printk(KERN_INFO "my message %d\n", int_arg);
</code></pre>
</section>
<section>
<h2>printk() levels</h2>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
KERN_DEBUG
KERN_INFO
KERN_NOTICE
KERN_WARNING
KERN_ERR
KERN_CRIT
KERN_ALERT
KERN_EMERGENCY
</code></pre>
</section>
<section>
<h2>Follow Examples</h2>
<p>From the <a href="http://patchwork.ozlabs.org/project/netdev/list/">netdev mailing list</a>:</p>
<br>
<p><a href="http://patchwork.ozlabs.org/project/netdev/list/">http://patchwork.ozlabs.org/project/netdev/list</a></p>
<br>
<p>see what other people are submitting</p>
</section>
<section>
<h2>netdev</h2>
<p>The <a href="http://patchwork.ozlabs.org/project/netdev/list/">netdev mailing list</a> is one of</p>
<p>a few that use the <a href="http://jk.ozlabs.org/projects/patchwork/">patchwork</a> software</p>
<p>to track patches semi-automatically.</p>
<br>
<p>It is run by <a href="http://en.wikipedia.org/wiki/David_S._Miller">Dave Miller</a></p>
</section>
</section>
<section>
<section>
<h1>Let's Patch!</h1>
</section>
<section>
<h3>Navigate</h3>
<p>Go into a directory,</p>
<p>for example:</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
cd net-next/drivers/net/ethernet
</code></pre>
</section>
<section>
<h3>Find Candidates</h3>
<p>Search for printk() expressions</p>
<p>with the <a href="https://www.kernel.org/pub/software/scm/git/docs/git-grep.html">grep command</a>:</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
git grep printk
</code></pre>
</section>
<section>
<h3>Compare</h3>
<p>Compare the lines from printk() with levels:</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
amd/am79c961a.c: printk(KERN_INFO "%s", version);
</code></pre>
<p>to those without levels:</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
amd/7990.c: printk ("TX rings:\n");
</code></pre>
</section>
<section>
<h3>Edit</h3>
<p>Use your favorite text editor to open the file</p>
<p>for example:</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
vim amd/7990.c
</code></pre>
</section>
<section>
<h3>Modify</h3>
<p>Inspect the printk() lines</p>
<p>and decide what LEVEL to insert</p>
</section>
<section>
<h3>Save</h3>
<p>Save your modifications</p>
<p>and quit your text editor</p>
</section>
<section>
<h3>Stage</h3>
<p>Stage your modifications</p>
<p>with the git command</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
git add amd/7990.c
</code></pre>
</section>
<section>
<h3>Commit</h3>
<p>Commit your modifications</p>
<p>with the git command</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
git commit
</code></pre>
</section>
<section>
<h3>Commit Message</h3>
<p>Follow the model of other commit messages</p>
<p>from the <a href="http://patchwork.ozlabs.org/project/netdev/list/">netdev mailing list</a></p>
</section>
<section>
<h3>Commit Message</h3>
<p>For example </p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
drivers/net: use module_pcmcia_driver() in pcmcia drivers
Use the new module_pcmcia_driver() macro to remove the boilerplate
module init/exit code in the pcmcia drivers.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
</code></pre>
<p>copied from commit</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
fdd3f29eddd1b7c26b3b42e3633afcb22a28fcb3
</code></pre>
</section>
<section>
<h3>Commit Message</h3>
<ul>
<li>The first line is the subject of the patch
<li>It is followed by paragraphs describing the details
<li>It ends with signed-off lines
</ul>
</section>
<section>
<h3>Commit Message</h3>
<p>If you are working in group,</p>
<p>use "Reviewed-by:" lines with</p>
<p>the names of your team members.</p>
</section>
<section>
<h3>Generate</h3>
<p>Generate the patch with the following commands</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
cd ~/net-next
git format-patch --subject-prefix "PATCH net-next" --signoff master
</code></pre>
<p>This will create a file starting with "0001-"</p>
</section>
<section>
<h3>email</h3>
<p>email the patch to yourself:</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
git send-email -to another_one@email.com 0001-patchfile
</code></pre>
<p>Use an alternate email account,</p>
<p>since by default</p>
<p>git CCs your address in ~/.gitconfig</p>
</section>
<section>
<h3>Multiple Files?</h3>
<p>If you changed multiple files as part of a single patch,</p>
<p>put them in a directory to make the submission easier:</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
mkdir mypatches
cd mypatches
git format-patch --signoff --subject-prefix net-next master
cd ..
git send-email patches -to myself@gmail.com
</code></pre>
<p>Choose the "all" option when prompted</p>
</section>
<section>
<h3>Submit</h3>
<p>Submit the patch by emailing it</p>
<p>to the proper maintainer.</p>
<p>For example, for net-dev:</p>
<pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
git send-email -to netdev@vger.kernel.org 0001-patchfile
</code></pre>
</section>
<section>
<h3>Submit</h3>
<p>Consult the source tree <a href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/MAINTAINERS?id=refs/tags/v3.12">MAINTAINERS</a> file</p>
<p>to find where you should submit the patch.</p>
</section>
</section>
<section>
<h2>References</h2>
<ul>
<li><a href="http://www.kroah.com/lkn/">Linux Kernel in a Nutshell</a>
<li><a href="https://www.kernel.org/doc/Documentation/HOWTO">HOWTO Documentation</a>
<li><a href="http://kernelnewbies.org/">Kernel Newbies</a>
</ul>
</section>
<section>
<h1>THE END</h1>
</section>
</div>
</div>
<script src="revealjs/lib/js/head.min.js"></script>
<script src="revealjs/js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'revealjs/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'revealjs/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'revealjs/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'revealjs/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'revealjs/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'revealjs/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>