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.
wip/yesman
Martin Schwaighofer 3 years ago
parent 00fe267003
commit f20ae954d5
  1. 3
      nixos/lib/make-disk-image.nix

@ -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

Loading…
Cancel
Save