Merge branch 'master' into staging
Conflicts:
pkgs/applications/misc/navit/default.nix
pkgs/applications/networking/mailreaders/alpine/default.nix
pkgs/applications/networking/mailreaders/realpine/default.nix
pkgs/development/compilers/ghc/head.nix
pkgs/development/libraries/openssl/default.nix
pkgs/games/liquidwar/default.nix
pkgs/games/spring/springlobby.nix
pkgs/os-specific/linux/kernel/perf.nix
pkgs/servers/sip/freeswitch/default.nix
pkgs/tools/archivers/cromfs/default.nix
pkgs/tools/graphics/plotutils/default.nix
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# the modules necessary to mount the root file system, then calls the
|
||||
# init in the root file system to start the second boot stage.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, utils, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
@@ -23,6 +23,12 @@ let
|
||||
};
|
||||
|
||||
|
||||
# The initrd only has to mount `/` or any FS marked as necessary for
|
||||
# booting (such as the FS containing `/nix/store`, or an FS needed for
|
||||
# mounting `/`, like `/` on a loopback).
|
||||
fileSystems = filter utils.fsNeededForBoot config.system.build.fileSystems;
|
||||
|
||||
|
||||
# Some additional utilities needed in stage 1, like mount, lvm, fsck
|
||||
# etc. We don't want to bring in all of those packages, so we just
|
||||
# copy what we need. Instead of using statically linked binaries,
|
||||
@@ -71,7 +77,7 @@ let
|
||||
ln -sf kmod $out/bin/modprobe
|
||||
|
||||
# Copy resize2fs if needed.
|
||||
${optionalString (any (fs: fs.autoResize) (attrValues config.fileSystems)) ''
|
||||
${optionalString (any (fs: fs.autoResize) fileSystems) ''
|
||||
# We need mke2fs in the initrd.
|
||||
copy_bin_and_libs ${pkgs.e2fsprogs}/sbin/resize2fs
|
||||
''}
|
||||
@@ -128,21 +134,6 @@ let
|
||||
''; # */
|
||||
|
||||
|
||||
# The initrd only has to mount / or any FS marked as necessary for
|
||||
# booting (such as the FS containing /nix/store, or an FS needed for
|
||||
# mounting /, like / on a loopback).
|
||||
#
|
||||
# We need to guarantee that / is the first filesystem in the list so
|
||||
# that if and when lustrateRoot is invoked, nothing else is mounted
|
||||
fileSystems = let
|
||||
filterNeeded = filter
|
||||
(fs: fs.mountPoint != "/" && (fs.neededForBoot || elem fs.mountPoint [ "/nix" "/nix/store" "/var" "/var/log" "/var/lib" "/etc" ]));
|
||||
filterRoot = filter
|
||||
(fs: fs.mountPoint == "/");
|
||||
allFileSystems = attrValues config.fileSystems;
|
||||
in (filterRoot allFileSystems) ++ (filterNeeded allFileSystems);
|
||||
|
||||
|
||||
udevRules = pkgs.stdenv.mkDerivation {
|
||||
name = "udev-rules";
|
||||
allowedReferences = [ extraUtils ];
|
||||
@@ -405,9 +396,8 @@ in
|
||||
};
|
||||
|
||||
config = mkIf (!config.boot.isContainer) {
|
||||
|
||||
assertions = [
|
||||
{ assertion = any (fs: fs.mountPoint == "/") (attrValues config.fileSystems);
|
||||
{ assertion = any (fs: fs.mountPoint == "/") fileSystems;
|
||||
message = "The ‘fileSystems’ option does not specify your root file system.";
|
||||
}
|
||||
{ assertion = let inherit (config.boot) resumeDevice; in
|
||||
|
||||
Reference in New Issue
Block a user