Merge pull request #271008 from atorres1985-contrib/seabios

seabios: 1.16.2 -> 1.16.3 (plus misc updates)
This commit is contained in:
Adam C. Stephens
2023-12-20 11:28:28 -05:00
committed by GitHub
5 changed files with 75 additions and 57 deletions
@@ -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 = (
@@ -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" ];
};
}
@@ -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"
+72
View File
@@ -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 ];
};
})
-2
View File
@@ -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; };