push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
diff --git a/com32/include/stddef.h b/com32/include/stddef.h
index f52d62f3..437b11f2 100644
--- a/com32/include/stddef.h
+++ b/com32/include/stddef.h
@@ -29,4 +29,6 @@
*/
#define container_of(p, c, m) ((c *)((char *)(p) - offsetof(c,m)))
+typedef short wchar_t;
+
#endif /* _STDDEF_H */

View File

@@ -0,0 +1,22 @@
diff --git a/efi/main.c b/efi/main.c
index 6a748412..a914e31a 100644
--- a/efi/main.c
+++ b/efi/main.c
@@ -187,7 +187,7 @@ __export void local_boot(uint16_t ax)
* Inform the firmware that we failed to execute correctly, which
* will trigger the next entry in the EFI Boot Manager list.
*/
- longjmp(&load_error_buf, 1);
+ longjmp(load_error_buf, 1);
}
void bios_timer_cleanup(void)
@@ -1385,7 +1385,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *table)
status = uefi_call_wrapper(in->ReadKeyStroke, 2, in, &key);
} while (status == EFI_SUCCESS);
- if (!setjmp(&load_error_buf))
+ if (!setjmp(load_error_buf))
load_env32(NULL);
/* load_env32() failed.. cancel timer and bailout */

View File

@@ -0,0 +1,22 @@
From 68defee52f4eba82eefaeea17f21c7498448dd6b Mon Sep 17 00:00:00 2001
From: Samuel Dionne-Riel <samuel@dionne-riel.com>
Date: Mon, 3 Jun 2024 16:16:25 -0400
Subject: [PATCH] efi/efi.h: Add efisetjmp.h
See https://github.com/ncroxon/gnu-efi/commit/486ba3c3bdd147b7d98159b9e650be60bce0f027
---
efi/efi.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/efi/efi.h b/efi/efi.h
index c266532f3..e4497574b 100644
--- a/efi/efi.h
+++ b/efi/efi.h
@@ -23,6 +23,7 @@
#include <efi.h>
#include <efilib.h>
#include <efistdarg.h>
+#include <efisetjmp.h>
/* Delay for 100 ms */
#define EFI_NOMAP_PRINT_DELAY 100

View File

