raspberry-pi-nix/sd-image/default.nix
Travis Staton 9f536c07d1 Revert "enable uart console for kernel"
This reverts commit 5f94c31db1.

fixes #6

ttyAMA0 controls uart0, which can be used for bluetooth. If it is used
for bluetooth then we don't want to write a bunch of garbage to it.
2023-07-03 21:45:03 -04:00

27 lines
914 B
Nix

{ config, lib, pkgs, ... }:
{
imports = [ ./sd-image.nix ];
config = {
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
boot.consoleLogLevel = lib.mkDefault 7;
# https://github.com/raspberrypi/firmware/issues/1539#issuecomment-784498108
boot.kernelParams = [ "console=serial0,115200n8" "console=tty1" ];
sdImage = {
populateFirmwareCommands = ''
cp ${pkgs.uboot_rpi_arm64}/u-boot.bin firmware/u-boot-rpi-arm64.bin
cp -r ${pkgs.raspberrypifw}/share/raspberrypi/boot/{start*.elf,*.dtb,bootcode.bin,fixup*.dat,overlays} firmware
cp ${config.hardware.raspberry-pi.config-output} firmware/config.txt
'';
populateRootCommands = ''
mkdir -p ./files/boot
${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot
'';
};
};
}