nixos-generators icon indicating copy to clipboard operation
nixos-generators copied to clipboard

Can not boot raw-efi image

Open ashraffouda opened this issue 3 years ago • 8 comments

I was trying to build a raw-efi image using nixos-generators, and when I tried to boot it using cloud-hyvervisor it always giving this error and I have no clue what to do to make it bootable built it like this NIX_PATH=nixpkgs=channel:nixos-22.05 nix-shell -p nixos-generators --run "nixos-generate --format raw-efi -o result" and booted it with cloud-hypervisor cloud-hypervisor --kernel ./hypervisor-fw --disk path=nixos.img --cpus boot=4 --memory size=1024M --console off --serial tty --cmdline "boot.debug1 debug1" Screenshot from 2022-11-18 16-41-48

ashraffouda avatar Nov 20 '22 11:11 ashraffouda

hmm, will have to investigate that deeper I guess. what kind of bootloader are you using? I'm not sure where the initrd is coming from in your example? is it not needed?

Lassulus avatar Nov 21 '22 21:11 Lassulus

i'm using this https://github.com/cloud-hypervisor/cloud-hypervisor/ to boot the image now I'm kinda did a work around to boot it, I made efi enabled qcow image then converted it to raw and it works that way

ashraffouda avatar Nov 22 '22 13:11 ashraffouda

btw, I added a qcow-efi to make this work for me, should I add a pr here? or it is not needed?

ashraffouda avatar Nov 22 '22 14:11 ashraffouda

we can add that for now, It would also be nice to find out why raw does not work :)

Lassulus avatar Nov 22 '22 14:11 Lassulus

at some point in the far future I would like to refactor the nixpkgs images to do more of the abstraction which is currently done in this repo

Lassulus avatar Nov 22 '22 14:11 Lassulus

d that for now, It would also be nice to find out why raw does not work :

will try to find out why, but was kinda in hurry to make something work for us

ashraffouda avatar Nov 22 '22 14:11 ashraffouda

The image is missing the following kernel modules I believe:

boot.initrd.kernelModules = [
    "virtio_blk"
    "virtio_pmem"
    "virtio_console"
    "virtio_pci"
    "virtio_mmio"
  ];

Probably some of them are not needed all the time, but I believe virtio_pci is the critical one in this context.

RaitoBezarius avatar Mar 24 '23 23:03 RaitoBezarius

(I succeeded into booting a raw-efi image with this adjustement.)

RaitoBezarius avatar Mar 24 '23 23:03 RaitoBezarius