summaryrefslogtreecommitdiffstats
path: root/36c3/Replicant_sustainability/Replicant_sustainability.tex
blob: 9863bebbeda8dc10b42c5a3e14702dc04919e9ac (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
\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{color}
\usepackage{graphicx}
\usepackage{ifthen}
\usepackage[utf8]{inputenc}
\usepackage{ulem}
\usepackage{listings}
\usepackage{pdfpages}
\usepackage{tikz}
\usepackage{xtab}

\newcommand{\outputpicture}[2] {
  {\includegraphics[scale=#1]{output/#2}}
}
\newcommand{\devicepicture}[1] {
  {\includegraphics[scale=0.5]{../../external_resources/replicant_website/images/supported-devices/#1.png}}
}

%% \usetheme{Singapore}

\title{Extending the lifetime of smartphones with Replicant, a fully free Android distribution}
\author{Denis 'GNUtoo' Carikli and David 'dllud' Ludovino}
\date{\today}

\begin{document}

\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}

\begin{frame}
  \center{Introduction}
\end{frame}

\begin{frame}
  \center{Replicant:}
  \begin{itemize}
  \item Fully free Android distribution approved by the FSF.
  \item But the hardware it runs on is not...
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Quick Facts}
  \begin{itemize}
  \item Website: replicant.us
  \item Exists since September 2009.
  \item Currently based on LineageOS.
  \item Android versions:
    \begin{itemize}
    \item Replicant 6: Android 6, last security update: October 2017\cite{last-android-6-update}.
    \item Replicant 9: Android 9, work in progress\cite{porting-to-android-9}.
    \end{itemize}
  \item Supports $\sim$ 10 devices (smartphones and tablets).
  \item $\sim$ 2 full time equivalent contributors and a big community.
  \end{itemize}
\end{frame}

\begin{frame}
  \center{
    Best effort: \\
    minimum feature set required to support a device:
  }
  \begin{itemize}
  \item Display working and graphics fast enough.
  \item Sound working.
  \item Be able to make calls.
  \item etc.
  \item GPS, camera, and other non crucial hardware may not work, or work in later releases.
  \end{itemize}
\end{frame}

{
  \begin{frame}
    \center{A very short introduction on hardware:}
    \outputpicture{0.8}{i9300_hardware.png}
    \begin{itemize}
    \item System on a chip.
    \item Smartphones and the modem.
    \end{itemize}
  \end{frame}
}

{
  \begin{frame}
    \center{Freedom issues in supported devices}
    \outputpicture{0.8}{i9300_hardware.png}
    \begin{itemize}
    \item The cellular network.
    \item The modem firmware.
    \item Other nonfree firmwares.
    \item Bootloaders and TrustZone.
    \item Upstream anti-feature and huge code base.
    \end{itemize}
  \end{frame}
}

\begin{frame}
  \center{Why Android?}
  \begin{itemize}
  \item Advantages:
    \begin{itemize}
    \item GUI and applications adapted to big fingers.
    \item $\rightarrow$ Run on devices that:
      \begin{itemize}
      \item Lack keyboard.
      \item Have capacitive touchscreen and no stylus.
      \item Have very small displays with very high number of pixels.
      \end{itemize}
    \end{itemize}
  \item Issues:
    \begin{itemize}
    \item Part of the GNU/Linux software architecture is light years away: package management and build system, graphics, audio, etc.
    \item Huge unknown code from Google
    \item Meant to run proprietary software, not to empower users.
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Android: from time to market driven architecture to sustainability}
  \begin{itemize}
  \item SOCs, WiFi chips, smartphones and tablets:
    \begin{itemize}
    \item Write the code that work as fast as possible.
    \item Support as many hardware features as possible.
    \item $\rightarrow$ Varying code quality.
    \item $\rightarrow$ Example: One driver rewritten 3 times.
    \end{itemize}
  \item Breaking Kernel API and ABI.
    \begin{itemize}
    \item It can take time (years) to bring in a new framework in Linux.
    \item Example of API breakage: HTC dream audio driver.
    \item Solution: Apps $\leftrightarrow$ Android framework $\leftrightarrow$ HAL $\leftrightarrow$ Kernel.
    \item Getting better in Android: Treble and Generic Kernel images.
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Ugly code is good (for freedom):}
  %% TODO: replace with [blobby from OpenBSD] VS [dirty tux] -> [freedo]
  \begin{itemize}
  \item Having the source code under free software licenses, even if the code quality is bad is crucial for freedom:
    \begin{itemize}
    \item Hardware bringup is often made that way anyway.
    \item Things can be improved later:
      always be cleaned up later or if the code quality is too bad, rewritten from scratch.
    \item Having the source code under a free software license is very important.
    \item Worst case: use the source code as documentation or reverse engineer it (add prints).
    \end{itemize}
  \item $\rightarrow$ We depend on that source code.
  \end{itemize}
\end{frame}

\section{Part II}
\begin{frame}
  \center{Part II}
\end{frame}

\begin{frame}
  \center{Replicant 6 $\rightarrow$ More recent Android.}
\end{frame}

\begin{frame}
  \center{Requirements += Replacable battery:}
  \begin{itemize}
  \item No need to rush to support the device
  \item The device lasts longer
  \item $\rightarrow$ In line with upstreaming longer term work.
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Devices supported by Lineage 16 with a removable battery:}
  \begin{itemize}
    \item Qualcomm MSM8*:
    \begin{itemize}
      \item Fairphone: FP2
      \item LG: G3 (many versions)
      \item OPPO: Find 7a/s
      \item Samsung: Galaxy Note 3 LTE (Many versions)
      \item Samsung: Galaxy S III Neo (2 versions)
      \item Samsung: Galaxy S5 Active
      \item Samsung: Galaxy S5 LTE (Many versions)
      \item Samsung: Galaxy S5 LTE Duos (Many versions)
      \item Wileyfox: Swift
    \end{itemize}
    \item Qualcomm APQ8*
    \begin{itemize}
      \item Samsung: Galaxy S4 (Many versions)
      \item Samsung: Galaxy S4 Value Edition (GT-I9515/L)
      \item Samsung: Galaxy S4 Active
      \item Samsung: Galaxy S5 LTE-A
      \item Samsung: Galaxy S5 Plus
    \end{itemize}
    \item Samsung Exynos 7580:
    \begin{itemize}
    \item Samsung: Galaxy S5 Neo
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Limiting freedom, privacy and security attacks:}
  \begin{itemize}
    \item Isolated modem:
    \begin{itemize}
      \item Modem not in the SOC.
      \item No shared memory (RAM) between the modem and the SOC.
      \begin{itemize}
        \item HSIC: USB-like, the host control re-enumeration.
        \item MIPI: Should be OK, not extensively reviewed.
      \end{itemize}
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Devices supported by Lineage 16 with a removable battery:}
  \begin{itemize}
    \item \sout{Qualcomm MSM8*:} Modem in the SOC
    \begin{itemize}
      \item \sout{Fairphone: FP2}
      \item \sout{LG: G3 (many versions)}
      \item \sout{OPPO: Find 7a/s}
      \item \sout{Samsung: Galaxy Note 3 LTE (Many versions)}
      \item \sout{Samsung: Galaxy S III Neo (2 versions)}
      \item \sout{Samsung: Galaxy S5 Active}
      \item \sout{Samsung: Galaxy S5 LTE (Many versions)}
      \item \sout{Samsung: Galaxy S5 LTE Duos (Many versions)}
      \item \sout{Wileyfox: Swift}
    \end{itemize}
    \item Qualcomm APQ8*
    \begin{itemize}
      \item Samsung: Galaxy S4 (Many versions)
      \item Samsung: Galaxy S4 Value Edition (GT-I9515/L)
      \item Samsung: Galaxy S4 Active
      \item Samsung: Galaxy S5 LTE-A
      \item Samsung: Galaxy S5 Plus
    \end{itemize}
    \item Samsung Exynos 7580:
    \begin{itemize}
    \item \sout{Samsung: Galaxy S5 Neo} Modem $\leftrightarrow$ SOC: shared memory
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Hmmm}
  \begin{itemize}
    \item $\rightarrow$ No Exynos with removable battery and isolated modem.
    \item $\rightarrow$ All the devices supported by Replicant 6.0 have been dropped.
    \item $\rightarrow$ We'd like to support the devices longer...
    \item The APQ* also look interesting, we would need to do more research on it:
    \begin{itemize}
      \item Isolated modem?
      \item Upstream support for the SOC?
      \item Nonfree bootloader ($\sim$ BIOS+GRUB) (signed?)
      \item Probably way more work needed (different modem, more upstreaming work).
    \end{itemize}
    \item We also took the decision when LineageOS didn't support these.
  \end{itemize}
