-
Notifications
You must be signed in to change notification settings - Fork 91
Improved documentation #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 14 commits
6a67ecb
f499b20
e61fd11
7b42ce8
b1f15fe
986f8be
73db85c
d222c1c
5d37810
4cb1274
77b30ca
b97ead8
18c130d
3e03182
392c884
53a9132
999dc94
cedb1b3
1747bd0
476228a
e10cfcc
4956f28
88dfab6
ab86af7
b40e997
45f484f
28c8826
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: Generate documentation | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ docs ] | ||
|
|
||
| jobs: | ||
| docs: | ||
| name: Build documentation | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/[email protected] | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: cachix/install-nix-action@v12 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-20.09 | ||
| - run: nix-build ./docs -A manual -o manual | ||
| - uses: peaceiris/actions-gh-pages@v3 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| publish_dir: ./manual/book | ||
| cname: docs.robotnix.org | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [book] | ||
| language = "en" | ||
| multilingual = false | ||
| src = "src" | ||
| title = "Robotnix" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| { pkgs ? import ../pkgs { } }: | ||
|
|
||
| with pkgs.lib; | ||
| let | ||
| eval = import ../default.nix { inherit pkgs; configuration = { }; }; | ||
|
|
||
| robotnixOptionsDoc = pkgs.nixosOptionsDoc { | ||
| inherit (eval) options; | ||
| }; | ||
|
|
||
| optionsMd = | ||
| let | ||
| options = robotnixOptionsDoc.optionsNix; | ||
| in | ||
| concatStrings (map | ||
| (name: | ||
| let | ||
| option = options.${name}; | ||
| body = '' | ||
| ${option.description} | ||
|
|
||
| '' + optionalString (option ? default) '' | ||
| Default: `${builtins.toJSON option.default}` | ||
|
|
||
| '' + optionalString (option ? example) '' | ||
| Example: `${builtins.toJSON option.example}` | ||
|
||
|
|
||
| '' + '' | ||
| Type: ${option.type} | ||
| ''; | ||
| in | ||
| '' | ||
| - `${name}` | ||
|
|
||
| ${concatMapStrings (line: " ${line}\n") (splitString "\n" body)} | ||
| '' | ||
| ) | ||
| (attrNames options)); | ||
| in | ||
| { | ||
| manual = pkgs.stdenv.mkDerivation { | ||
| name = "manual"; | ||
| phases = [ "unpackPhase" "buildPhase" "installPhase" ]; | ||
| src = ./.; | ||
| nativeBuildInputs = [ pkgs.mdbook ]; | ||
| buildPhase = '' | ||
| cp ${builtins.toFile "options.md" optionsMd} src/options.md | ||
| mdbook build | ||
| ''; | ||
| installPhase = '' | ||
| mkdir $out | ||
| cp -R book $out/book | ||
| cp -R src $out/src | ||
| cp book.toml $out/book.toml | ||
| ''; | ||
| }; | ||
| } | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Summary | ||
|
|
||
| - [Welcome to Robotnix](welcome.md) | ||
danielfullmer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - [Tutorials]() | ||
| - [Installation](installation.md) | ||
| - [OTA Updates](ota.md) | ||
| - [F-Droid Repositories](f-droid.md) | ||
| - [Remote Attestation](attestation.md) | ||
| - [Reference]() | ||
| - [Options](options.md) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| <!-- | ||
| SPDX-FileCopyrightText: 2020 Daniel Fullmer and robotnix contributors | ||
| SPDX-License-Identifier: MIT | ||
| --> | ||
|
|
||
| # Installing for the first time and with verified boot | ||
|
|
||
| It is assumed that you have successfully built your factory image and signed it | ||
| with your own keys, either by using the `factoryImg` Nix output or by running | ||
| `releaseScript`. Make sure that you know the location of the image and the AVB | ||
| signing key. The instructions in this document were tested on the Google Pixel | ||
| 4a (sunfish). Other Pixel phones are similar, but please refer to | ||
| https://source.android.com/setup/build/running | ||
|
|
||
| 0. Before you can begin you have to boot the stock OS, go to "Settings / About | ||
| phone" and tap the "Build number" field 7 times to enable the "Developer | ||
| options" menu. Next go to “Settings / System / Advanced / Developer | ||
| options” and enable “OEM unlocking”. On my device I had to insert a SIM | ||
| card and connect to the network for that, so it looks like you have to | ||
| connect your device with Google at least once. This is part of Google's so | ||
| called Factory Reset Protection (FRP) for anti-theft protection | ||
| (https://grapheneos.org/install#enabling-oem-unlocking). However, [this | ||
| comment](https://www.kuketz-blog.de/grapheneos-das-android-fuer-sicherheits-und-datenschutzfreaks/#comment-52681) | ||
| on a German IT privacy blog suggests that it is sufficient to allow access | ||
| to the captive portal such that the phone thinks it is online. | ||
|
|
||
| 1. First reboot into the bootloader. You can either do that physically by | ||
| turning off your phone and then holding both the POWER and the VOLUME DOWN | ||
| button to turn it back on, or your can connect the phone to your computer | ||
| with USB Debugging turned on and issue | ||
| ```console | ||
| $ adb reboot bootloader | ||
| ``` | ||
|
|
||
| 2. Connect your phone to your computer and run | ||
| ```console | ||
| $ fastboot devices | ||
| 09071JEC217048 device | ||
| ``` | ||
|
|
||
| 3. Unlock the bootloader by running | ||
| ```console | ||
| $ fastboot flashing unlock | ||
| ``` | ||
| Select the option to unlock the device and confirm. | ||
danielfullmer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 4. Flash your custom AVB signing key using | ||
| ```console | ||
| $ fastboot erase avb_custom_key | ||
| $ fastboot flash avb_custom_key avb_pkmd.bin | ||
| $ fastboot reboot bootloader | ||
| ``` | ||
|
|
||
| 5. Unzip the factory image built by robotnix. To flash the image run | ||
| ```console | ||
| $ ./flash-all.sh | ||
| ``` | ||
| The factory image produced by robotnix includes the bootloader and radio | ||
| firmware in addition to the android image. If you are certain the | ||
| bootloader and radio are already up to date, you can instead build the | ||
| standard `img` robotnix output, and flash the image with | ||
| ```console | ||
| $ fastboot -w --skip-reboot update sunfish-img-2020.11.06.04.zip | ||
| ``` | ||
| This will erase the `userdata` partition (`-w`) and prevent the automatic | ||
| reboot after flashing (`--skip-reboot`). | ||
|
|
||
| After flashing with the `flash-all.sh` script or with `fastboot update`, | ||
| return to the bootloader with | ||
| ```console | ||
| $ fastboot reboot bootloader | ||
| ``` | ||
|
|
||
| 6. At this point you want to relock the bootloader to enable the verified boot | ||
| chain. | ||
| ```console | ||
| $ fastboot flashing lock | ||
| ``` | ||
| This step has to be confirmed on the device. | ||
|
|
||
| 7. After rebooting you will be greeted with an orange exclamation mark and a | ||
| message like | ||
|
|
||
| > Your device is loading a different operating system. | ||
| > | ||
| > Visit this link on another device: | ||
| > g.co/ABH | ||
| > | ||
| > ID: BA135E0F | ||
|
|
||
| This is expected because Android Verified Boot is designed to warn the user | ||
| when not booting the stock OS, see | ||
| https://source.android.com/security/verifiedboot/boot-flow. In fact, the | ||
| ID on the last line are the first eight characters of the fingerprint of | ||
| your AVB key. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # robotnix - Build Android (AOSP) using Nix | ||
|
|
||
| Robotnix is a build system for Android (AOSP) images on top of the Nix package | ||
| manager. Instead of having to follow complicated instructions to install | ||
| several build tools and fetch source code from multiple sources, robotnix | ||
| encapsulates all this complexity in a simple Nix expression. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to change this back to
master? Or do you plan to keep documentation on thedocsbranch from now on? Or maybe just use bothmasteranddocs?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I plan to switch it back to
masterafter merging.