09-27-2019, 08:05 AM
Just to clarify, is it the original SD/eMMC image which doesn't appear to finish booting, or just the install on NVMe SSD?
0. U-Boot
1. NixOS Stage 1 - kernel runs using initrd as rootfs
2. NixOS Stage 2 - kernel switches to real rootfs
U-boot should support hdmi output, although 1. the u-boot used in this image is the rockchip fork, and 2. I haven't checked whether u-boot supports hdmi output for the RK3399 yet.
In terms of the kernel outputting information on the screen, I think it
a) needs to have the right console=something (and possibly others such as earlycon) arguments in the kernel command line, to tell it that we want the console on the video output instead of (or as well as) on the UART.
b) needs to have loaded the kernel modules necessary to start KMS (Kernel Mode Setting) to use the hdmi output. Doing 'early kms' (hdmi output during Stage 1) should be possible, by putting the required modules in boot.initrd.availablekernelmodules. (Aside: if the NVMe adaptor or the filesystem used on the SSD require any additional modules, then these need to be added to this list, so that Stage 1 is able to mount the real rootfs needed for Stage 2).
I'm hoping to take a proper look at this myself at some point. If you do have some sort of USB serial adaptor (doesn't have to be the Pine64 one, as long as it's the correct voltage), it's a great help for these sorts of things.
kolbycrouch Wrote:My main problem is that the console output doesn't show and the screen doesn't turn on until X is started. Is there a way to change this?In theory, it should be possible to get hdmi output much earlier in boot. In common with most non-NixOS linuxes, boot has 3 main stages:
0. U-Boot
1. NixOS Stage 1 - kernel runs using initrd as rootfs
2. NixOS Stage 2 - kernel switches to real rootfs
U-boot should support hdmi output, although 1. the u-boot used in this image is the rockchip fork, and 2. I haven't checked whether u-boot supports hdmi output for the RK3399 yet.
In terms of the kernel outputting information on the screen, I think it
a) needs to have the right console=something (and possibly others such as earlycon) arguments in the kernel command line, to tell it that we want the console on the video output instead of (or as well as) on the UART.
b) needs to have loaded the kernel modules necessary to start KMS (Kernel Mode Setting) to use the hdmi output. Doing 'early kms' (hdmi output during Stage 1) should be possible, by putting the required modules in boot.initrd.availablekernelmodules. (Aside: if the NVMe adaptor or the filesystem used on the SSD require any additional modules, then these need to be added to this list, so that Stage 1 is able to mount the real rootfs needed for Stage 2).
I'm hoping to take a proper look at this myself at some point. If you do have some sort of USB serial adaptor (doesn't have to be the Pine64 one, as long as it's the correct voltage), it's a great help for these sorts of things.