@@ -0,0 +1,149 @@
{
lib,
stdenv,
fetchFromRepoOrCz,
gnu-efi,
fetchpatch,
libuuid,
makeWrapper,
mtools,
nasm,
nixosTests,
perl,
python3,
}:
stdenv.mkDerivation {
pname = "syslinux";
version = "unstable-2019-02-07";
# This is syslinux-6.04-pre3^1; syslinux-6.04-pre3 fails to run.
# Same issue here https://www.syslinux.org/archives/2019-February/026330.html
src = fetchFromRepoOrCz {
repo = "syslinux";
rev = "b40487005223a78c3bb4c300ef6c436b3f6ec1f7";
hash = "sha256-XNC+X7UYxdMQQAg4MLACQLxRNnI5/ZCOiCJrEkKgPeM=";
};
patches =
let
archlinuxCommit = "db7884ec80642781edeead3e3bbd883a15b9b3ce";
fetchArchlinuxPatch =
name: hash:
fetchpatch {
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/syslinux/-/raw/${archlinuxCommit}/${name}";
inherit name hash;
};
in
[
(fetchArchlinuxPatch "0002-gfxboot-menu-label.patch" "sha256-eoId3jn4eRxItil5naoGMBGOJM/p5FG74ePwxiJ0w/8=")
(fetchArchlinuxPatch "0005-gnu-efi-version-compatibility.patch" "sha256-5oZ/24emWNPHx621v/9i2xU6rodpVCM0R18hCU35eDk=")
(fetchArchlinuxPatch "0006-Replace-builtin-strlen-that-appears-to-get-optimized.patch" "sha256-aq2vKqGonhMI2gRrAYNe+VRD8Vwijn7kOOv5wqAncx8=")
# mbr.bin: too big (452 > 440)
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906414
(fetchArchlinuxPatch "0016-strip-gnu-property.patch" "sha256-gn69YHbObqg6uTLPTtu8otNBFuCSyazwxLW3FbTNLX4=")
# mbr.bin: too big (452 > 440)
(fetchArchlinuxPatch "0017-single-load-segment.patch" "sha256-pGDcP62k50YkGgP0pFp5NSe7X0sojfLCzTmJtba2Yww=")
# Fixes build with "modern" gnu-efi
(fetchArchlinuxPatch "0018-prevent-pow-optimization.patch" "sha256-1+u8Kb6bxRbTPm0QCCt4yViLozzD/+/yspkJasOFM+g=")
(fetchArchlinuxPatch "0025-reproducible-build.patch" "sha256-vhth9CFHqChPQPgGhUWVpYwMFnnjoMVIGr7Wfu1jcDY=")
(fetchArchlinuxPatch "0027-use-correct-type-for-size.patch" "sha256-5nlKwIbXpZEyBrBSq9Zg0D+PRF7/kzEG13WzpwzDpPA=")
./import-efisetjmp.patch
# Upstream patch: https://www.syslinux.org/archives/2024-February/026903.html
./define-wchar_t.patch
# gnu-efi changed their definition to already be a 1-elem array, don't double-ref it.
# https://github.com/ncroxon/gnu-efi/commit/5b74db0e154ffd2fba4bcc254069844f21913988
./fix-longjmp-calls.patch
];
postPatch = ''
substituteInPlace Makefile --replace-fail /bin/pwd $(type -P pwd)
substituteInPlace utils/ppmtolss16 --replace-fail /usr/bin/perl $(type -P perl)
# fix tests
substituteInPlace tests/unittest/include/unittest/unittest.h \
--replace-fail /usr/include/ ""
'';
nativeBuildInputs = [
nasm
perl
python3
makeWrapper
];
buildInputs = [
libuuid
gnu-efi
];
# Fails very rarely with 'No rule to make target: ...'
enableParallelBuilding = false;
hardeningDisable = [
"pic"
"pie" # MBR gets too big with PIE
"stackprotector"
"fortify"
];
stripDebugList = [
"bin"
"sbin"
"share/syslinux/com32"
];
# Workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: acpi/xsdt.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: multiple definition of
# `e820_types'; memory.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: first defined here
env.NIX_CFLAGS_COMPILE = "-fcommon";
makeFlags = [
"BINDIR=$(out)/bin"
"SBINDIR=$(out)/sbin"
"DATADIR=$(out)/share"
"MANDIR=$(out)/share/man"
"PERL=perl"
"HEXDATE=0x00000000"
# Works around confusing (unrelated) error messages when upx is not made available
"UPX=false"
# Configurations needed to make use of external gnu-efi
"LIBEFI=${gnu-efi}/lib/libefi.a"
"LIBDIR=${gnu-efi}/lib/"
"EFIINC=${gnu-efi}/include/efi"
# Legacy bios boot target is always built
"bios"
]
# Build "ia32" EFI for i686
++ lib.optional stdenv.hostPlatform.isi686 "efi32"
# Build "x86_64" EFI for x86_64
++ lib.optional stdenv.hostPlatform.isx86_64 "efi64";
# Some tests require qemu, some others fail in a sandboxed environment
doCheck = false;
postInstall = ''
wrapProgram $out/bin/syslinux \
--prefix PATH : "${mtools}/bin"
# Delete com32 headers to save space, nobody seems to be using them
rm -rf $out/share/syslinux/com32
'';
passthru.tests.biosCdrom = nixosTests.boot.biosCdrom;
meta = with lib; {
homepage = "https://www.syslinux.org/";
description = "Lightweight bootloader";
license = licenses.gpl2Plus;
maintainers = [ ];
platforms = [
"i686-linux"
"x86_64-linux"
];
};
}