Location: guide/presentations/ccs-report-examples/ccs-examples.md

bkuhn
More slides for CCS examples from a long time ago.
  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
% Examples of CCS Reports
% Bradley M. Kuhn & Karen M. Sandler
% Tuesday 9 May 2017
# CCS
Complete, Corresponding Source
# How GPLv3 says CCS.
<hr/>
> The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities.
<span class="fitonslide">
<p align=right>
&mdash; GPLv3&sect;1
</p>
</span>
# How GPLv2 says CCS.
<hr/>
> You may copy and distribute the Program (or a work based on it, under
> &sect; 2) in object code or executable form under the terms of &sect; 1
> &amp; 2 above provided that you &hellip; [a]ccompany it with the complete
> corresponding machine-readable source code &hellip; The source code for a
> work means the preferred form of the work for making modifications to it.
> For an executable work, complete source code means all the source code for
> all modules it contains, plus any associated interface definition files,
> plus the scripts used to control compilation and installation of the
> executable.
<p align=right>
&mdash; GPLv2&sect;3
</p>
</span>
# The 11 Words That Consumed My Life
+ GPLv2 enforcement, for embedded products, is all about the these eleven
words.
+ I could give an entire talk on any one of these 11 words.
+ Yes, I can even give 20-30 minute treatises on each use of &ldquo;the&rdquo;.
+ Yet, when enforcement processes are at their best, they're about the spirit
behind these words, not the words themselves.
<hr>
> the scripts used to control compilation and installation of the executable.
<p align=right>
&mdash; GPLv2&sect;3
</p>
</span>
# The 11 Words That Consumed My Life
+ Basic reference rule:
+ Can a developer reasonably skilled in the art of embedded software
build your sources, take the (copylefted) executables and install
them?
+ Enforcement spends its most attention on testing CSS
&ldquo;candidates&rdquo; to verify that.
<hr>
> the scripts used to control compilation and installation of the executable.
<p align=right>
&mdash; GPLv2&sect;3
</p>
</span>
# CCS "Round" Reports
+ Evaluate each CCS candidate.
+ Someone "skilled in the art" attempts to build.
+ Detailed notes are sent, asking for new CCS candidate "round".
+ Some anonyomized real world examples.
# No Build Instructions
<hr/>
The primary issues we found were a dearth of build instructions as well
as a complete lack of installation instructions. There was no
information that mentioned how one might build each package so we had to
guess about which Makefile and/or build script to run for each package.
And in many cases it was not possible or straight-forward to build - this
must be resolved in the next source candidate.
# Making General Recommendations
<hr/>
We generally recommend that the source release be a single file (ie. one
tarball containing all packages required for the build) that includes a
README or similar in the main directory explaining exactly how to build
and install all of the packages. See section 21.2 of
http://compliance.guide/pristine-example for an excellent example.
# Suspicious, But Not Captious.
<hr/>
Also, we noticed that some packages mentioned in the "OPEN SOURCE
SOFTWARE NOTICE" included with the device (and also downloaded as part of
the source release; see
Open_Source_Software_Notice_and_Privacy_Policy.pdf ) could not be found
in the source release. For example, we found "Software: Samba 3.0.XX" in
the notice, but could not find any trace of Samba in the source release.
Please ensure that all the software included in the notice is included in
the source release as well.
# Nesting Doll Packages
<hr/>
Once extracted, the 3 .rar files above produce the following output
files:
* busybox-1.21.1.rar
* AB_A0101.123.tar.gz
* source.rar
* a small text file that gives two-word descriptions of the above files
# Actual(ly Trying to) Build
<hr/>
This file included no instructions for how one might build it so we
tried to run "make" but received the following error:
$ make
.../busybox-1.21.1/scripts/gcc-version.sh: line 11:
arm-none-linux-gnueabi-gcc: command not found
# Toolchain?
+ The toolchain is rarely considered mandatory as part of &ldquo;the
scripts&rdquo;.
+ Admittedly, it doesn't *control* compilation, it *is* compilation.
+ The script here is explaining precisely what type of toolchain is needed.
+ Something like: &ldquo;GCC vX built with the following ./configure
line&rdquo; is usually adequate.
+ But including the toolchain is a nice step to make it easy for your users.
<hr>
> the scripts used to **control compilation** and installation of the executable.
<p align=right>
&mdash; GPLv2&sect;3
</p>
</span>
# We Guess at Compiler Anyway
<hr/>
So we searched for an arm-none-linux-gnueabi- cross-compiler in the
other files but could not find one. We then tried to use our own (be
editing the PATH appropriately), which did get us past this error. Note
that this is not acceptable in a source release - the cross-compiler
that a user must use needs to be clearly indicated (name, version, etc.)
and/or included with the source release.
# Feedback on Small Problems
<hr/>
Once we had the custom cross-compiler configured, we then ran into these
errors:
$ make
.../busybox-1.21.1/scripts/gen_build_files.sh: Permission denied
make: *** [gen_build_files] Error 127
$ make
.../busybox-1.21.1/scripts/mkconfigs: Permission denied
make: *** [include/config/MARKER] Error 126
$ make
/bin/sh: applets/usage_compressed: Permission denied
make[1]: *** [include/usage_compressed.h] Error 126
make: *** [applets_dir] Error 2
$ make
.../busybox-1.21.1/scripts/trylink: Permission denied
make: *** [busybox_unstripped] Error 126
In each case, we found the mentioned file and then added executable
permissions to it (ie. "chmod u+x scripts/gen_build_files.sh"). This
must be fixed in the next source release - please set the executable
bits on the above files appropriately in the archive file you
distribute.
# Install Instructions missing
<hr/>
After fixing the above, a "busybox" binary was generated. However,
there were no instructions to indicate how one might install this binary
on the device. Such instructions are required by GPLv2, under which
BusyBox is licensed. Please include the instructions in your next
source release.
# Build "Only Seems" To build
<hr/>
For the AAB_A0101.123.tar.gz package, we ran "./build.sh", the build
took about 140 seconds, which is less than one would expect for building
all of the programs listed in the "OPEN SOURCE SOFTWARE NOTICE". The
only files we could immediately find that were clearly the result of
this "./build.sh" invocation were some kernel image binaries, found in
path/path/path/path/path/KERNEL_OBJ . This path was not mentioned at
all and we had to guess at where they might be.
# Maybe Proprietary Kernel Modules?
<hr/>
Furthermore, there were no .ko files generated, which is abnormal for a
build of the kernel, Linux. Please ensure that all .ko files which are
used on the system are generated with "./build.sh" or a similar script.
# Weird versioning
<hr/>
* The following libraries have different versions in the firmware than
is built from the candidate CCS. Specifically, your candidate CCS
contains version "1800", and the firmware has version "2400". Since
most of these libraries are licensed under the LGPL, you are required
to have the complete, corresponding source present for the correct
version as distributed in the firmware. You also must include the
"scripts to control compilation and installation of the executable".
* lib/libgio-2.0.so.0.2400.2
* lib/libglib-2.0.so.0.2400.2
* lib/libgmodule-2.0.so.0.2400.2
* lib/libgobject-2.0.so.0.2400.2
* lib/libgthread-2.0.so.0.2400.2
* lib/libz.so.1.2.5 (version 1.2.2 is provided in the sources)
# Weird Build Issues Over Many Candidates
<hr/>
You mentioned in your Round 6 commentary that you have corrected the
thatlib issues. However, we are unable to see what you mean. There are
now two copies of thatlib, one in 2624.7_524/uclinux-rootfs/lib/thatlib/,
as well as the one in yourlibs. We aren't sure which one you intend to
be built to generate the binaries on the firmware. When we try to build
the yourlibs one from scratch, by cleaning the whole area, we get the
following build issues. Here's what we did:
# Getting Really build-technical
<hr/>
We ran:
make -C libsrc/thatlib install
which did not work because of a missing Makefile error. We read the
build source and discovered that the Makefile, etc, for that directory
is generated by running:
cd libsrc/thatlib/thatlib-0.9.22_mipsel-uclibc; sh configure_thatlib_mipsel-uclibc
Once we did that
make -C libsrc/thatlib install
worked correctly. The only remaining binaries were in build source and
discovered that the Makefile, etc, for that directory is generated by
running:
cd libsrc/thatlib/thatlib-0.9.22_mipsel-uclibc; sh configure_thatlib_mipsel-uclibc
# Getting Really build-technical
<hr/>
Once we did that
make -C libsrc/thatlib install
worked correctly. The only remaining binaries were in
./libsrc/thatlib/\{YOURLIB_ROOT_DIR\}/ which looks like a build with a
misconfigured environment somehow, so we simply removed that
directory.
Then, after running make clean, thatlib failed with the following
errors. Random .o/.so files laying around in the thatlib source
directory, and then it failing to build correctly after they are
removed. If there some set of .so files you claim are not required
as part of the C&CS since thatlib is LGPL'd, we understand that, but
the rest of the sources must build and install those other .so's.
Here's the build error we get in the bdvdlibs version:
# Getting Really build-technical
<hr/>
mkdir .libs/libthatlibwm_default.a.tmp
(cd .libs/libthatlibwm_default.a.tmp && ar x ../../.libs/libthatlibwm_default.a)
mkdir .libs/libthatlibwm_default.a.tmp
(cd .libs/libthatlibwm_default.a.tmp && ar x ../../.libs/libthatlibwm_default.a)
/opt/toolchains/crosstools_sf-linux-2.6.18.0_gcc-4.2-9ts_uclibc-nptl-0.9.29-20070423_20080702/bin//mipsel-uclibc-
ld -o libthatlibwm_default.o -r .libs/libthatlibwm_default.a.tmp/*.o
/opt/toolchains/crosstools_sf-linux-2.6.18.0_gcc-4.2-9ts_uclibc-nptl-0.9.29-20070423_20080702/bin//mipsel-uclibc-
ld: .libs/libthatlibwm_default.a.tmp/default.o: Relocations in generic ELF (EM: 3)
/opt/toolchains/crosstools_sf-linux-2.6.18.0_gcc-4.2-9ts_uclibc-nptl-0.9.29-20070423_20080702/bin//mipsel-uclibc-
ld: .libs/libthatlibwm_default.a.tmp/default.o: Relocations in generic ELF (EM: 3)
/opt/toolchains/crosstools_sf-linux-2.6.18.0_gcc-4.2-9ts_uclibc-nptl-0.9.29-20070423_20080702/bin//mipsel-uclibc-
ld: .libs/libthatlibwm_default.a.tmp/default.o: Relocations in generic ELF (EM: 3)
/opt/toolchains/crosstools_sf-linux-2.6.18.0_gcc-4.2-9ts_uclibc-nptl-0.9.29-20070423_20080702/bin//mipsel-uclibc-
ld: .libs/libthatlibwm_default.a.tmp/default.o: Relocations in generic ELF (EM: 3)
.libs/libthatlibwm_default.a.tmp/default.o: could not read symbols: File in wrong format
make[4]: *** [libthatlibwm_default.o] Error 1
# Proprietary Linux Modules Are Everywhere
<hr/>
We did find one .ko file that was already included in the package, but
wasn't built when we ran "./build.sh". This is
path/path/android_X.X/device/device-type/mydevice.ko , which notes that
its license is "GPL v2" in the modinfo, but for which we could find no
source code in the source release. Please ensure that the source code
for mydevice.ko is included in the next source candidate.
# Proprietary Linux Modules Are Everywhere
<hr/>
* The following files are derivative of the kernel named Linux and
therefore covered by the GPL. However, no source code, scripts to
control compilation nor installation are included in your CCS
candidate:
lib/modules/myfilesystem.ko
lib/modules/mydevicecontroller.ko
lib/modules/myblockdevice.ko
lib/modules/mypcicard.ko
# Non-Technical GPL Compliance Issues
<hr/>
Regarding over the air updates: we'd like to see a screenshot or other
details documenting what has now been implemented by BestBuy to make
sure the offer for source appears to users appropriately after
upgrade. There was a consensus reached on the last conference call
how this would be done, so we only need follow up and implementation
on that.
# Binary Comparison.
<hr/>
Note that we did not receive a firmware image to compare this with
(though we do have the device). Company's website did not appear to
have any firmware images available for download. It would be helpful to
have such an image for the next CCS check.
The above source candidate was downloaded from
http:///sourcez.company.com/en/search/index.htm?keywords=X1234Y, which
was alluded to in Company's 2017-01-18 email to us that said:
"You can check this website
http://sourcez.company.com/en/search/index.htm "
The email did not mention how to use that website, but we found that by
entering "X1234Y" into the top right search box that we could find the
source file list.
Note that the offer for source included in the web UI of the device said
to email NAME@COMPANY.com , which is how the above instructions for
downloading the source were received.
# A Pristine Example
+ Enforcement must often use a &ldquo;know it when I see it&rdquo; standard.
+ i.e., can we take your CCS build it, and install it?
+ We've reached compliant CCS with hundreds of companies:
+ but that didn't mean the CCS was pretty.
+ Thanks to ThinkPenguin, we finally have an example of beautiful embedded
product compliance.
# Lessons Learned from Pristine Example
+ The full paper for this talk is available online:
+ [compliance.guide/pristine-example](http://compliance.guide/pristine-example)
+ It's part of the larger tutorial called [*Copyleft and the GNU General
Public License: A Comprehensive Tutorial and Guide*](https://copyleft.org/guide/)
at copyleft.org.
# Give a roadmap in a README
+ Scripts doesn't only mean shell scripts and Makefiles.
+ Think of the script of a play or movie.
+ If your build process includes human intervention &hellip;
+ &hellip; then the script are a written explanation of what the human must
do.
<hr>
> **the scripts** used to control compilation and installation of the executable.
<p align=right>
&mdash; GPLv2&sect;3
</p>
</span>
# ThinkPengiun's README
A file called “README” at the top-level directory said:
In order to build firmware images for your router, the following needs to be installed:
gcc, binutils, bzip2, flex, python, perl, make, find, grep, diff, unzip,
gawk, getopt, libz-dev and libc headers.
Please use “make menuconfig” to configure your appreciated configuration
for the toolchain and firmware. Please note that the default configuration
is what was used to build the firmware image for your router. It is advised
that you use this configuration.
Simply running “make” will build your firmware. The build system will
download all sources, build the cross-compile toolchain, the kernel and all
chosen applications.
To build your own firmware you need to have access to a GNU/Linux system
(case-sensitive filesystem required).
# Make Sure It Builds
+ Can your CCS pass this test?
+ Give you source release to another developer from another department.
+ Ask them to follow the instructions you wrote.
+ They should get the equivalent binaries you get in building.
+ Very few organizations bother to do this.
+ It's probably the most useful step to verify compliance, yet *no*
compliance process recommendations I've ever seen include this.
<hr>
> the scripts used to **control compilation** and installation of the executable.
<p align=right>
&mdash; GPLv2&sect;3
</p>
</span>
# It's not &ldquo;make install&rdquo;
+ Server system software can offer a &ldquo;make install&rdquo; that
reasonable works to meet installation requirements.
+ Embedded products are admittedly difficult to install.
+ To comply here, you'll usually just have write out the instructions.
+ It is required; don't skip this part.
<hr>
> the scripts used to **control** compilation and **installation** of the executable.
<p align=right>
&mdash; GPLv2&sect;3
</p>
</span>
# Missing hardware components
+ Inclusion of specialized installation hardware is not a
&ldquo;script&rdquo;.
+ In our ThinkPenguin example, we had to go buy a USB serial adapter to
install the modified firmware.
+ Just tell the user what they have to go buy for the install to work.
# More Info / Talk License
<img align="right" src="cc-by-sa-4-0_88x31.png" />
+ Specific Sections of Copyleft Guide relating to these topics:
- [The Pristine Example](https://copyleft.org/guide/comprehensive-gpl-guidech22.html#x29-15900021)
- [Details of a Compliant Distribution](https://copyleft.org/guide/comprehensive-gpl-guidech16.html#x21-12700015)
<span class="fitonslide">
<p>Presentation and slides are: Copyright &copy; Bradley M. Kuhn (2008&ndash;2011, 2015, 2017), Karen M. Sandler (2017), and are licensed under the <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/legalcode">Creative Commons Attribution-Share Alike 4.0 International License</a>. </p>
</span>