xen: deduplicate common patches and drop figs

The IPXE patch is the same across all versions.
Let us put generic patches in the new generic/ directory.

We also disable figs, as they were broken.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
This commit is contained in:
Fernando Rodrigues 2024-08-11 16:47:31 +00:00
parent 4dd8450a22
commit e1d3b403f3
No known key found for this signature in database
GPG Key ID: CC3AE2EA00000000
13 changed files with 9 additions and 167 deletions

View File

@ -1,16 +0,0 @@
Remove a pipe that was causing SIGPIPE
issues on overloaded Hydra machines.
diff --git a/docs/figs/Makefile b/docs/figs/Makefile
index e128a4364f..943f745dda 100644
--- a/docs/figs/Makefile
+++ b/docs/figs/Makefile
@@ -8,7 +8,7 @@ TARGETS= network-bridge.png network-basic.png
all: $(TARGETS)
%.png: %.fig
- $(FIG2DEV) -L png $< >$@.tmp
+ $(FIG2DEV) -L png $< $@.tmp
mv -f $@.tmp $@
clean:

View File

@ -28,10 +28,7 @@ callPackage (import ../generic/default.nix {
xen = {
rev = "4b33780de790bd438dd7cbb6143b410d94f0f049";
hash = "sha256-2kcmfKwBo3w1U5CSxLSYSteqvzcJaB+cA7keVb3amyA=";
patches = [
./0000-xen-ipxe-src-4.16.patch
./0001-xen-fig-geneneration-4.16.patch
] ++ upstreamPatchList;
patches = [ ] ++ upstreamPatchList;
};
qemu = {
rev = "c02cb236b5e4a76cf74e641cc35a0e3ebd3e52f3";

View File

@ -1,27 +0,0 @@
Hack to make etherboot use pre-fetched iPXE.
diff --git a/tools/firmware/etherboot/Makefile b/tools/firmware/etherboot/Makefile
index ed9e11305f..979a3acea8 100644
--- a/tools/firmware/etherboot/Makefile
+++ b/tools/firmware/etherboot/Makefile
@@ -16,6 +16,7 @@ IPXE_TARBALL_URL ?= $(XEN_EXTFILES_URL)/ipxe-git-$(IPXE_GIT_TAG).tar.gz
D=ipxe
T=ipxe.tar.gz
+G=ipxe.git
ROMS = $(addprefix $D/src/bin/, $(addsuffix .rom, $(ETHERBOOT_NICS)))
ROM = $D/src/bin/ipxe.bin
@@ -41,9 +42,9 @@ $T:
fi
mv _$T $T
-$D/src/arch/i386/Makefile: $T Config
- rm -rf $D
- gzip -dc $T | tar xf -
+$D/src/arch/i386/Makefile: $G Config
+ mkdir $D
+ cp -a $G/* $D
for i in $$(cat patches/series) ; do \
patch -d $D -p1 --quiet <patches/$$i || exit 1 ; \
done

View File

@ -1,16 +0,0 @@
Remove a pipe that was causing SIGPIPE
issues on overloaded Hydra machines.
diff --git a/docs/figs/Makefile b/docs/figs/Makefile
index e128a4364f..943f745dda 100644
--- a/docs/figs/Makefile
+++ b/docs/figs/Makefile
@@ -8,7 +8,7 @@ TARGETS= network-bridge.png network-basic.png
all: $(TARGETS)
%.png: %.fig
- $(FIG2DEV) -L png $< >$@.tmp
+ $(FIG2DEV) -L png $< $@.tmp
mv -f $@.tmp $@
clean:

View File

@ -29,10 +29,7 @@ callPackage (import ../generic/default.nix {
xen = {
rev = "d530627aaa9b6e03c7f911434bb342fca3d13300";
hash = "sha256-4ltQUzo4XPzGT/7fGt1hnNMqBQBVF7VP+WXD9ZaJcGo=";
patches = [
./0000-xen-ipxe-src-4.17.patch
./0001-xen-fig-geneneration-4.17.patch
] ++ upstreamPatchList;
patches = [ ] ++ upstreamPatchList;
};
qemu = {
rev = "ffb451126550b22b43b62fb8731a0d78e3376c03";

View File

@ -1,27 +0,0 @@
Hack to make etherboot use pre-fetched iPXE.
diff --git a/tools/firmware/etherboot/Makefile b/tools/firmware/etherboot/Makefile
index ed9e11305f..979a3acea8 100644
--- a/tools/firmware/etherboot/Makefile
+++ b/tools/firmware/etherboot/Makefile
@@ -16,6 +16,7 @@ IPXE_TARBALL_URL ?= $(XEN_EXTFILES_URL)/ipxe-git-$(IPXE_GIT_TAG).tar.gz
D=ipxe
T=ipxe.tar.gz
+G=ipxe.git
ROMS = $(addprefix $D/src/bin/, $(addsuffix .rom, $(ETHERBOOT_NICS)))
ROM = $D/src/bin/ipxe.bin
@@ -41,9 +42,9 @@ $T:
fi
mv _$T $T
-$D/src/arch/i386/Makefile: $T Config
- rm -rf $D
- gzip -dc $T | tar xf -
+$D/src/arch/i386/Makefile: $G Config
+ mkdir $D
+ cp -a $G/* $D
for i in $$(cat patches/series) ; do \
patch -d $D -p1 --quiet <patches/$$i || exit 1 ; \
done

View File

@ -1,16 +0,0 @@
Remove a pipe that was causing SIGPIPE
issues on overloaded Hydra machines.
diff --git a/docs/figs/Makefile b/docs/figs/Makefile
index e128a4364f..943f745dda 100644
--- a/docs/figs/Makefile
+++ b/docs/figs/Makefile
@@ -8,7 +8,7 @@ TARGETS= network-bridge.png network-basic.png
all: $(TARGETS)
%.png: %.fig
- $(FIG2DEV) -L png $< >$@.tmp
+ $(FIG2DEV) -L png $< $@.tmp
mv -f $@.tmp $@
clean:

View File

@ -29,10 +29,7 @@ callPackage (import ../generic/default.nix {
xen = {
rev = "d152a0424677d8b78e00ed1270a583c5dafff16f";
hash = "sha256-pHCjj+Bcy4xQfB9xHU9fccFwVdP2DXrUhdszwGvrdmY=";
patches = [
./0000-xen-ipxe-src-4.18.patch
./0001-xen-fig-geneneration-4.18.patch
] ++ upstreamPatchList;
patches = [ ] ++ upstreamPatchList;
};
qemu = {
rev = "0df9387c8983e1b1e72d8c574356f572342c03e6";

View File

@ -1,27 +0,0 @@
Hack to make etherboot use pre-fetched iPXE.
diff --git a/tools/firmware/etherboot/Makefile b/tools/firmware/etherboot/Makefile
index ed9e11305f..979a3acea8 100644
--- a/tools/firmware/etherboot/Makefile
+++ b/tools/firmware/etherboot/Makefile
@@ -16,6 +16,7 @@ IPXE_TARBALL_URL ?= $(XEN_EXTFILES_URL)/ipxe-git-$(IPXE_GIT_TAG).tar.gz
D=ipxe
T=ipxe.tar.gz
+G=ipxe.git
ROMS = $(addprefix $D/src/bin/, $(addsuffix .rom, $(ETHERBOOT_NICS)))
ROM = $D/src/bin/ipxe.bin
@@ -41,9 +42,9 @@ $T:
fi
mv _$T $T
-$D/src/arch/i386/Makefile: $T Config
- rm -rf $D
- gzip -dc $T | tar xf -
+$D/src/arch/i386/Makefile: $G Config
+ mkdir $D
+ cp -a $G/* $D
for i in $$(cat patches/series) ; do \
patch -d $D -p1 --quiet <patches/$$i || exit 1 ; \
done

View File

@ -1,16 +0,0 @@
Remove a pipe that was causing SIGPIPE
issues on overloaded Hydra machines.
diff --git a/docs/figs/Makefile b/docs/figs/Makefile
index e128a4364f..943f745dda 100644
--- a/docs/figs/Makefile
+++ b/docs/figs/Makefile
@@ -8,7 +8,7 @@ TARGETS= network-bridge.png network-basic.png
all: $(TARGETS)
%.png: %.fig
- $(FIG2DEV) -L png $< >$@.tmp
+ $(FIG2DEV) -L png $< $@.tmp
mv -f $@.tmp $@
clean:

View File

@ -28,10 +28,7 @@ callPackage (import ../generic/default.nix {
xen = {
rev = "026c9fa29716b0ff0f8b7c687908e71ba29cf239";
hash = "sha256-Q6x+2fZ4ITBz6sKICI0NHGx773Rc919cl+wzI89UY+Q=";
patches = [
./0000-xen-ipxe-src-4.19.patch
./0001-xen-fig-geneneration-4.19.patch
] ++ upstreamPatchList;
patches = [ ] ++ upstreamPatchList;
};
qemu = {
rev = "0df9387c8983e1b1e72d8c574356f572342c03e6";

View File

@ -58,8 +58,6 @@ versionDefinition:
binutils-unwrapped,
# Documentation
fig2dev,
imagemagick,
pandoc,
# Scripts
@ -333,16 +331,17 @@ stdenv.mkDerivation (finalAttrs: {
inherit (pkg.xen) hash;
};
# Gets the patches from the pkg.xen.patches attribute from the versioned files.
patches = lib.lists.optionals (lib.attrsets.hasAttrByPath [ "patches" ] pkg.xen) pkg.xen.patches;
patches =
# Generic Xen patches that apply to all Xen versions.
[ ./0000-xen-ipxe-src-generic.patch ]
# Gets the patches from the pkg.xen.patches attribute from the versioned files.
++ lib.lists.optionals (lib.attrsets.hasAttrByPath [ "patches" ] pkg.xen) pkg.xen.patches;
nativeBuildInputs =
[
autoPatchelfHook
bison
cmake
fig2dev
imagemagick # Causes build failures in Hydra related to fig generation if not included.
flex
pandoc
pkg-config