From df9175c96841aea4ad02745d5771c5d0546b87f9 Mon Sep 17 00:00:00 2001 From: Nicolas MASSE Date: Thu, 30 Oct 2025 11:06:37 +0100 Subject: [PATCH] work in progress --- build.sh | 19 +++++++++++++++++++ centos-10/PATCHES/20-enable-zfs.patch | 26 ++++++++++++++++++++++++++ centos-10/SPECS/libvirt.spec | 18 ++---------------- centos-9/PATCHES/20-enable-zfs.patch | 26 ++++++++++++++++++++++++++ centos-9/SPECS/libvirt.spec | 9 ++------- fedora-41/PATCHES/20-enable-zfs.patch | 26 ++++++++++++++++++++++++++ fedora-41/SPECS/libvirt.spec | 9 ++------- fedora-42/PATCHES/20-enable-zfs.patch | 26 ++++++++++++++++++++++++++ fedora-42/SPECS/libvirt.spec | 9 ++------- fedora-43/PATCHES/20-enable-zfs.patch | 26 ++++++++++++++++++++++++++ fedora-43/SPECS/libvirt.spec | 9 ++------- update.sh | 22 ++++++++++++++++++---- 12 files changed, 177 insertions(+), 48 deletions(-) create mode 100755 build.sh create mode 100644 centos-10/PATCHES/20-enable-zfs.patch create mode 100644 centos-9/PATCHES/20-enable-zfs.patch create mode 100644 fedora-41/PATCHES/20-enable-zfs.patch create mode 100644 fedora-42/PATCHES/20-enable-zfs.patch create mode 100644 fedora-43/PATCHES/20-enable-zfs.patch diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..7f30563 --- /dev/null +++ b/build.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -Eeuo pipefail + +GIT_REPOSITORY="https://github.com/nmasse-itix/zfs-aarch64.git" +COPR_PROJECT="zfs-aarch64" +COPR_USERNAME="$(copr-cli whoami)" + +for dist in centos-* fedora-*; do + chroot="${dist//centos/epel}-aarch64" + echo "Building packages for $dist using $chroot..." + for spec in $dist/SPECS/*.spec; do + spec=${spec#$dist/} + copr-cli buildscm --clone-url "$GIT_REPOSITORY" --subdir "$dist" --spec "$spec" --chroot "$chroot" --nowait "$COPR_PROJECT" + done +done + +echo "All builds submitted to COPR project '@$COPR_USERNAME/$COPR_PROJECT'." +echo "You can monitor the build status at: https://copr.fedorainfracloud.org/coprs/$COPR_USERNAME/$COPR_PROJECT/builds/" diff --git a/centos-10/PATCHES/20-enable-zfs.patch b/centos-10/PATCHES/20-enable-zfs.patch new file mode 100644 index 0000000..36362ed --- /dev/null +++ b/centos-10/PATCHES/20-enable-zfs.patch @@ -0,0 +1,26 @@ +diff --git a/SPECS/libvirt.spec b/SPECS/libvirt.spec +--- a/SPECS/libvirt.spec ++++ b/SPECS/libvirt.spec +@@ -26,7 +26,7 @@ + %endif + %define arches_vbox %{arches_x86} + %define arches_ceph %{arches_64bit} +-%define arches_zfs %{arches_x86} %{power64} %{arm} ++%define arches_zfs %{arches_x86} %{power64} %{arm} aarch64 + %define arches_numactl %{arches_x86} %{power64} aarch64 s390x + %define arches_numad %{arches_x86} %{power64} aarch64 + %define arches_ch x86_64 aarch64 +@@ -76,12 +76,7 @@ + %define with_storage_gluster 0 + %endif + +-# Fedora had zfs-fuse until F43 +-%if 0%{?fedora} && 0%{?fedora} < 43 +- %define with_storage_zfs 0%{!?_without_storage_zfs:1} +-%else +- %define with_storage_zfs 0 +-%endif ++%define with_storage_zfs 1 + + %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1} + # libiscsi has been dropped in RHEL-9 diff --git a/centos-10/SPECS/libvirt.spec b/centos-10/SPECS/libvirt.spec index a012d21..c68a553 100644 --- a/centos-10/SPECS/libvirt.spec +++ b/centos-10/SPECS/libvirt.spec @@ -26,11 +26,7 @@ %endif %define arches_vbox %{arches_x86} %define arches_ceph %{arches_64bit} -%if 0%{?copr_projectname:1} - %define arches_zfs %{arches_x86} %{power64} %{arm} aarch64 -%else - %define arches_zfs %{arches_x86} %{power64} %{arm} -%endif +%define arches_zfs %{arches_x86} %{power64} %{arm} aarch64 %define arches_numactl %{arches_x86} %{power64} aarch64 s390x %define arches_numad %{arches_x86} %{power64} aarch64 %define arches_ch x86_64 aarch64 @@ -80,17 +76,7 @@ %define with_storage_gluster 0 %endif -# Local overrides for Copr -%if 0%{?copr_projectname:1} - %define with_storage_zfs 1 -%else - # Fedora had zfs-fuse until F43 - %if 0%{?fedora} && 0%{?fedora} < 43 - %define with_storage_zfs 0%{!?_without_storage_zfs:1} - %else - %define with_storage_zfs 0 - %endif -%endif +%define with_storage_zfs 1 %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1} # libiscsi has been dropped in RHEL-9 diff --git a/centos-9/PATCHES/20-enable-zfs.patch b/centos-9/PATCHES/20-enable-zfs.patch new file mode 100644 index 0000000..36362ed --- /dev/null +++ b/centos-9/PATCHES/20-enable-zfs.patch @@ -0,0 +1,26 @@ +diff --git a/SPECS/libvirt.spec b/SPECS/libvirt.spec +--- a/SPECS/libvirt.spec ++++ b/SPECS/libvirt.spec +@@ -26,7 +26,7 @@ + %endif + %define arches_vbox %{arches_x86} + %define arches_ceph %{arches_64bit} +-%define arches_zfs %{arches_x86} %{power64} %{arm} ++%define arches_zfs %{arches_x86} %{power64} %{arm} aarch64 + %define arches_numactl %{arches_x86} %{power64} aarch64 s390x + %define arches_numad %{arches_x86} %{power64} aarch64 + %define arches_ch x86_64 aarch64 +@@ -76,12 +76,7 @@ + %define with_storage_gluster 0 + %endif + +-# Fedora had zfs-fuse until F43 +-%if 0%{?fedora} && 0%{?fedora} < 43 +- %define with_storage_zfs 0%{!?_without_storage_zfs:1} +-%else +- %define with_storage_zfs 0 +-%endif ++%define with_storage_zfs 1 + + %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1} + # libiscsi has been dropped in RHEL-9 diff --git a/centos-9/SPECS/libvirt.spec b/centos-9/SPECS/libvirt.spec index f451ed8..5b9a1df 100644 --- a/centos-9/SPECS/libvirt.spec +++ b/centos-9/SPECS/libvirt.spec @@ -26,7 +26,7 @@ %endif %define arches_vbox %{arches_x86} %define arches_ceph %{arches_64bit} -%define arches_zfs %{arches_x86} %{power64} %{arm} +%define arches_zfs %{arches_x86} %{power64} %{arm} aarch64 %define arches_numactl %{arches_x86} %{power64} aarch64 s390x %define arches_numad %{arches_x86} %{power64} aarch64 %define arches_ch x86_64 aarch64 @@ -76,12 +76,7 @@ %define with_storage_gluster 0 %endif -# Fedora had zfs-fuse until F43 -%if 0%{?fedora} && 0%{?fedora} < 43 - %define with_storage_zfs 0%{!?_without_storage_zfs:1} -%else - %define with_storage_zfs 0 -%endif +%define with_storage_zfs 1 %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1} # libiscsi has been dropped in RHEL-9 diff --git a/fedora-41/PATCHES/20-enable-zfs.patch b/fedora-41/PATCHES/20-enable-zfs.patch new file mode 100644 index 0000000..3d22494 --- /dev/null +++ b/fedora-41/PATCHES/20-enable-zfs.patch @@ -0,0 +1,26 @@ +diff --git a/SPECS/libvirt.spec b/SPECS/libvirt.spec +--- a/SPECS/libvirt.spec ++++ b/SPECS/libvirt.spec +@@ -26,7 +26,7 @@ + %endif + %define arches_vbox %{arches_x86} + %define arches_ceph %{arches_64bit} +-%define arches_zfs %{arches_x86} %{power64} %{arm} ++%define arches_zfs %{arches_x86} %{power64} %{arm} aarch64 + %define arches_numactl %{arches_x86} %{power64} aarch64 s390x + %define arches_numad %{arches_x86} %{power64} aarch64 + +@@ -75,12 +75,7 @@ + %endif + %endif + +-# Fedora has zfs-fuse +-%if 0%{?fedora} +- %define with_storage_zfs 0%{!?_without_storage_zfs:1} +-%else +- %define with_storage_zfs 0 +-%endif ++%define with_storage_zfs 1 + + %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1} + # libiscsi has been dropped in RHEL-9 diff --git a/fedora-41/SPECS/libvirt.spec b/fedora-41/SPECS/libvirt.spec index 4004f21..9b7adb3 100644 --- a/fedora-41/SPECS/libvirt.spec +++ b/fedora-41/SPECS/libvirt.spec @@ -26,7 +26,7 @@ %endif %define arches_vbox %{arches_x86} %define arches_ceph %{arches_64bit} -%define arches_zfs %{arches_x86} %{power64} %{arm} +%define arches_zfs %{arches_x86} %{power64} %{arm} aarch64 %define arches_numactl %{arches_x86} %{power64} aarch64 s390x %define arches_numad %{arches_x86} %{power64} aarch64 @@ -75,12 +75,7 @@ %endif %endif -# Fedora has zfs-fuse -%if 0%{?fedora} - %define with_storage_zfs 0%{!?_without_storage_zfs:1} -%else - %define with_storage_zfs 0 -%endif +%define with_storage_zfs 1 %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1} # libiscsi has been dropped in RHEL-9 diff --git a/fedora-42/PATCHES/20-enable-zfs.patch b/fedora-42/PATCHES/20-enable-zfs.patch new file mode 100644 index 0000000..3d22494 --- /dev/null +++ b/fedora-42/PATCHES/20-enable-zfs.patch @@ -0,0 +1,26 @@ +diff --git a/SPECS/libvirt.spec b/SPECS/libvirt.spec +--- a/SPECS/libvirt.spec ++++ b/SPECS/libvirt.spec +@@ -26,7 +26,7 @@ + %endif + %define arches_vbox %{arches_x86} + %define arches_ceph %{arches_64bit} +-%define arches_zfs %{arches_x86} %{power64} %{arm} ++%define arches_zfs %{arches_x86} %{power64} %{arm} aarch64 + %define arches_numactl %{arches_x86} %{power64} aarch64 s390x + %define arches_numad %{arches_x86} %{power64} aarch64 + +@@ -75,12 +75,7 @@ + %endif + %endif + +-# Fedora has zfs-fuse +-%if 0%{?fedora} +- %define with_storage_zfs 0%{!?_without_storage_zfs:1} +-%else +- %define with_storage_zfs 0 +-%endif ++%define with_storage_zfs 1 + + %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1} + # libiscsi has been dropped in RHEL-9 diff --git a/fedora-42/SPECS/libvirt.spec b/fedora-42/SPECS/libvirt.spec index 196a0f1..51bfb0b 100644 --- a/fedora-42/SPECS/libvirt.spec +++ b/fedora-42/SPECS/libvirt.spec @@ -26,7 +26,7 @@ %endif %define arches_vbox %{arches_x86} %define arches_ceph %{arches_64bit} -%define arches_zfs %{arches_x86} %{power64} %{arm} +%define arches_zfs %{arches_x86} %{power64} %{arm} aarch64 %define arches_numactl %{arches_x86} %{power64} aarch64 s390x %define arches_numad %{arches_x86} %{power64} aarch64 %define arches_ch x86_64 aarch64 @@ -77,12 +77,7 @@ %endif %endif -# Fedora has zfs-fuse -%if 0%{?fedora} - %define with_storage_zfs 0%{!?_without_storage_zfs:1} -%else - %define with_storage_zfs 0 -%endif +%define with_storage_zfs 1 %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1} # libiscsi has been dropped in RHEL-9 diff --git a/fedora-43/PATCHES/20-enable-zfs.patch b/fedora-43/PATCHES/20-enable-zfs.patch new file mode 100644 index 0000000..36362ed --- /dev/null +++ b/fedora-43/PATCHES/20-enable-zfs.patch @@ -0,0 +1,26 @@ +diff --git a/SPECS/libvirt.spec b/SPECS/libvirt.spec +--- a/SPECS/libvirt.spec ++++ b/SPECS/libvirt.spec +@@ -26,7 +26,7 @@ + %endif + %define arches_vbox %{arches_x86} + %define arches_ceph %{arches_64bit} +-%define arches_zfs %{arches_x86} %{power64} %{arm} ++%define arches_zfs %{arches_x86} %{power64} %{arm} aarch64 + %define arches_numactl %{arches_x86} %{power64} aarch64 s390x + %define arches_numad %{arches_x86} %{power64} aarch64 + %define arches_ch x86_64 aarch64 +@@ -76,12 +76,7 @@ + %define with_storage_gluster 0 + %endif + +-# Fedora had zfs-fuse until F43 +-%if 0%{?fedora} && 0%{?fedora} < 43 +- %define with_storage_zfs 0%{!?_without_storage_zfs:1} +-%else +- %define with_storage_zfs 0 +-%endif ++%define with_storage_zfs 1 + + %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1} + # libiscsi has been dropped in RHEL-9 diff --git a/fedora-43/SPECS/libvirt.spec b/fedora-43/SPECS/libvirt.spec index ae2c5de..d7a4565 100644 --- a/fedora-43/SPECS/libvirt.spec +++ b/fedora-43/SPECS/libvirt.spec @@ -26,7 +26,7 @@ %endif %define arches_vbox %{arches_x86} %define arches_ceph %{arches_64bit} -%define arches_zfs %{arches_x86} %{power64} %{arm} +%define arches_zfs %{arches_x86} %{power64} %{arm} aarch64 %define arches_numactl %{arches_x86} %{power64} aarch64 s390x %define arches_numad %{arches_x86} %{power64} aarch64 %define arches_ch x86_64 aarch64 @@ -76,12 +76,7 @@ %define with_storage_gluster 0 %endif -# Fedora had zfs-fuse until F43 -%if 0%{?fedora} && 0%{?fedora} < 43 - %define with_storage_zfs 0%{!?_without_storage_zfs:1} -%else - %define with_storage_zfs 0 -%endif +%define with_storage_zfs 1 %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1} # libiscsi has been dropped in RHEL-9 diff --git a/update.sh b/update.sh index c594f3d..db0c824 100755 --- a/update.sh +++ b/update.sh @@ -4,6 +4,20 @@ set -Eeuo pipefail find . -name '*.src.rpm' -delete +function install_all_srpm () { + local dist=$1 + echo "Importing source RPMs of $dist..." + rpm -ivh "--define=_topdir $PWD/$dist" "$dist/SRPMS/"*.src.rpm +} + +function apply_patches () { + local dist=$1 + for patch in "$dist/PATCHES"/*.patch; do + echo "Applying patch $(basename "$patch")..." + patch -d "$dist"* -p1 < "$patch" + done +} + for v in 41 42 43; do dist="fedora-$v" mkdir -p "$dist/SRPMS" @@ -13,8 +27,8 @@ for v in 41 42 43; do if ! dnf download --repofrompath=zfs-$dist,http://download.zfsonlinux.org/fedora/$v/SRPMS/ --repo=zfs-$dist --source zfs zfs-dkms --destdir $dist/SRPMS/; then echo "ZFS source RPM not found for Fedora $v, skipping..." fi - echo "Importing source RPMs for Fedora $v..." - rpm -ivh "--define=_topdir $PWD/$dist" $dist/SRPMS/*.src.rpm + install_all_srpm "$dist" + apply_patches "$dist" done for v in 9 10; do @@ -26,6 +40,6 @@ for v in 9 10; do if ! dnf download --repofrompath=zfs-$dist,http://download.zfsonlinux.org/epel/$v/SRPMS/ --repo=zfs-$dist --source zfs zfs-dkms --destdir $dist/SRPMS/; then echo "ZFS source RPM not found for CentOS Stream $v, skipping..." fi - echo "Importing source RPMs for CentOS Stream $v..." - rpm -ivh "--define=_topdir $PWD/$dist" $dist/SRPMS/*.src.rpm + install_all_srpm "$dist" + apply_patches "$dist" done