Mic92 / nixos-aarch64-images

Build NixOS images for various ARM single computer boards
79 stars 20 forks source link

Works great on the RockPro64 #1

Closed axgfn closed 3 years ago

axgfn commented 3 years ago

Just wanted to leave some feedback that I got this working on my RockPro64. I did update the aarch64-image to https://hydra.nixos.org/job/nixos/release-20.09/nixos.sd_image_new_kernel.aarch64-linux/latest first, using the "new kernel" variant because it supports the hardware better. (I also had to manually resize the root partition, because the boot scripts that try to do it for you expect it to be on the 2nd partition, not the 3rd.)

Thanks for the work you put into this, you saved me a lot of time getting NixOS up and running on this thing! Hopefully upstream NixOS will have better install options for ARM devices some day soon.

Mic92 commented 3 years ago

Thanks! I also added it to the wiki.

Mic92 commented 3 years ago

Maybe we need to fix upstream to resize partitions by label instead of just resizing the second partition.

Mic92 commented 3 years ago

I am trying to fix the image resizing here. Maybe you can test the code: https://github.com/NixOS/nixpkgs/pull/105732

axgfn commented 3 years ago

I'd be happy to test it, but it may be a few days before I can get around to it.

axgfn commented 3 years ago

I can at least confirm that after running the following commands on my rockpro64, $partNum's value is 3:

rootPart=$(findmnt -n -o SOURCE /)
bootDevice=$(lsblk -npo PKNAME $rootPart)
partNum=$(lsblk -npo MAJ:MIN $rootPart | awk -F: '{print $2}')

So it should work fine, assuming it still yields 2 on the raspberry pi 3 and other devices. Let me know if you also need me to test an sd-image.

Mic92 commented 3 years ago

I can at least confirm that after running the following commands on my rockpro64, $partNum's value is 3:

rootPart=$(findmnt -n -o SOURCE /)
bootDevice=$(lsblk -npo PKNAME $rootPart)
partNum=$(lsblk -npo MAJ:MIN $rootPart | awk -F: '{print $2}')

So it should work fine, assuming it still yields 2 on the raspberry pi 3 and other devices. Let me know if you also need me to test an sd-image.

This is also how I tested it ;) But I can also run those command on a raspberry pi.

Mic92 commented 3 years ago

it does work:

joerg@matchbox> rootPart=$(findmnt -n -o SOURCE /)                                                                                                                                                                ~
joerg@matchbox> bootDevice=$(lsblk -npo PKNAME $rootPart)                                                                                                                                                         ~
joerg@matchbox> partNum=$(lsblk -npo MAJ:MIN $rootPart | awk -F: '{print $2}')                                                                                                                                    ~
joerg@matchbox> echo $partNum                                                                                                                                                                                     ~
2
Mic92 commented 3 years ago

Now I only need to wait for https://github.com/NixOS/nixpkgs/commit/1d957fd0233fd3a9b3fffccdefc28b1192941556 to hit a nixos channel to update the used image here.