diff --git a/pkgs/applications/virtualization/OVMF/default.nix b/pkgs/applications/virtualization/OVMF/default.nix index ca2c0f890d9a..b921e63ec9fe 100644 --- a/pkgs/applications/virtualization/OVMF/default.nix +++ b/pkgs/applications/virtualization/OVMF/default.nix @@ -1,5 +1,5 @@ { stdenv, nixosTests, lib, edk2, util-linux, nasm, acpica-tools, llvmPackages -, csmSupport ? false, seabios ? null +, csmSupport ? false, seabios , fdSize2MB ? csmSupport , fdSize4MB ? false , secureBoot ? false @@ -12,8 +12,6 @@ , sourceDebug ? false }: -assert csmSupport -> seabios != null; - let projectDscPath = if stdenv.isi686 then @@ -68,7 +66,7 @@ edk2.mkDerivation projectDscPath (finalAttrs: { env.PYTHON_COMMAND = "python3"; postPatch = lib.optionalString csmSupport '' - cp ${seabios}/Csm16.bin OvmfPkg/Csm/Csm16/Csm16.bin + cp ${seabios}/share/seabios/Csm16.bin OvmfPkg/Csm/Csm16/Csm16.bin ''; postFixup = ( diff --git a/pkgs/applications/virtualization/seabios/default.nix b/pkgs/applications/virtualization/seabios/default.nix deleted file mode 100644 index 6256660161c1..000000000000 --- a/pkgs/applications/virtualization/seabios/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ lib, stdenv, fetchgit, acpica-tools, python3 }: - -stdenv.mkDerivation rec { - - pname = "seabios"; - version = "1.16.2"; - - src = fetchgit { - url = "https://git.seabios.org/seabios.git"; - rev = "rel-${version}"; - sha256 = "sha256-J2FuT+FXn9YoFLSfxDOxyKZvKrys59a6bP1eYvEXVNU="; - }; - - nativeBuildInputs = [ python3 ]; - - buildInputs = [ acpica-tools ]; - - strictDeps = true; - - hardeningDisable = [ "pic" "stackprotector" "fortify" ]; - - configurePhase = '' - # build SeaBIOS for CSM - cat > .config << EOF - CONFIG_CSM=y - CONFIG_QEMU_HARDWARE=y - CONFIG_PERMIT_UNALIGNED_PCIROM=y - EOF - - make olddefconfig - ''; - - installPhase = '' - mkdir $out - cp out/Csm16.bin $out/Csm16.bin - ''; - - meta = with lib; { - description = "Open source implementation of a 16bit X86 BIOS"; - longDescription = '' - SeaBIOS is an open source implementation of a 16bit X86 BIOS. - It can run in an emulator or it can run natively on X86 hardware with the use of coreboot. - SeaBIOS is the default BIOS for QEMU and KVM. - ''; - homepage = "http://www.seabios.org"; - license = licenses.lgpl3; - maintainers = with maintainers; [ ]; - platforms = [ "i686-linux" "x86_64-linux" ]; - }; -} diff --git a/pkgs/applications/virtualization/xen/4.15.nix b/pkgs/applications/virtualization/xen/4.15.nix index 11f5900ee84c..5cc81fc0ab85 100644 --- a/pkgs/applications/virtualization/xen/4.15.nix +++ b/pkgs/applications/virtualization/xen/4.15.nix @@ -122,7 +122,7 @@ callPackage (import ./generic.nix (rec { ++ optional (withInternalTraditionalQemu) "--enable-qemu-traditional" ++ optional (!withInternalTraditionalQemu) "--disable-qemu-traditional" - ++ optional (withSeabios) "--with-system-seabios=${seabios}" + ++ optional (withSeabios) "--with-system-seabios=${seabios}/share/seabios" ++ optional (!withInternalSeabios && !withSeabios) "--disable-seabios" ++ optional (withOVMF) "--with-system-ovmf=${OVMF.fd}/FV/OVMF.fd" diff --git a/pkgs/by-name/se/seabios/package.nix b/pkgs/by-name/se/seabios/package.nix new file mode 100644 index 000000000000..713f58702113 --- /dev/null +++ b/pkgs/by-name/se/seabios/package.nix @@ -0,0 +1,72 @@ +{ lib +, stdenv +, fetchgit +, acpica-tools +, python3 +, writeText +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "seabios"; + version = "1.16.3"; + + src = fetchgit { + url = "https://git.seabios.org/seabios.git"; + rev = "rel-${finalAttrs.version}"; + hash = "sha256-hWemj83cxdY8p+Jhkh5GcPvI0Sy5aKYZJCsKDjHTUUk="; + }; + + outputs = [ "out" "doc" ]; + + nativeBuildInputs = [ python3 ]; + + buildInputs = [ acpica-tools ]; + + strictDeps = true; + + makeFlags = [ + # https://www.seabios.org/Build_overview#Distribution_builds + "EXTRAVERSION=\"-nixpkgs\"" + ]; + + hardeningDisable = [ "pic" "stackprotector" "fortify" ]; + + postConfigure = let + config = writeText "config.txt" (lib.generators.toKeyValue { } { + # SeaBIOS with CSM (Compatible Support Module) support; learn more at + # https://www.electronicshub.org/what-is-csm-bios/ + "CONFIG_CSM" = "y"; + "CONFIG_PERMIT_UNALIGNED_PCIROM" = "y"; + "CONFIG_QEMU_HARDWARE" = "y"; + }); + in '' + cp ${config} .config + make olddefconfig + ''; + + installPhase = '' + runHook preInstall + + mkdir -pv $doc/share/doc/seabios-${finalAttrs.version}/ + cp -v docs/* $doc/share/doc/seabios-${finalAttrs.version}/ + install -Dm644 out/Csm16.bin -t $out/share/seabios/ + + runHook postInstall + ''; + + meta = { + homepage = "https://www.seabios.org"; + description = "Open source implementation of a 16bit x86 BIOS"; + longDescription = '' + SeaBIOS is an open source implementation of a 16bit x86 BIOS. + It can run in an emulator or it can run natively on x86 hardware with the + use of coreboot. + ''; + license = with lib.licenses; [ lgpl3Plus ]; + maintainers = with lib.maintainers; [ AndersonTorres ]; + platforms = lib.systems.inspect.patternLogicalAnd + lib.systems.inspect.patterns.isUnix + lib.systems.inspect.patterns.isx86; + badPlatforms = [ lib.systems.inspect.patterns.isDarwin ]; + }; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 914cd749788d..f9ccb48c3e35 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27104,8 +27104,6 @@ with pkgs; ops = callPackage ../applications/virtualization/ops { }; - seabios = callPackage ../applications/virtualization/seabios { }; - vmfs-tools = callPackage ../tools/filesystems/vmfs-tools { }; patroni = callPackage ../servers/sql/patroni { pythonPackages = python3Packages; };