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: 9e45f6feac63
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4213e48dd977
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jun 16, 2019

  1. nixos-generate-config: add dm-snapshot module if LVM is detected

    Without this, the system becomes unbootable if the user creates a LVM
    snapshot and reboots.
    
    Fixes #33646
    
    (The same kind of problem was fixed in RHEL a few years back:
    https://bugzilla.redhat.com/show_bug.cgi?id=1287940)
    bjornfor committed Jun 16, 2019

    Verified

    This commit was signed with the committer’s verified signature.
    pradyunsg Pradyun Gedam
    Copy the full SHA
    4213e48 View commit details
Showing with 7 additions and 0 deletions.
  1. +7 −0 nixos/modules/installer/tools/nixos-generate-config.pl
7 changes: 7 additions & 0 deletions nixos/modules/installer/tools/nixos-generate-config.pl
Original file line number Diff line number Diff line change
@@ -264,6 +264,11 @@ sub usbCheck {
push @initrdAvailableKernelModules, "bcache";
}

# Prevent unbootable systems if LVM snapshots are present at boot time.
if (`lsblk -o TYPE` =~ "lvm") {
push @initrdKernelModules, "dm-snapshot";
}

my $virt = `systemd-detect-virt`;
chomp $virt;

@@ -526,6 +531,7 @@ sub multiLineList {
}

my $initrdAvailableKernelModules = toNixStringList(uniq @initrdAvailableKernelModules);
my $initrdKernelModules = toNixStringList(uniq @initrdKernelModules);
my $kernelModules = toNixStringList(uniq @kernelModules);
my $modulePackages = toNixList(uniq @modulePackages);

@@ -545,6 +551,7 @@ sub multiLineList {
imports =${\multiLineList(" ", @imports)};
boot.initrd.availableKernelModules = [$initrdAvailableKernelModules ];
boot.initrd.kernelModules = [$initrdKernelModules ];
boot.kernelModules = [$kernelModules ];
boot.extraModulePackages = [$modulePackages ];
$fsAndSwap