From 3d040f9305186651c0b791d368f4c7b8d2e398b3 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sat, 23 Sep 2017 19:46:45 +0200 Subject: [PATCH] nixos/install: disable kernel debug console logging Add another option for debugging instead. Lots of users have been complaining about this default behaviour. This patch also cleans up the EFI bootloader entries in the ISO. --- nixos/modules/installer/cd-dvd/iso-image.nix | 57 +++++++++++++------ .../modules/profiles/installation-device.nix | 1 - 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix index 8891ce0b6667..96f7aac1d59d 100644 --- a/nixos/modules/installer/cd-dvd/iso-image.nix +++ b/nixos/modules/installer/cd-dvd/iso-image.nix @@ -46,17 +46,24 @@ let # A variant to boot with 'nomodeset' LABEL boot-nomodeset - MENU LABEL NixOS ${config.system.nixosVersion}${config.isoImage.appendToMenuLabel} (with nomodeset) + MENU LABEL NixOS ${config.system.nixosVersion}${config.isoImage.appendToMenuLabel} (nomodeset) LINUX /boot/bzImage APPEND init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} nomodeset INITRD /boot/initrd # A variant to boot with 'copytoram' LABEL boot-copytoram - MENU LABEL NixOS ${config.system.nixosVersion}${config.isoImage.appendToMenuLabel} (with copytoram) + MENU LABEL NixOS ${config.system.nixosVersion}${config.isoImage.appendToMenuLabel} (copytoram) LINUX /boot/bzImage APPEND init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} copytoram INITRD /boot/initrd + + # A variant to boot with verbose logging to the console + LABEL boot-nomodeset + MENU LABEL NixOS ${config.system.nixosVersion}${config.isoImage.appendToMenuLabel} (debug) + LINUX /boot/bzImage + APPEND init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} loglevel=7 + INITRD /boot/initrd ''; isolinuxMemtest86Entry = '' @@ -74,25 +81,43 @@ let cp -v ${pkgs.systemd}/lib/systemd/boot/efi/systemd-boot${targetArch}.efi $out/EFI/boot/boot${targetArch}.efi mkdir -p $out/loader/entries - echo "title NixOS Live CD" > $out/loader/entries/nixos-livecd.conf - echo "linux /boot/bzImage" >> $out/loader/entries/nixos-livecd.conf - echo "initrd /boot/initrd" >> $out/loader/entries/nixos-livecd.conf - echo "options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}" >> $out/loader/entries/nixos-livecd.conf + cat << EOF > $out/loader/entries/nixos-iso.conf + title NixOS ${config.system.nixosVersion}${config.isoImage.appendToMenuLabel} + linux /boot/bzImage + initrd /boot/initrd + options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} + EOF # A variant to boot with 'nomodeset' - echo "title NixOS Live CD (with nomodeset)" > $out/loader/entries/nixos-livecd-nomodeset.conf - echo "linux /boot/bzImage" >> $out/loader/entries/nixos-livecd-nomodeset.conf - echo "initrd /boot/initrd" >> $out/loader/entries/nixos-livecd-nomodeset.conf - echo "options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} nomodeset" >> $out/loader/entries/nixos-livecd-nomodeset.conf + cat << EOF > $out/loader/entries/nixos-iso-nomodeset.conf + title NixOS ${config.system.nixosVersion}${config.isoImage.appendToMenuLabel} + version nomodeset + linux /boot/bzImage + initrd /boot/initrd + options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} nomodeset + EOF # A variant to boot with 'copytoram' - echo "title NixOS Live CD (with copytoram)" > $out/loader/entries/nixos-livecd-copytoram.conf - echo "linux /boot/bzImage" >> $out/loader/entries/nixos-livecd-copytoram.conf - echo "initrd /boot/initrd" >> $out/loader/entries/nixos-livecd-copytoram.conf - echo "options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} copytoram" >> $out/loader/entries/nixos-livecd-copytoram.conf + cat << EOF > $out/loader/entries/nixos-iso-copytoram.conf + title NixOS ${config.system.nixosVersion}${config.isoImage.appendToMenuLabel} + version copytoram + linux /boot/bzImage + initrd /boot/initrd + options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} copytoram + EOF - echo "default nixos-livecd" > $out/loader/loader.conf - echo "timeout ${builtins.toString config.boot.loader.timeout}" >> $out/loader/loader.conf + # A variant to boot with verbose logging to the console + cat << EOF > $out/loader/entries/nixos-iso-debug.conf + title NixOS ${config.system.nixosVersion}${config.isoImage.appendToMenuLabel} (debug) + linux /boot/bzImage + initrd /boot/initrd + options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} loglevel=7 + EOF + + cat << EOF > $out/loader/loader.conf + default nixos-iso + timeout ${builtins.toString config.boot.loader.timeout} + EOF ''; efiImg = pkgs.runCommand "efi-image_eltorito" { buildInputs = [ pkgs.mtools pkgs.libfaketime ]; } diff --git a/nixos/modules/profiles/installation-device.nix b/nixos/modules/profiles/installation-device.nix index 8e1482f5533f..506a6ee3eaa8 100644 --- a/nixos/modules/profiles/installation-device.nix +++ b/nixos/modules/profiles/installation-device.nix @@ -77,7 +77,6 @@ with lib; # Show all debug messages from the kernel but don't log refused packets # because we have the firewall enabled. This makes installs from the # console less cumbersome if the machine has a public IP. - boot.consoleLogLevel = mkDefault 7; networking.firewall.logRefusedConnections = mkDefault false; environment.systemPackages = [ pkgs.vim ];