make-disk-image: fix build for systems that use boot.loader.grub.devices
config.boot.loader.grub.device is just an alias that gets assigned to config.boot.loader.grub.devices. If config.boot.loader.grub.device is set to null, it will fail with the following error as described in https://github.com/nix-community/nixos-generators/issues/339
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user