summaryrefslogtreecommitdiffstats
path: root/NLnet/porting_replicant_to_android9/porting_replicant_to_android9.tex
blob: b8cb7cb39962cc6a74ebf08e832bda4d0405e448 (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
\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage[a4paper]{geometry}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{longtable}
%%\usepackage{showframe}

\title{Porting Replicant to Android 9}
\author{Denis 'GNUtoo' Carikli}
\date{\today}

\begin{document}

\maketitle

\section{
  Disclamers:
}

\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{
  Deliverables
}

\subsection{
  First month
}

\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{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
  7H &
  \begin{itemize}
  \item{Make the the touch keys Linux driver work.}
  \end{itemize} & Upstream the missing parts if time allows. \\
  \hline
  7H &
  \begin{itemize}
  \item{Make the Linux AAT1290 flash led driver work.}
  \end{itemize} & Upstream the missing parts if time allows. \\
  \hline
  7H &
  \begin{itemize}
  \item{rebrand LineageOS as Replicant}
  \end{itemize} & \\
  \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
  \hline
  \multicolumn{3}{|c|}{Total: 147h (aproximately one month) }\\
  \hline
\end{longtable}

\subsection{
  Second month
}

\begin{longtable}[!t]{|p{1cm}|p{6cm}|p{6cm}|}
  \hline
  Time estimation & Task & Comments \\
  \hline
  \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: 147h (aproximately one month) }\\
  \hline
\end{longtable}

\subsection{
  Third month
}

\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
  14H &
  \begin{itemize}
  \item{Add partial support for 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
  \multicolumn{3}{|c|}{Total: 154h (aproximately one month) }\\
  \hline
\end{longtable}

\subsection{
  Forth month
}

\begin{longtable}[!t]{|p{1cm}|p{6cm}|p{6cm}|}
  \hline
  Time estimation & Task & Comments \\
  \hline
  \hline
  21h &
  \begin{itemize}
  \item{Create a recovery}
  \end{itemize} & \\
  \hline
  6h &
  \begin{itemize}
  \item{Add internal WiFi support and validate the functionality}
  \end{itemize} &
  This assumes that no big issues are encountred 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 encountred, 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
  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
  \multicolumn{3}{|c|}{Total: 82h (aproximately two weeks) } \\
  \hline
\end{longtable}

\begin{thebibliography}{99}

\bibitem{CustomROMs}
  \begin{itemize}
    lineag-16.0 branch in \url{https://github.com/CustomROMs/android\_local\_manifests\_i9300} and associated repositores.
  \end{itemize}

\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}