diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2024-06-28 07:44:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-28 07:44:35 +0200 |
commit | 71e51a064f09898150ba471fcfc7b22ef1976973 (patch) | |
tree | 8b01d665119c75f8505fbdc551587cc635332fc0 /nixos/lib/make-disk-image.nix | |
parent | 4fd75ee458c7015158513cbfb2271d33d3bee805 (diff) | |
parent | c902526b898c8aa633dbaa09e4d340a03829aa18 (diff) |
Merge pull request #322178 from NixOS/backport-319238-to-release-24.05
[Backport release-24.05] make-disk-image: fix build for systems that use boot.loader.grub.devices
Diffstat (limited to 'nixos/lib/make-disk-image.nix')
-rw-r--r-- | nixos/lib/make-disk-image.nix | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix index 9bdbf4e0713de..1220bbfd5ed7c 100644 --- a/nixos/lib/make-disk-image.nix +++ b/nixos/lib/make-disk-image.nix @@ -603,10 +603,11 @@ let format' = format; in let ${lib.optionalString installBootLoader '' # In this throwaway resource, we only have /dev/vda, but the actual VM may refer to another disk for bootloader, e.g. /dev/vdb # Use this option to create a symlink from vda to any arbitrary device you want. - ${optionalString (config.boot.loader.grub.enable && config.boot.loader.grub.device != "/dev/vda") '' - mkdir -p $(dirname ${config.boot.loader.grub.device}) - ln -s /dev/vda ${config.boot.loader.grub.device} - ''} + ${optionalString (config.boot.loader.grub.enable) (lib.concatMapStringsSep " " (device: + lib.optionalString (device != "/dev/vda") '' + mkdir -p "$(dirname ${device})" + ln -s /dev/vda ${device} + '') config.boot.loader.grub.devices)} # Set up core system link, bootloader (sd-boot, GRUB, uboot, etc.), etc. |