-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
seabios refactors #342692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
seabios refactors #342692
Changes from all commits
a2f33a4
b4e7632
525eeba
dd122c5
e032a06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,11 +1,37 @@ | ||||||||
| { lib | ||||||||
| , stdenv | ||||||||
| , fetchgit | ||||||||
| , acpica-tools | ||||||||
| , python3 | ||||||||
| , writeText | ||||||||
| { | ||||||||
| lib, | ||||||||
| acpica-tools, | ||||||||
| fetchgit, | ||||||||
| python3, | ||||||||
| stdenv, | ||||||||
| writeText, | ||||||||
| # Configurable options | ||||||||
| ___build-type ? "csm", | ||||||||
| }: | ||||||||
|
|
||||||||
| assert lib.elem (___build-type) [ | ||||||||
| "coreboot" | ||||||||
| # SeaBIOS with CSM (Compatible Support Module) support; learn more at | ||||||||
| # https://www.electronicshub.org/what-is-csm-bios/ | ||||||||
| "csm" | ||||||||
| "qemu" | ||||||||
| ]; | ||||||||
| let | ||||||||
| biosfile = | ||||||||
| { | ||||||||
| "coreboot" = "bios.bin.elf"; | ||||||||
| "csm" = "Csm16.bin"; | ||||||||
| "qemu" = "bios.bin"; | ||||||||
| } | ||||||||
| .${___build-type}; | ||||||||
| configuration-string = | ||||||||
| { | ||||||||
| "coreboot" = "CONFIG_COREBOOT"; | ||||||||
| "csm" = "CONFIG_CSM"; | ||||||||
| "qemu" = "CONFIG_QEMU"; | ||||||||
| } | ||||||||
| .${___build-type}; | ||||||||
| in | ||||||||
| stdenv.mkDerivation (finalAttrs: { | ||||||||
| pname = "seabios"; | ||||||||
| version = "1.16.3"; | ||||||||
|
|
@@ -16,7 +42,10 @@ stdenv.mkDerivation (finalAttrs: { | |||||||
| hash = "sha256-hWemj83cxdY8p+Jhkh5GcPvI0Sy5aKYZJCsKDjHTUUk="; | ||||||||
| }; | ||||||||
|
|
||||||||
| outputs = [ "out" "doc" ]; | ||||||||
| outputs = [ | ||||||||
| "out" | ||||||||
| "doc" | ||||||||
| ]; | ||||||||
|
|
||||||||
| nativeBuildInputs = [ python3 ]; | ||||||||
|
|
||||||||
|
|
@@ -29,31 +58,42 @@ stdenv.mkDerivation (finalAttrs: { | |||||||
| "EXTRAVERSION=\"-nixpkgs\"" | ||||||||
| ]; | ||||||||
|
|
||||||||
| hardeningDisable = [ "pic" "stackprotector" "fortify" ]; | ||||||||
| hardeningDisable = [ | ||||||||
| "fortify" | ||||||||
| "pic" | ||||||||
| "stackprotector" | ||||||||
| ]; | ||||||||
|
|
||||||||
| 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 | ||||||||
| ''; | ||||||||
| postConfigure = | ||||||||
| let | ||||||||
| config = writeText "config.txt" ( | ||||||||
| lib.generators.toKeyValue { } { | ||||||||
| "${configuration-string}" = "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/ | ||||||||
| mkdir -pv ''${!outputDoc}/share/doc/seabios-${finalAttrs.version}/ | ||||||||
| cp -v docs/* ''${!outputDoc}/share/doc/seabios-${finalAttrs.version}/ | ||||||||
| install -Dm644 out/${biosfile} -t $out/share/seabios/ | ||||||||
|
|
||||||||
| runHook postInstall | ||||||||
| ''; | ||||||||
|
|
||||||||
| passthru = { | ||||||||
| build-type = ___build-type; | ||||||||
AndersonTorres marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
| firmware = "${finalAttrs.finalPackage}/share/seabios/${biosfile}"; | ||||||||
| }; | ||||||||
|
|
||||||||
| meta = { | ||||||||
| homepage = "https://www.seabios.org"; | ||||||||
| description = "Open source implementation of a 16bit x86 BIOS"; | ||||||||
|
|
@@ -64,9 +104,7 @@ stdenv.mkDerivation (finalAttrs: { | |||||||
| ''; | ||||||||
| 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; | ||||||||
| platforms = lib.systems.inspect.patternLogicalAnd lib.systems.inspect.patterns.isUnix lib.systems.inspect.patterns.isx86; | ||||||||
|
||||||||
| platforms = lib.systems.inspect.patternLogicalAnd lib.systems.inspect.patterns.isUnix lib.systems.inspect.patterns.isx86; | |
| platforms = lib.intersectLists lib.platforms.unix lib.platforms.x86_64; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String-y platforms are considered legacy (
Line 208 in fd698a4
| 1. (legacy) a system string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow. Why is everyone still using it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it is because the modern way is not so well documented and it is a bit harder to understand.
Further, there are some dark corners on Nixpkgs that still expect the stringy values.
Uh oh!
There was an error while loading. Please reload this page.