\end{frame}

\section{Part III}
\begin{frame}
  \center{Part III}
\end{frame}

\begin{frame}
    \center{Already supported by Replicant 6.0:}
    \begin{itemize}
      \item Galaxy SIII (I9300): Good upstream status, modem support lacking, and other small fixes to do.
      \item Galaxy Note II (I9300): Good upstream status, modem and display support lacking.
      \item Galaxy SIII 4G (I9305) and Galaxy Note II 4G (N7105): Different modem.
    \end{itemize}
\end{frame}

\begin{frame}
    \center{Making devices more sustainable:}
    \begin{itemize}
      \item $\rightarrow$ Upstream Linux $\rightarrow$ We can support them longer.
      \item $\rightarrow$ Most Replicant users and developers already have one.
      \item $\rightarrow$ Known hardware that works and can still be bought second hand.
      \item Remaining issues:
        \begin{itemize}
          %% $\rightarrow$ Repurpose the device and run GNU/Linux when not supported anymore.
        \item RAM size and new Android versions.
        \item Nonfree bootloader.
        \end{itemize}
    \end{itemize}
\end{frame}

\begin{frame}
  \center{Main blocker: Nonfree bootloader}
    \begin{itemize}
    \item Nonfree $\rightarrow$ Incentive to drop the device.
    \item Partially free u-boot port $\rightarrow$ can't redistribute the nonfree part.
    \item Research to understand if we can make it fully free (XBOOT).
    \item Stock bootloader incompatible with Linux...
    \end{itemize}
