Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 54f8b31971cf
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 79256619ce6a
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Jan 24, 2021

  1. Copy the full SHA
    bc1b5fd View commit details

Commits on Jan 29, 2021

  1. Merge pull request #108294 from GovanifY/silent-boot

    boot.initrd: add verbose option
    AndersonTorres authored Jan 29, 2021
    Copy the full SHA
    7925661 View commit details
Showing with 33 additions and 10 deletions.
  1. +15 −9 nixos/modules/system/boot/stage-1-init.sh
  2. +18 −1 nixos/modules/system/boot/stage-1.nix
24 changes: 15 additions & 9 deletions nixos/modules/system/boot/stage-1-init.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,13 @@

targetRoot=/mnt-root
console=tty1
verbose="@verbose@"

info() {
if [[ -n "$verbose" ]]; then
echo "$@"
fi
}

extraUtils="@extraUtils@"
export LD_LIBRARY_PATH=@extraUtils@/lib
@@ -55,17 +62,17 @@ EOF
echo "Rebooting..."
reboot -f
else
echo "Continuing..."
info "Continuing..."
fi
}

trap 'fail' 0


# Print a greeting.
echo
echo "[1;32m<<< NixOS Stage 1 >>>[0m"
echo
info
info "[1;32m<<< NixOS Stage 1 >>>[0m"
info

# Make several required directories.
mkdir -p /etc/udev
@@ -210,14 +217,14 @@ ln -s @modulesClosure@/lib/modules /lib/modules
ln -s @modulesClosure@/lib/firmware /lib/firmware
echo @extraUtils@/bin/modprobe > /proc/sys/kernel/modprobe
for i in @kernelModules@; do
echo "loading module $(basename $i)..."
info "loading module $(basename $i)..."
modprobe $i
done


# Create device nodes in /dev.
@preDeviceCommands@
echo "running udev..."
info "running udev..."
ln -sfn /proc/self/fd /dev/fd
ln -sfn /proc/self/fd/0 /dev/stdin
ln -sfn /proc/self/fd/1 /dev/stdout
@@ -235,8 +242,7 @@ udevadm settle
# XXX: Use case usb->lvm will still fail, usb->luks->lvm is covered
@preLVMCommands@


echo "starting device mapper and LVM..."
info "starting device mapper and LVM..."
lvm vgchange -ay

if test -n "$debug1devices"; then fail; fi
@@ -379,7 +385,7 @@ mountFS() {
done
fi
echo "mounting $device on $mountPoint..."
info "mounting $device on $mountPoint..."
mkdir -p "/mnt-root$mountPoint"
19 changes: 18 additions & 1 deletion nixos/modules/system/boot/stage-1.nix
Original file line number Diff line number Diff line change
@@ -280,7 +280,7 @@ let

inherit (config.system.build) earlyMountScript;

inherit (config.boot.initrd) checkJournalingFS
inherit (config.boot.initrd) checkJournalingFS verbose
preLVMCommands preDeviceCommands postDeviceCommands postMountCommands preFailCommands kernelModules;

resumeDevices = map (sd: if sd ? device then sd.device else "/dev/disk/by-label/${sd.label}")
@@ -565,6 +565,23 @@ in
description = "Names of supported filesystem types in the initial ramdisk.";
};

boot.initrd.verbose = mkOption {
default = true;
type = types.bool;
description =
''
Verbosity of the initrd. Please note that disabling verbosity removes
only the mandatory messages generated by the NixOS scripts. For a
completely silent boot, you might also want to set the two following
configuration options:
<itemizedlist>
<listitem><para><literal>boot.consoleLogLevel = 0;</literal></para></listitem>
<listitem><para><literal>boot.kernelParams = [ "quiet" "udev.log_priority=3" ];</literal></para></listitem>
</itemizedlist>
'';
};

boot.loader.supportsInitrdSecrets = mkOption
{ internal = true;
default = false;