make-disk-image: fix broken EFI image builds

Work around missing /dev files inside runInLinuxVM by creating a
symlink before calling nixos-enter.

This fixes https://github.com/NixOS/nixpkgs/issues/93381.
I ran into this issue when trying to create a VMware image that boots from EFI.

Thanks @colemickens for reporting this and @danielfullmer for fixing the same thing in in qemu-vm.nix (37676e77cb) and explaining what the issue was.
master
Martin Schwaighofer 2021-04-20 23:00:05 +02:00
parent 00fe267003
commit f20ae954d5
1 changed files with 3 additions and 0 deletions

View File

@ -283,6 +283,9 @@ in pkgs.vmTools.runInLinuxVM (
# Some tools assume these exist
ln -s vda /dev/xvda
ln -s vda /dev/sda
# make systemd-boot find ESP without udev
mkdir /dev/block
ln -s /dev/vda1 /dev/block/254:1
mountPoint=/mnt
mkdir $mountPoint