summaryrefslogtreecommitdiffstats
path: root/NLnet/porting_replicant_to_android9/porting_replicant_to_android9.tex
blob: 2c334a59b97554785d819d49c22a313620ad737b (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
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
\documentclass[a4paper,titlepage]{article}
\usepackage[english]{babel}
\usepackage[a4paper]{geometry}

\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{longtable}
\usepackage{graphicx}

\author{Denis 'GNUtoo' Carikli \and NLnet}
\date{\today}

\begin{document}
\begin{titlepage}
  \centering
  \includegraphics{output/10037B00000023D0000005804A3C085245797F4E.png}

  \vspace{1.5cm}
  {\huge\bfseries Memorandum of Understanding\par}
  {\Large Number: 2019-02-105\par}
  \vfill
\end{titlepage}

\section{"Finish porting Replicant to a newer Android version" Project}

\parindent 0mm The parties :
\vskip 0.2cm

\leftskip 2cm Stichting NLnet, domiciled in Science Park 400, 1098 XH Amsterdam,
The Netherlands, referred to as "NLnet" in this document, represented by Bob
Goudriaan,

\leftskip 0cm and

\leftskip 2cm Denis Carikli, an individual domiciled (add address here) in
France (Denis Carikli),

\leftskip 0cm given that:

\begin{itemize}
  \item{
    NLnet has the mission "to promote the exchange of electronic information and
    all that is related or beneficial to that purpose"
  }

  \item{
    NLnet manages the NGI0 PET Fund, a fund dedicated to Privacy and Trust
    Enhancing technologies. The fund was established with financial support from
    the European Commission's Next Generation Internet programme, under the
    aegis of DG Communications Networks, Content and Technology under grant
    agreement No 825310..
  }

  \item{
    NLnet collaborates with a number of other organisations within NGI Zero to
    help improve the quality, sustainability, accessibility and security of
    projects in a structured way.
  }

  \item{
    Many users feel locked into the dominant Android mobile ecosystem, but still
    have to accept potential privacy breaches because of the lack of
    alternatives.
  }

  \item{
    Denis Carikli is the lead developer of Replicant - a fully free
    (as in freedom) software Android distribution which is approved by the Free
    Software Foundation.
  }

  \item{
    New features are continuously pushed to the upstream Android project and at
    the same time new devices with different hardware components are released to
    market, which need to be incorporated. However, in a number of cases these
    depend on potentially untrustworthy binary blobs that cannot be used as
    such.
  }

  \item{
    In order to let Replicant become a viable alternative to users, as a
    platform it needs to get (and remain) in sync with the upstream Android
    project - so apps developed for vanilla Android can continue to run on
    Replicant too. This involves the development of free and open source
    components (including drivers) that can adequately replace the limited and
    potentially insecure proprietary versions.
  }

  \item{
    Denis Carikli has expressed the intention to dedicate significant private
    time to advancing this important effort.
  }

  \item{
    NLnet thinks that this project falls within its mission and the mission of
    the NGI0 PET Fund, and wants to facilitate such a contribution.
  }
\end{itemize}

agree to the following:
\begin{itemize}
    \item{
      Denis Carikli has written the proposal "Finish porting Replicant to a
      newer Android version" which is attached to this document as Annexe I.
      Annexe I forms an integral part of this Memorandum of Understanding.
      If and where statements in this annexe or other annexes are in
      contradiction with one or more statements in the main memorandum text, the
      statement or statements in the main memorandum text will prevail.
    }

    \item{
      Denis Carikli is voluntarily undertaking the project, and is solely
      responsible for all aspects of the project including planning and
      coordination as well as involving contributors and partners - as long as
      such happens in line with the terms and spirit of this MoU. The source
      code of the Project shall be made publicly available under a suitable free
      and open source software license, as recognised by OSI or FSF.
    }

    \item{
      As the signatory of this MoU, Denis Carikli shall act as official point of
      contact in the context of this project; it is the responsibility of Denis
      Carikli to notify NLnet in case of any changes.
    }

    \item{
      NLnet commits to make a reservation for the amount of 30000 EUR to Denis
      Carikli in order to support the "Finish porting Replicant to a newer
      Android version" project. The reservation is bound to the proposal as
      contained within Annexe I of this MoU.
    }

    \item{
      Should the project fail to complete the goals described in Annexe I,
      partially or in full, there is no other consequence than the
      termination of this MoU.
    }

    \item{
      Denis Carikli commits to keep the user and developer community up to date
      with progress made within the project at least every two months (more
      often is never a bad thing) and will maintain a public status page for the
      project to keep the wider internet community informed. As a courtesy,
      Denis Carikli may send non-public updates about the status of the project
      to NLnet, but there is no obligation whatsoever to do so - NLnet is not
      operationally involved with the project; its only interest is the public
      benefit that is the result of the project succeeding in reaching its
      goals.
    }

    \item{
      Donations may be claimed up to the reserved amount within a maximum of six
      months after the proposed end of the project. Donations will be final when
      the specified milestones or previously agreed partial deliveries have been
      verified to have been completed. Payments will subsequently be made by
      wire transfer into a bank account designated by Denis Carikli.
    }

    \item{
      NLnet and Denis Carikli may issue one or more individual or joint public
      statements announcing the project and the financial support from NLnet and
      the NGI0 PET Fund. Denis Carikli is also encouraged to visibly and vocally
      acknowledge this contribution where possible — e.g. through the project
      website, promotional materials, in presentations and in source code.
    }

    \item{
      The involvement with any particular person(s) or organisations will be on
      the understanding that these coordinate their activities in agreement with
      Denis Carikli, in the spirit of cooperation, and in an effort to achieve
      the results of the "Finish porting Replicant to a newer Android version"
      Project. Denis Carikli appreciates the support from the experts and
      organisations involved with NGI Zero to ensure that the results of Finish
      porting Replicant to a newer Android version will be of the widest
      possible benefit to all.
    }

    \item{
      This Memorandum of Understanding cannot be seen as any kind of employment
      agreement or business contract. NLnet nor any of the organisations within
      NGI Zero receive any goods or services as a result of this MoU. Any
      payments are to be made as charitable donations to Denis Carikli in the
      light of a voluntary contribution to the public benefit such as defined
      within the statutory mission of NLnet foundation. Denis Carikli is
      responsible for paying any and all taxes or other fees with regard to this
      grant, should there be any, and to inform any relevant authorities within
      their country of these donations should this be legally required.
    }
  \end{itemize}

\begin{tabular}{ l l }
  On behalf of NLnet &
  \\
  Bob Goudriaan &
  Denis Carikli
  \\
  \rule{2.4cm}{0.4pt} &
  \rule{2.4cm}{0.4pt}
  \\
  \rule{2.4cm}{0.4pt} &
  \rule{2.4cm}{0.4pt}
  \\
  (Place) (Date) &
  (Place) (Date)
  \\
\end{tabular}

\section{Annexe I}

\section{
  Disclaimers:
}

\begin{itemize}
\item{
  Before applying for a grant in the context of the European Union's Next
  Generation Internet, Joonas Kylmälä already started working on porting the
  Galaxy S III 4G (i9305) to Android 9.
  That prior work is not funded by the grant but can be used to achieve faster
  the goals set in the  deliverable.
  As part of that effort he managed to boot that device under Android 9, without
  the nonfree software graphics libraries. He based his work on the Android
  Open Source Project (AOSP) source code.
  The graphical interface was way too slow to be usable, however it enabled him
  to validate that the device could boot.
}

\item{
  As part of the European Union's Next Generation Internet, I already started
  working on porting Joonas Kylmälä's work on top of LineageOS 16, however I
  had one or more complicated issues related to the Android build system that
  I didn't manage to solve.
  However at some point I found exiting work\cite{CustomROMs} that I wasn't
  aware of, which was meant to add support for the Galaxy SIII (i9300) to
  LineageOS.
  I started basing my work on top of this work too not to waste too much time
  with the build issues mentioned above (as I already spent more than one week
  on that issue).
}

\end{itemize}

\section{
  Deliverable
}

\subsection{
  Boot a device under Android 9 without known nonfree libraries
}

\begin{longtable}[!t]{|p{1cm}|p{6cm}|p{6cm}|}
  \hline
  Time estimation & Task & Comments \\
  \hline

  \hline

  7h &
  \begin{itemize}
  \item{Validate that Android 9 builds under a GNU/Linux distribution
    compliant with the FSF's Free Software Distribution Guidelines (FSDG)
    and keep using it to make sure it keeps working.}
  \end{itemize} & \\

  \hline

  21h &
  \begin{itemize}
  \item{
    Choose an Android distribution (like AOSP or LineageOS) to base the work on
  }
  \item{Add very partial support for one of the following devices:
    \begin{itemize}
    \item{Galaxy SIII (I9300)}
    \item{Galaxy SIII 4G (I9305)}
    \end{itemize}
  }
  \item{Make that device boot without proprietary libraries}
  \item{Make sure that the kernel is also built from the Android build system}
  \item{Make sure it still builds with an FSDG compliant distribution}
  \item{Document the build procedure along the way}
  \end{itemize} &
  There is a small risk of having to change distribution and devices.  \\

  \hline

  14h &
  \begin{itemize}
  \item{Add partial support for a second device which will one of the following devices:
    \begin{itemize}
    \item{Galaxy SIII (I9300)}
    \item{Galaxy SIII 4G (I9305)}
    \end{itemize}
  } and factorize the code with the one that is already supported.
  \end{itemize}
  & \\

  \hline

  \hline
  \multicolumn{3}{|c|}{Total: approximately 42h}\\
  \hline

\end{longtable}

\subsection{
  Easy Linux upstreaming work
}

\begin{longtable}[!t]{|p{1cm}|p{6cm}|p{6cm}|}
  \hline
  Time estimation & Task & Comments \\
  \hline

  \hline

  7h &
  \begin{itemize}
  \item{Make the the touch keys Linux driver work and upstream it in Linux.}
  \end{itemize} & \\

  \hline

  7h &
  \begin{itemize}
  \item{Make the Linux AAT1290 flash led driver work and upstream it in Linux.}
  \end{itemize} & \\

  \hline

  \hline
  \multicolumn{3}{|c|}{Total: approximately 14h }\\
  \hline

\end{longtable}


\subsection{
  Modem work
}

\begin{longtable}[!t]{|p{1cm}|p{6cm}|p{6cm}|}
  \hline
  Time estimation & Task & Comments \\
  \hline

  \hline

  7h &
  \begin{itemize}
  \item{
    port and cleanup the the Galaxy SIII (i9300) modem Linux driver from 4.16 to
    5.0
  }
  \end{itemize} &
  The driver to port is available at \url{https://github.com/fourkbomb/linux/}
  in the modem branch \\

  \hline

  157h &
  \begin{itemize}
  \item{port libsamsung-ril and libsamsung-ipc to Android 9}
  \item{Make the modem driver and libsamsung-ipc work together}
  \end{itemize} &
  The port of libsamsung-ipc and libsamsung-ril will be attempted
  with a compatibility layer at first. Devices manufacturer shipping
  new devices with Android 9 are probably required not to use an
  approach like that\cite{hal-types}\cite{HIDL}.
  This issue will need to be looked in more details at later.

  This will be done to be able to focus more on the modem driver,
  port and if possible work to upstream it.

  Later (which is not part of this deliverable), we will then need
  to look if the approach chosen is already using a "binderized HAL"
  and if not, what are the consequences of converting the code to use
  it, because even if libsamsung-ipc has already been used used in
  GNU/Linux, we still want to enable GNU/Linux distributions to easily
  use libsamsung-ril as well.
  \\

  \hline

  \hline
  \multicolumn{3}{|c|}{Total: approximately 164h }\\
  \hline

\end{longtable}


\subsection{
  Other hardware support
}

\begin{longtable}[!t]{|p{1cm}|p{6cm}|p{6cm}|}
  \hline
  Time estimation & Task & Comments \\
  \hline

  \hline

  70h &
  \begin{itemize}
  \item{port the sensors libraries and other device specific libraries}
  \end{itemize} &  \\

  \hline

  70h &
  \begin{itemize}
  \item{Add support for Audio with the upstream kernel driver}
  \end{itemize} &
  Might be faster, depending on what Android 9 uses. \\

  \hline

    6h &
  \begin{itemize}
  \item{Add internal WiFi support and validate the functionality}
  \end{itemize} &
  This assumes that no big issues are encountered and that Android 9
  already supports upstream Linux standard WiFi interfaces like
  nl80211 or Wext.
  Note that the internal WiFi don't work without nonfree firmwares.
  The Replicant project doesn't ship the firmwares nor advises or
  instructs users on how to install them.
  This however don't prevent users to install them by their own.
  \\

  \hline

  20h &
  \begin{itemize}
  \item{Add external WiFi support and validate the functionality}
  \end{itemize} & This might be very tricky. This is known to work
  on Replicant 6 on some of the supported devices, but it has
  reliability issues, which seem to depend a lot on the device
  used and the charge of the battery. This is most probably due
  to the fact that some devices aren't able to provide enough
  current to the external dongle. More research will be needed
  later (which is not part of this deliverable) to better
  understand and characterize the issue for some of the devices.
  If no big software issues are encountered, I will try to make
  it work as well as on Replicant 6.
  This is required for basic usage as the Internal WiFi doesn't
  work without nonfree firmwares. \\

  \hline

  \hline

  \multicolumn{3}{|c|}{Total: approximately 166h}\\
  \hline

\end{longtable}

\subsection{
  Release an image
}

\begin{longtable}[!t]{|p{1cm}|p{6cm}|p{6cm}|}
  \hline
  Time estimation & Task & Comments \\
  \hline

  \hline

  7h &
  \begin{itemize}
  \item{rebrand LineageOS as Replicant}
  \end{itemize} & \\

  \hline

  14h &
  \begin{itemize}
  \item{Find, remove and document proprietary software in the source code.}
  \end{itemize} & \\

  \hline

  14h &
  \begin{itemize}
  \item{Find, remove and document privacy issues in the source code.}
  \end{itemize} & \\

  \hline

  21h &
  \begin{itemize}
  \item{Create a recovery}
  \end{itemize} & \\

  \hline

  35h &
  \begin{itemize}
  \item{create new update the install and upgrade instructions }
  \end{itemize} &
  The instructions will need to be made modular in order to be
  easily changed. More specifically, to make a change that
  applied to all the devices, you needed to change
  each device-specific instructions, which highly discourage
  contributing to the instructions.
  The instructions will also need to be as simple as
  possible to enable users with very basic command line
  usage to use them.
  \\

  \hline

  \hline
  \multicolumn{3}{|c|}{Total: approximately 91h}\\
  \hline

\end{longtable}

\begin{thebibliography}{99}

\bibitem{CustomROMs}
    lineage-16.0 branch in
    \url{https://github.com/CustomROMs/android\_local\_manifests\_i9300} and
    associated repositories.

\bibitem{hal-types}
  \url{https://source.android.com/devices/architecture/hal-types}

\bibitem{HIDL}
  \url{https://source.android.com/devices/architecture/hidl/}

\end{thebibliography}

\end{document}