\end{frame}

\begin{frame}
  \center{Upstream Linux bootloader requirements}
  Documentation/arm/Booting (since 2003):
  \begin{verse}
    The MMU must be off.

    Instruction cache may be on or off.

    Data cache must be off.
  \end{verse}
\end{frame}

\begin{frame}
    \center{Some funding later...}
\end{frame}

\begin{frame}
    \center{Replicant 9.0:}
    \begin{itemize}
    \item Galaxy SIII booting, modem initialized.
    \item Still work to do(testing, audio, networking, etc.).
    \item Slowed down by conferences and other Replicant work (XBOOT, Replicant 6, etc).
    \end{itemize}
\end{frame}

\begin{frame}
    \center{Future directions:}
    \begin{itemize}
    \item Finish the research on XBOOT.
      \begin{itemize}
        \item https://github.com/xboot/xboot
      \end{itemize}
    \item Look into devices like the PinePhone and the Librem5.
    \item Share more work with GNU/Linux upstream (OFono, other hardware support libraries).
    \end{itemize}
\end{frame}

\begin{frame}
  Licenses:
  \begin{itemize}
  \item The SIM card and BTS pictures comes from \url{https://en.wikipedia.org/wiki/File:Gsm_network.png} and are under the GFDL 1.2 or the Creative commons Attributions-Share ALike 3.0 Unported.
  \item This presentation: CC-BY-SA 4.0 International.
  \item The Galaxy SIII picture: CC-BY-SA 4.0 International.
  \end{itemize}
\end{frame}

\begin{thebibliography}{99}
\bibitem{last-android-6-update}
  \url{https://en.wikipedia.org/wiki/Android_Marshmallow#cite_note-2}
\bibitem{porting-to-android-9}
  \url{https://redmine.replicant.us/projects/replicant/wiki/PortingToAndroid9}
\end{thebibliography}
\end{document}