summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2016-07-05 23:40:35 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2016-07-06 00:11:57 +0200
commitaeb516c741a1156a66acafa14322b47c63cfd709 (patch)
tree648fa3a40b6cc698dd080d7cfadb26c453ae3d9f /nixos/modules/system
parent071faa71e7ae4d8a4a7996f1c05d0688a5efddef (diff)
downloadnixlib-aeb516c741a1156a66acafa14322b47c63cfd709.tar
nixlib-aeb516c741a1156a66acafa14322b47c63cfd709.tar.gz
nixlib-aeb516c741a1156a66acafa14322b47c63cfd709.tar.bz2
nixlib-aeb516c741a1156a66acafa14322b47c63cfd709.tar.lz
nixlib-aeb516c741a1156a66acafa14322b47c63cfd709.tar.xz
nixlib-aeb516c741a1156a66acafa14322b47c63cfd709.tar.zst
nixlib-aeb516c741a1156a66acafa14322b47c63cfd709.zip
nixos/grub: change state file device separator from ':' to ','
':' is currently used as separator in /boot/grub/state for the list of
devices GRUB should be installed to. The problem is that ':' itself may
appear in a device path:

  /dev/disk/by-id/usb-SanDisk_Cruzer_20043512300546C0B317-0:0

With such a path, NixOS will install GRUB *every* time, because it
thinks the configuration differs from the state file (due to the wrong
list split). Fix it by using ',' as separator.

For existing systems with GRUB installed on multiple devices, this
change means that GRUB will be installed one extra time.
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/boot/loader/grub/install-grub.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl
index b8ef02da4bc2..94d87b436065 100644
--- a/nixos/modules/system/boot/loader/grub/install-grub.pl
+++ b/nixos/modules/system/boot/loader/grub/install-grub.pl
@@ -501,7 +501,7 @@ sub getEfiTarget {
 my @deviceTargets = getDeviceTargets();
 my $efiTarget = getEfiTarget();
 my $prevGrubState = readGrubState();
-my @prevDeviceTargets = split/:/, $prevGrubState->devices;
+my @prevDeviceTargets = split/,/, $prevGrubState->devices;
 
 my $devicesDiffer = scalar (List::Compare->new( '-u', '-a', \@deviceTargets, \@prevDeviceTargets)->get_symmetric_difference());
 my $nameDiffer = get("fullName") ne $prevGrubState->name;
@@ -549,7 +549,7 @@ if ($requireNewInstall != 0) {
     print FILE get("fullName"), "\n" or die;
     print FILE get("fullVersion"), "\n" or die;
     print FILE $efiTarget, "\n" or die;
-    print FILE join( ":", @deviceTargets ), "\n" or die;
+    print FILE join( ",", @deviceTargets ), "\n" or die;
     print FILE $efiSysMountPoint, "\n" or die;
     close FILE or die;
 }