blog: nixos/pinephone: outline the bootstrapping process

This commit is contained in:
colin 2022-05-25 13:53:46 -07:00
parent 1134cbf0eb
commit f33fb1fd7d
1 changed files with 42 additions and 0 deletions

View File

@ -5,6 +5,48 @@ description = "remove extra.hidden to link this from the index"
extra.hidden = true
+++
step 1: provision a nix machine
step 2: convert to a flake
step 3: install jumpdrive to a sd card
step 4: build and flash a minimal mobile-nixos
```sh
$ sudo umount /dev/sdb* ; sudo dd if=/nix/store/l9na29kg38crkzhjf6ms3vviqhi2cbc5-pine64-pinephone_full-disk-image.img of=/dev/sdb bs=1M status=progress
```
step 5: add gnome and re-flash; connect to wifi (`nmcli connect wifi <wifiname> <password>`)
step 6: ssh into the machine. resize the parts, and clone/rebuild config (better to do this from PC?)
TODO: resizing the parts like this makes the device unbootable (doesn't seem to even reach the eMMC bootloader!).
maybe it destroys whatever data is at fixed offset.
try tow-boot?
```sh
$ sudo parted /dev/sdb
GNU Parted 3.4
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resizepart
Warning: Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra 41217660 blocks) or continue with the current setting?
Fix/Ignore? Fix
Partition number? 4
End? [10.0GB]? 31GB
(parted) quit
$ sudo resize2fs /dev/sdb4
```
then disconnect the device and boot it
```
$ git clone https://git.uninsane.org/colin/nix-files.git
$ sudo rm /etc/nixos && mv nix-files /etc/nixos
$ cd /etc/nixos
$ sudo nixos-rebuild --flake "./#moby" switch # XXX: check /etc/fstab for compatibility first?
```
resources:
[NixOS from a working install](https://git.sr.ht/~tomf/notes/tree/master/item/pinephone-nixos-getting-started.md)
configuration is from a mobile-nixos local.nix repo. workable (leverages the hydra cache), but unclear how one would configure this after install (flake support?)