Added [in-progress] Developer Guides
[AGL/documentation.git] / docs / 2_Architecture_Guides / 2.2_Security_Blueprint / 8_Update_(Over_The_Air) / 1.2.8.1_Firmware_Over_The_Air.md
1 ---
2 title: FOTA
3 ---
4
5 # Firmware Over The Air
6
7 The firmware update is critical since its alteration back to compromise the
8 entire system. It is therefore necessary to take appropriate protective
9 measures.
10
11 AGL includes the _meta-updater_ Yocto layer that enables OTA software updates
12 via [Uptane](https://uptane.github.io), an automotive-specific extension to [The
13 Update Framework](https://theupdateframework.github.io/). Uptane and TUF are
14 open standards that define a secure protocol for delivering and verifying
15 updates even when the servers and network--internet and car-internal--aren't
16 fully trusted.
17
18 _meta-updater_ includes the application
19 [`aktualizr`](https://github.com/advancedtelematic/aktualizr), developed
20 Advanced Telematic Systems (now part of HERE Technologies) that enables OTA for
21 an ECU. `aktualizr` combined with Uptane is suitable for updating the firmware,
22 software, and other packages on even functionally critical ECUs. `aktualizr` can
23 be enabled with the free, open souce backend
24 [`ota-community-edition`](https://github.com/advancedtelematic/ota-community-edition).
25
26 This FOTA update mechanism can be enabled through the `agl-sota` feature.
27
28 ## Building
29
30 To build an AGL image that uses `aktualizr`, the following can be used.
31
32 ```
33 source meta-agl/scripts/aglsetup.sh -m <machine> agl-sota <other-features...>
34 ```
35
36 During the build, _meta-updater_ will use credentials downloaded from
37 `ota-community-edition` to sign metadata verifying the build as authentic. These
38 signatures are part of the Uptane framework and are used to verify FOTA updates.
39
40 ## Atomic Upgrades with Rollbacks
41
42 `aktualizr`'s primary method of updating firmware is to use `libostree` with
43 binary diffs. The binary diffs use the least amout of bandwidth, and by it's
44 nature `libostree` stores current and previous firmware versions on disk or in
45 flash memory to allow for rollbacks.
46
47 `libostree` is a content addressable object store much like `git`. Versions are
48 specified via SHA2-256. These hashes are signed in the Uptane metadata and are
49 robust against cryptographic compromise.