2019-11-14 17:40:51 -05:00
WIP stuff to get started on the pinebook pro.
2019-11-14 17:47:56 -05:00
2020-01-07 15:20:13 -05:00
## Using in your configuration
2019-11-14 17:47:56 -05:00
2020-01-07 15:20:13 -05:00
Clone this repository somwhere, and in your configuration.nix
2019-11-14 17:47:56 -05:00
```
2020-01-07 15:20:13 -05:00
{
imports = [
.../pinebook-pro/pinebook_pro.nix
];
}
2019-11-14 17:47:56 -05:00
```
2020-01-07 15:20:13 -05:00
That entry point will try to stay unopinionated, while maximizing the hardware
compatibility.
2019-11-14 17:47:56 -05:00
2021-05-11 19:06:13 -04:00
## Current state
2020-01-07 15:20:13 -05:00
2021-05-11 19:06:13 -04:00
*A whole lot of untested*.
2020-01-07 15:20:13 -05:00
2021-05-11 19:06:13 -04:00
You can look at the previous state to see that the basic stuff works. But I
find listing everything as working is hard.
2020-01-07 15:20:13 -05:00
2021-05-11 19:06:13 -04:00
What's untested and not working will be listed here at some point. Maybe.
2020-01-07 15:20:13 -05:00
### Known issues
2021-05-11 19:06:13 -04:00
#### `rockchipdrm` and `efifb`
2020-01-06 15:36:56 -05:00
2021-05-11 19:06:13 -04:00
`CONFIG_FB_EFI` has been disabled in the customized kernel as `rockchipdrm`
will not render the VT if `efifb` is present.
Be careful if using the mainline kernel instead, as it will have
`CONFIG_FB_EFI` set to `y` .
#### *EFI* and poweroff
2021-05-23 19:49:22 -04:00
~~When booted using EFI, the system will not power off. It will stay seemingly
stuck with the LED and display turned off.~~
2021-05-11 19:06:13 -04:00
2021-05-23 19:49:22 -04:00
~~Power it off by holding the power button for a while (10-15 seconds).~~
2021-05-11 19:06:13 -04:00
2021-05-23 19:49:22 -04:00
~~Otherwise you might have a surprise and find the battery is flat!~~
A [workaround exists ](https://github.com/Tow-Boot/Tow-Boot/commit/818cae1b84a7702f2a509927f2819900c2881979#diff-20f50d9d8d5d6c059b87ad66fbc5df26d9fc46251763547ca9bdcc75564a4368 ),
and is built in recent Tow-Boot (no prebuilt releases at this time).
2020-01-07 15:36:28 -05:00
2020-01-06 15:36:56 -05:00
## Image build
2021-05-11 19:06:13 -04:00
> **NOTE**: These images will be built without an *Initial Boot Firmware*.
2020-01-06 15:36:56 -05:00
2021-05-11 19:06:13 -04:00
### SD image
2020-01-06 17:30:19 -05:00
2021-05-11 19:06:13 -04:00
```
$ nix-build -A sdImage
```
2020-01-06 17:30:19 -05:00
2021-05-11 19:06:13 -04:00
### ISO image
2020-01-06 17:30:19 -05:00
2021-05-11 19:06:13 -04:00
```
$ nix-build -A isoImage
```
2020-01-06 20:29:08 -05:00
2020-01-06 17:30:19 -05:00
## Note about cross-compilation
This will automatically detect the need for cross-compiling or not.
When cross-compiled, all caveats apply. Here this mainly means that the kernel
will need to be re-compiled on the device on the first nixos-rebuild switch,
while most other packages can be fetched from the cache.
2020-01-07 15:20:13 -05:00
2021-05-11 19:06:13 -04:00
For cross-compilation, you might have to provide a path to a known-good Nixpkgs
checkout. *(Left as an exercis to the reader.)*
2020-01-07 15:20:13 -05:00
```
2021-05-11 19:06:13 -04:00
$ NIX_PATH=nixpkgs=/path/to/known/working/cross-compilation-friendly/nixpkgs
2020-01-07 15:20:13 -05:00
```
2021-05-11 19:06:13 -04:00
## *Initial Boot Firmware*
2020-01-07 15:20:13 -05:00
2021-05-11 19:06:13 -04:00
> **NOTE**: The previously available customized *U-Boot* from this repository
> are not available anymore.
2020-01-07 15:20:13 -05:00
2021-05-11 19:06:13 -04:00
### *Tow-Boot*
2020-01-07 15:58:47 -05:00
2021-05-11 19:06:13 -04:00
I highly suggest installing *Tow-Boot* to the SPI Flash.
2020-01-17 14:14:53 -05:00
2021-05-11 19:06:13 -04:00
- https://github.com/Tow-Boot/Tow-Boot
2020-01-17 14:14:53 -05:00
2021-05-11 19:06:13 -04:00
Having the firmware installed to SPI makes the device act basically like a
normal computer. No need for weird incantations to setup the initial boot
firmware.
Alternatively, starting from the *Tow-Boot* disk image on eMMC is easier to
deal with and understand than having to deal with *U-Boot* manually.
2020-01-17 14:14:53 -05:00
2020-01-17 18:30:57 -05:00
2021-05-11 19:06:13 -04:00
### Mainline *U-Boot*
Mainline U-Boot has full support for graphics since 2021.04. The current
unstable relases of Nixpkgs are at 2021.04 at least.
```
$ nix-build -A pkgs.ubootPinebookPro
```
2020-01-17 18:30:57 -05:00
2021-05-11 19:06:13 -04:00
Note that the default U-Boot build does not do anything with LED on startup.
2020-01-21 22:37:42 -05:00
2020-01-17 18:30:57 -05:00
2020-01-07 15:58:47 -05:00
## Keyboard firmware
```
$ nix-build -A pkgs.pinebookpro-keyboard-updater
2020-01-22 15:29:19 -05:00
$ sudo ./result/bin/updater step-1 < iso | ansi >
$ sudo poweroff
2020-01-07 15:58:47 -05:00
# ...
2020-01-22 15:29:19 -05:00
$ sudo ./result/bin/updater step-2 < iso | ansi >
$ sudo poweroff
# ...
$ sudo ./result/bin/updater flash-kb-revised < iso | ansi >
2020-01-07 15:58:47 -05:00
```
2020-01-22 15:29:19 -05:00
Note: poweroff must be used, reboot does not turn the hardware "off" enough.