Merge pull request #25896 from joachifm/ovmf
ovmf: split firmware image files
This commit is contained in:
commit
07ceaa2ec8
@ -15,7 +15,7 @@ let
|
|||||||
'';
|
'';
|
||||||
qemuConfigFile = pkgs.writeText "qemu.conf" ''
|
qemuConfigFile = pkgs.writeText "qemu.conf" ''
|
||||||
${optionalString cfg.qemuOvmf ''
|
${optionalString cfg.qemuOvmf ''
|
||||||
nvram = ["${pkgs.OVMF}/FV/OVMF_CODE.fd:${pkgs.OVMF}/FV/OVMF_VARS.fd"]
|
nvram = ["${pkgs.OVMF.fd}/FV/OVMF_CODE.fd:${pkgs.OVMF.fd}/FV/OVMF_VARS.fd"]
|
||||||
''}
|
''}
|
||||||
${cfg.qemuVerbatimConfig}
|
${cfg.qemuVerbatimConfig}
|
||||||
'';
|
'';
|
||||||
|
@ -126,7 +126,7 @@ let
|
|||||||
bootFlash=$out/bios.bin
|
bootFlash=$out/bios.bin
|
||||||
${qemu}/bin/qemu-img create -f qcow2 $diskImage "40M"
|
${qemu}/bin/qemu-img create -f qcow2 $diskImage "40M"
|
||||||
${if cfg.useEFIBoot then ''
|
${if cfg.useEFIBoot then ''
|
||||||
cp ${pkgs.OVMF-CSM}/FV/OVMF.fd $bootFlash
|
cp ${pkgs.OVMF-CSM.fd}/FV/OVMF.fd $bootFlash
|
||||||
chmod 0644 $bootFlash
|
chmod 0644 $bootFlash
|
||||||
'' else ''
|
'' else ''
|
||||||
''}
|
''}
|
||||||
|
@ -40,12 +40,12 @@ in {
|
|||||||
|
|
||||||
uefiCdrom = makeBootTest "uefi-cdrom" ''
|
uefiCdrom = makeBootTest "uefi-cdrom" ''
|
||||||
cdrom => glob("${iso}/iso/*.iso"),
|
cdrom => glob("${iso}/iso/*.iso"),
|
||||||
bios => '${pkgs.OVMF}/FV/OVMF.fd'
|
bios => '${pkgs.OVMF.fd}/FV/OVMF.fd'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
uefiUsb = makeBootTest "uefi-usb" ''
|
uefiUsb = makeBootTest "uefi-usb" ''
|
||||||
usb => glob("${iso}/iso/*.iso"),
|
usb => glob("${iso}/iso/*.iso"),
|
||||||
bios => '${pkgs.OVMF}/FV/OVMF.fd'
|
bios => '${pkgs.OVMF.fd}/FV/OVMF.fd'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
netboot = let
|
netboot = let
|
||||||
|
@ -63,7 +63,7 @@ let
|
|||||||
(if system == "x86_64-linux" then "-m 768 " else "-m 512 ") +
|
(if system == "x86_64-linux" then "-m 768 " else "-m 512 ") +
|
||||||
(optionalString (system == "x86_64-linux") "-cpu kvm64 ");
|
(optionalString (system == "x86_64-linux") "-cpu kvm64 ");
|
||||||
hdFlags = ''hda => "vm-state-machine/machine.qcow2", hdaInterface => "${iface}", ''
|
hdFlags = ''hda => "vm-state-machine/machine.qcow2", hdaInterface => "${iface}", ''
|
||||||
+ optionalString (bootLoader == "systemd-boot") ''bios => "${pkgs.OVMF}/FV/OVMF.fd", '';
|
+ optionalString (bootLoader == "systemd-boot") ''bios => "${pkgs.OVMF.fd}/FV/OVMF.fd", '';
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
$machine->start;
|
$machine->start;
|
||||||
|
@ -15,6 +15,8 @@ in
|
|||||||
stdenv.mkDerivation (edk2.setup "OvmfPkg/OvmfPkg${targetArch}.dsc" {
|
stdenv.mkDerivation (edk2.setup "OvmfPkg/OvmfPkg${targetArch}.dsc" {
|
||||||
name = "OVMF-${version}";
|
name = "OVMF-${version}";
|
||||||
|
|
||||||
|
outputs = [ "out" "fd" ];
|
||||||
|
|
||||||
# TODO: properly include openssl for secureBoot
|
# TODO: properly include openssl for secureBoot
|
||||||
buildInputs = [nasm iasl] ++ stdenv.lib.optionals (secureBoot == true) [ openssl ];
|
buildInputs = [nasm iasl] ++ stdenv.lib.optionals (secureBoot == true) [ openssl ];
|
||||||
|
|
||||||
@ -48,6 +50,13 @@ stdenv.mkDerivation (edk2.setup "OvmfPkg/OvmfPkg${targetArch}.dsc" {
|
|||||||
build -D CSM_ENABLE -D FD_SIZE_2MB ${if secureBoot then "-DSECURE_BOOT_ENABLE=TRUE" else ""}
|
build -D CSM_ENABLE -D FD_SIZE_2MB ${if secureBoot then "-DSECURE_BOOT_ENABLE=TRUE" else ""}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
postFixup = ''
|
||||||
|
mkdir -p $fd/FV
|
||||||
|
mv $out/FV/OVMF{,_CODE,_VARS}.fd $fd/FV
|
||||||
|
'';
|
||||||
|
|
||||||
|
dontPatchELF = true;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Sample UEFI firmware for QEMU and KVM";
|
description = "Sample UEFI firmware for QEMU and KVM";
|
||||||
homepage = http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=OVMF;
|
homepage = http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=OVMF;
|
||||||
|
@ -167,7 +167,7 @@ callPackage (import ./generic.nix (rec {
|
|||||||
++ optional (withSeabios) "--with-system-seabios=${seabios}"
|
++ optional (withSeabios) "--with-system-seabios=${seabios}"
|
||||||
++ optional (!withInternalSeabios && !withSeabios) "--disable-seabios"
|
++ optional (!withInternalSeabios && !withSeabios) "--disable-seabios"
|
||||||
|
|
||||||
++ optional (withOVMF) "--with-system-ovmf=${OVMF}"
|
++ optional (withOVMF) "--with-system-ovmf=${OVMF.fd}/FV/OVMF.fd"
|
||||||
++ optional (withInternalOVMF) "--enable-ovmf";
|
++ optional (withInternalOVMF) "--enable-ovmf";
|
||||||
|
|
||||||
patches =
|
patches =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user