forked from rarias/nixos-riscv
Move qemu specific config to vm.nix
This commit is contained in:
32
vm.nix
32
vm.nix
@@ -8,8 +8,11 @@
|
||||
];
|
||||
|
||||
boot = {
|
||||
kernelParams = [ "boot.shell_on_fail" ];
|
||||
#kernelPackages = lib.mkForce pkgs.linuxPackagesCustom;
|
||||
kernelParams = [
|
||||
"console=tty1"
|
||||
"console=ttyS0,115200"
|
||||
"boot.shell_on_fail"
|
||||
];
|
||||
consoleLogLevel = lib.mkDefault 7;
|
||||
initrd.kernelModules = [
|
||||
"virtio_pci"
|
||||
@@ -54,4 +57,29 @@
|
||||
generic-extlinux-compatible.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
qemu = prev.qemu.override { rutabagaSupport = false; };
|
||||
|
||||
uboot-custom = prev.ubootQemuRiscv64Smode.override {
|
||||
# Override preboot to set 'bootcmd' directly to the kernel address in RAM
|
||||
extraConfig = ''
|
||||
CONFIG_PREBOOT="setenv fdt_addr ''${fdtcontroladdr}; fdt addr ''${fdtcontroladdr}; setenv bootcmd booti ''${kernel_addr_r} - ''${fdtcontroladdr};"
|
||||
CONFIG_RISCV_ISA_C=n
|
||||
'';
|
||||
# Also include debug u-boot
|
||||
filesToInstall = ["u-boot.bin" "u-boot"];
|
||||
};
|
||||
|
||||
opensbi-uboot = prev.opensbi.overrideAttrs (old: {
|
||||
makeFlags = old.makeFlags ++ [
|
||||
# Build OpenSBI without compressed instructions
|
||||
"PLATFORM_RISCV_ISA=rv64g"
|
||||
# Check with: riscv64-unknown-elf-objdump -d -M no-aliases rotate
|
||||
"FW_PAYLOAD_PATH=${final.uboot-custom}/u-boot.bin"
|
||||
];
|
||||
});
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user