From 58c287ef6ad4b2a387252acd9890938670322ea5 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Fri, 7 Oct 2022 00:21:04 +0100 Subject: [PATCH] add config option for kernel commmand line --- default.nix | 3 ++- modules/base.nix | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/default.nix b/default.nix index d92c5eb..e403b60 100644 --- a/default.nix +++ b/default.nix @@ -5,6 +5,7 @@ let overlay = import ./overlay.nix; nixpkgs = import ( device.system // {overlays = [overlay]; }); inherit (nixpkgs.pkgs) callPackage writeText liminix; + inherit (nixpkgs.lib) concatStringsSep; config = (import ./merge-modules.nix) [ ./modules/base.nix ({ lib, ... } : { config = { inherit (device) kernel; }; }) @@ -24,7 +25,7 @@ let }; uimage = kernel.uimage { - commandLine = "earlyprintk=serial,ttyS0 console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8 rootfstype=squashfs"; + commandLine = concatStringsSep " " config.boot.commandLine; inherit (device.boot) loadAddress entryPoint; inherit (kernel) vmlinux; inherit dtb; diff --git a/modules/base.nix b/modules/base.nix index 9607541..ca31a88 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -34,6 +34,9 @@ in { default = {}; }; }; + boot.commandLine = mkOption { + type = types.listOf types.nonEmptyStr; + }; groups = mkOption { type = types.attrsOf types.anything; }; @@ -50,9 +53,14 @@ in { IKCONFIG = "y"; IKCONFIG_PROC = "y"; PROC_FS = "y"; + # s6-linux-init mounts this on /dev + DEVTMPFS = "y"; }; checkedConfig = config; }; + boot.commandLine = [ + "earlyprintk=serial,ttyS0 console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8 rootfstype=squashfs" + ]; users.root = { uid = 0; gid= 0; gecos = "Root of all evaluation"; dir = "/";