mirror of
https://github.com/nix-community/raspberry-pi-nix.git
synced 2025-11-08 19:46:03 +01:00
Merge pull request #119 from jleeuwes/make-serial-console-optional
Add raspberry-pi-nix.serial-console.enable option
This commit is contained in:
commit
3e442842d3
1 changed files with 20 additions and 5 deletions
|
|
@ -77,6 +77,18 @@ in
|
||||||
|
|
||||||
package = mkPackageOption pkgs "uboot-rpi-arm64" { };
|
package = mkPackageOption pkgs "uboot-rpi-arm64" { };
|
||||||
};
|
};
|
||||||
|
serial-console = {
|
||||||
|
enable = mkOption {
|
||||||
|
default = true;
|
||||||
|
type = types.bool;
|
||||||
|
description = ''
|
||||||
|
Whether to enable a console on serial0.
|
||||||
|
|
||||||
|
Corresponds with raspi-config's setting
|
||||||
|
"Would you like a login shell to be accessible over serial?"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -319,11 +331,14 @@ in
|
||||||
boot = {
|
boot = {
|
||||||
kernelParams =
|
kernelParams =
|
||||||
if cfg.uboot.enable then [ ]
|
if cfg.uboot.enable then [ ]
|
||||||
else [
|
else builtins.concatLists [
|
||||||
"console=tty1"
|
[ "console=tty1" ]
|
||||||
# https://github.com/raspberrypi/firmware/issues/1539#issuecomment-784498108
|
(if cfg.serial-console.enable then [
|
||||||
"console=serial0,115200n8"
|
# https://github.com/raspberrypi/firmware/issues/1539#issuecomment-784498108
|
||||||
"init=/sbin/init"
|
"console=serial0,115200n8"
|
||||||
|
] else [ ]
|
||||||
|
)
|
||||||
|
[ "init=/sbin/init" ]
|
||||||
];
|
];
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = [
|
availableKernelModules = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue