Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
chore: don't patch for zfs 2.2.3 or newer (#12)
Browse files Browse the repository at this point in the history
Relates to: ublue-os/ucore#112
  • Loading branch information
bsherman authored Feb 3, 2024
1 parent 2a3f5dc commit e2b0f81
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ARG COREOS_VERSION="${COREOS_VERSION:-stable}"

FROM ${BASE_IMAGE}:${COREOS_VERSION} AS builder
ARG COREOS_VERSION="${COREOS_VERSION:-stable}"
ARG ZFS_MINOR_VERSION="${ZFS_MINOR_VERSION:-2.2}"

COPY build*.sh /tmp
COPY certs /tmp/certs
Expand All @@ -25,7 +26,7 @@ RUN /tmp/build-prep.sh
RUN /tmp/build-ucore-addons.sh
RUN /tmp/build-ucore-nvidia.sh
RUN /tmp/build-kmod-nvidia.sh
RUN ZFS_MINOR_VERSION=2.2 /tmp/build-kmod-zfs.sh
RUN /tmp/build-kmod-zfs.sh

RUN for RPM in $(find /var/cache/akmods/ -type f -name \*.rpm); do \
cp "${RPM}" /var/cache/rpms/kmods/; \
Expand Down
9 changes: 8 additions & 1 deletion build-kmod-zfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ echo "getting zfs-${ZFS_VERSION}.tar.gz"
curl -L -O https://github.com/openzfs/zfs/releases/download/zfs-${ZFS_VERSION}/zfs-${ZFS_VERSION}.tar.gz
tar xzf zfs-${ZFS_VERSION}.tar.gz

patch -b -uN -i zfs-kmod-spec-in.patch zfs-${ZFS_VERSION}/rpm/generic/zfs-kmod.spec.in
# patch the zfs-kmod.spec.in file for older zfs versions
ZFS_MIN=$(echo $ZFS_VERSION | cut -f2 -d.)
ZFS_PATCH=$(echo $ZFS_VERSION | cut -f3 -d.)
if [ "${ZFS_MIN}" -lt "3" ]; then
if [ "${ZFS_PATCH}" -lt "3" ]; then
patch -b -uN -i zfs-kmod-spec-in.patch zfs-${ZFS_VERSION}/rpm/generic/zfs-kmod.spec.in
fi
fi
cd /tmp/zfs-${ZFS_VERSION}
./configure \
-with-linux=/usr/src/kernels/${KERNEL}/ \
Expand Down

0 comments on commit e2b0f81

Please sign in to comment.