From 26c6ed1275923a0dcc75da0dfe2bf70ee336c955 Mon Sep 17 00:00:00 2001 From: Brian Jordan <32145530+brian-jordan@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:01:45 -0400 Subject: [PATCH] Add console.enable option to modules/default.nix (#250) * adding console.enable option to modules/default.nix * Update modules/default.nix Co-authored-by: Jared Baur <45740526+jmbaur@users.noreply.github.com> --------- Co-authored-by: bjordan Co-authored-by: Jared Baur <45740526+jmbaur@users.noreply.github.com> --- modules/default.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/modules/default.nix b/modules/default.nix index 924a0fd..7568df8 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -123,6 +123,13 @@ in binaries needed for flashing/fusing Jetson SOMs. ''; }; + + console.enable = mkOption { + default = config.console.enable; + defaultText = "config.console.enable"; + type = types.bool; + description = "Enable boot.kernelParams default console configuration"; + }; }; }; @@ -175,12 +182,14 @@ in pkgs.nvidia-jetpack.kernelPackages; boot.kernelParams = [ - "console=tty0" # Output to HDMI/DP. May need fbcon=map:0 as well - "console=ttyTCU0,115200" # Provides console on "Tegra Combined UART" (TCU) - # Needed on Orin at least, but upstream has it for both "nvidia.rm_firmware_active=all" - ] ++ lib.optional (lib.hasPrefix "xavier-" cfg.som || cfg.som == "generic") "video=efifb:off"; # Disable efifb driver, which crashes Xavier NX and possibly AGX + ] + ++ lib.optionals cfg.console.enable [ + "console=tty0" # Output to HDMI/DP. May need fbcon=map:0 as well + "console=ttyTCU0,115200" # Provides console on "Tegra Combined UART" (TCU) + ] + ++ lib.optional (lib.hasPrefix "xavier-" cfg.som || cfg.som == "generic") "video=efifb:off"; # Disable efifb driver, which crashes Xavier NX and possibly AGX boot.initrd.includeDefaultModules = false; # Avoid a bunch of modules we may not get from tegra_defconfig boot.initrd.availableKernelModules = [ "xhci-tegra" ]; # Make sure USB firmware makes it into initrd