Merge pull request #77594 from Frostman/fix-grub-extrafiles-mirroredboots

Fix boot.loader.grub.extraFiles when used with mirroredBoots
This commit is contained in:
Silvan Mosberger 2020-02-05 00:22:35 +01:00 committed by GitHub
commit b4cc413928
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -630,7 +630,7 @@ in
boot.loader.grub.extraPrepareConfig =
concatStrings (mapAttrsToList (n: v: ''
${pkgs.coreutils}/bin/cp -pf "${v}" "/boot/${n}"
${pkgs.coreutils}/bin/cp -pf "${v}" "@bootPath@/${n}"
'') config.boot.loader.grub.extraFiles);
assertions = [

View File

@ -475,6 +475,9 @@ if ($grubVersion == 2) {
}
}
# extraPrepareConfig could refer to @bootPath@, which we have to substitute
$extraPrepareConfig =~ s/\@bootPath\@/$bootPath/g;
# Run extraPrepareConfig in sh
if ($extraPrepareConfig ne "") {
system((get("shell"), "-c", $extraPrepareConfig));