1
0
mirror of https://github.com/samueldr/wip-pinebook-pro.git synced 2024-06-02 11:03:34 +02:00
wip-pinebook-pro/README.md
2020-01-06 20:28:37 -05:00

42 lines
1.3 KiB
Markdown

WIP stuff to get started on the pinebook pro.
## `u-boot`
Assuming `/dev/mmcblk0` is an SD card.
```
$ nix-build -A pkgs.uBootPinebookPro
$ lsblk /dev/mmcblk0 && sudo dd if=result/idbloader.img of=/dev/mmcblk0 bs=512 seek=64 oflag=direct,sync && sudo dd if=result/u-boot.itb of=/dev/mmcblk0 bs=512 seek=16384 oflag=direct,sync
```
The eMMC has to be zeroed (in the relevant sectors) or else the RK3399 will use
the eMMC as a boot device first.
Alternatively, this u-boot can be installed to the eMMC.
Installing to SPI has yet to be investigated.
## Image build
```
$ ./build.sh
$ lsblk /dev/mmcblk0 && sudo dd if=$(echo result/sd-image/*.img) of=/dev/mmcblk0 bs=8M oflag=direct status=progress
```
The `build.sh` script transmits parameters to `nix-build`, so e.g. `-j0` can
be used.
Once built, this image is self-sufficient, meaning that it should already be
booting, no need burn u-boot to it.
The required modules (and maybe a bit more) are present in stage-1 so the
display should start early enough in the boot process.
## 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.