boot.initrd: add verbose option
This commit is contained in:
parent
071eb8b265
commit
bc1b5fdfe0
|
@ -2,6 +2,13 @@
|
||||||
|
|
||||||
targetRoot=/mnt-root
|
targetRoot=/mnt-root
|
||||||
console=tty1
|
console=tty1
|
||||||
|
verbose="@verbose@"
|
||||||
|
|
||||||
|
info() {
|
||||||
|
if [[ -n "$verbose" ]]; then
|
||||||
|
echo "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
extraUtils="@extraUtils@"
|
extraUtils="@extraUtils@"
|
||||||
export LD_LIBRARY_PATH=@extraUtils@/lib
|
export LD_LIBRARY_PATH=@extraUtils@/lib
|
||||||
|
@ -55,7 +62,7 @@ EOF
|
||||||
echo "Rebooting..."
|
echo "Rebooting..."
|
||||||
reboot -f
|
reboot -f
|
||||||
else
|
else
|
||||||
echo "Continuing..."
|
info "Continuing..."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,9 +70,9 @@ trap 'fail' 0
|
||||||
|
|
||||||
|
|
||||||
# Print a greeting.
|
# Print a greeting.
|
||||||
echo
|
info
|
||||||
echo "[1;32m<<< NixOS Stage 1 >>>[0m"
|
info "[1;32m<<< NixOS Stage 1 >>>[0m"
|
||||||
echo
|
info
|
||||||
|
|
||||||
# Make several required directories.
|
# Make several required directories.
|
||||||
mkdir -p /etc/udev
|
mkdir -p /etc/udev
|
||||||
|
@ -210,14 +217,14 @@ ln -s @modulesClosure@/lib/modules /lib/modules
|
||||||
ln -s @modulesClosure@/lib/firmware /lib/firmware
|
ln -s @modulesClosure@/lib/firmware /lib/firmware
|
||||||
echo @extraUtils@/bin/modprobe > /proc/sys/kernel/modprobe
|
echo @extraUtils@/bin/modprobe > /proc/sys/kernel/modprobe
|
||||||
for i in @kernelModules@; do
|
for i in @kernelModules@; do
|
||||||
echo "loading module $(basename $i)..."
|
info "loading module $(basename $i)..."
|
||||||
modprobe $i
|
modprobe $i
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
# Create device nodes in /dev.
|
# Create device nodes in /dev.
|
||||||
@preDeviceCommands@
|
@preDeviceCommands@
|
||||||
echo "running udev..."
|
info "running udev..."
|
||||||
ln -sfn /proc/self/fd /dev/fd
|
ln -sfn /proc/self/fd /dev/fd
|
||||||
ln -sfn /proc/self/fd/0 /dev/stdin
|
ln -sfn /proc/self/fd/0 /dev/stdin
|
||||||
ln -sfn /proc/self/fd/1 /dev/stdout
|
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
|
# XXX: Use case usb->lvm will still fail, usb->luks->lvm is covered
|
||||||
@preLVMCommands@
|
@preLVMCommands@
|
||||||
|
|
||||||
|
info "starting device mapper and LVM..."
|
||||||
echo "starting device mapper and LVM..."
|
|
||||||
lvm vgchange -ay
|
lvm vgchange -ay
|
||||||
|
|
||||||
if test -n "$debug1devices"; then fail; fi
|
if test -n "$debug1devices"; then fail; fi
|
||||||
|
@ -379,7 +385,7 @@ mountFS() {
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "mounting $device on $mountPoint..."
|
info "mounting $device on $mountPoint..."
|
||||||
|
|
||||||
mkdir -p "/mnt-root$mountPoint"
|
mkdir -p "/mnt-root$mountPoint"
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,7 @@ let
|
||||||
|
|
||||||
inherit (config.system.build) earlyMountScript;
|
inherit (config.system.build) earlyMountScript;
|
||||||
|
|
||||||
inherit (config.boot.initrd) checkJournalingFS
|
inherit (config.boot.initrd) checkJournalingFS verbose
|
||||||
preLVMCommands preDeviceCommands postDeviceCommands postMountCommands preFailCommands kernelModules;
|
preLVMCommands preDeviceCommands postDeviceCommands postMountCommands preFailCommands kernelModules;
|
||||||
|
|
||||||
resumeDevices = map (sd: if sd ? device then sd.device else "/dev/disk/by-label/${sd.label}")
|
resumeDevices = map (sd: if sd ? device then sd.device else "/dev/disk/by-label/${sd.label}")
|
||||||
|
@ -560,6 +560,23 @@ in
|
||||||
description = "Names of supported filesystem types in the initial ramdisk.";
|
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
|
boot.loader.supportsInitrdSecrets = mkOption
|
||||||
{ internal = true;
|
{ internal = true;
|
||||||
default = false;
|
default = false;
|
||||||
|
|
Loading…
Reference in a new issue