diff options
-rw-r--r-- | nixos/modules/system/boot/loader/grub/install-grub.pl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl index af39e50ff72d4..b8ef02da4bc2b 100644 --- a/nixos/modules/system/boot/loader/grub/install-grub.pl +++ b/nixos/modules/system/boot/loader/grub/install-grub.pl @@ -387,6 +387,10 @@ sub addProfile { my $curEntry = 0; foreach my $link (@links) { last if $curEntry++ >= $configurationLimit; + if (! -e "$link/nixos-version") { + warn "skipping corrupt system profile entry ‘$link’\n"; + next; + } my $date = strftime("%F", localtime(lstat($link)->mtime)); my $version = -e "$link/nixos-version" |