switch-to-configuration: use absolute path to systemd-escape
Fixes issue when upgrading from very old NixOS systems that don't have systemd-escape in $PATH: $ sudo nixos-rebuild switch ... building the system configuration... updating GRUB 2 menu... Can't exec "systemd-escape": No such file or directory at /nix/var/nix/profiles/system/bin/switch-to-configuration line 264. Unable to escape /!
This commit is contained in:
parent
17e8032adb
commit
9050077cff
|
@ -261,7 +261,7 @@ while (my ($unit, $state) = each %{$activePrev}) {
|
|||
|
||||
sub pathToUnitName {
|
||||
my ($path) = @_;
|
||||
open my $cmd, "-|", "systemd-escape", "--suffix=mount", "-p", $path
|
||||
open my $cmd, "-|", "@systemd@/bin/systemd-escape", "--suffix=mount", "-p", $path
|
||||
or die "Unable to escape $path!\n";
|
||||
my $escaped = join "", <$cmd>;
|
||||
chomp $escaped;
|
||||
|
|
Loading…
Reference in New Issue