Compare commits
No commits in common. "b2c0378b6b368097e3cdbbf3517f74918cc3c77f" and "a216e14b275d65a1603a261496b2d1860463423e" have entirely different histories.
b2c0378b6b
...
a216e14b27
|
@ -21,7 +21,7 @@ env:
|
||||||
jobs:
|
jobs:
|
||||||
build_push_aurora:
|
build_push_aurora:
|
||||||
name: Build and publish SB image with ZFS
|
name: Build and publish SB image with ZFS
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
|
@ -40,29 +40,46 @@ ARG SOURCE_TAG="40"
|
||||||
|
|
||||||
ARG FEDORA_VERSION=40
|
ARG FEDORA_VERSION=40
|
||||||
|
|
||||||
## Cache images for CoreOS kernel & ZFS kmod RPMs
|
### 2. Build ZFS module
|
||||||
FROM ghcr.io/ublue-os/coreos-stable-kernel:${SOURCE_TAG} AS kernel-cache
|
## Adated from https://github.com/coreos/layering-examples/blob/main/build-zfs-module/Containerfile
|
||||||
FROM ghcr.io/ublue-os/akmods-zfs:coreos-stable-${SOURCE_TAG} AS zfs-cache
|
FROM ghcr.io/ublue-os/${SOURCE_IMAGE}${SOURCE_SUFFIX}:${SOURCE_TAG} as kernel-query
|
||||||
|
RUN rpm -qa kernel --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}' > /kernel-version.txt
|
||||||
|
|
||||||
|
# Using https://openzfs.github.io/openzfs-docs/Developer%20Resources/Custom%20Packages.html
|
||||||
|
FROM registry.fedoraproject.org/fedora:${FEDORA_VERSION} as builder
|
||||||
|
COPY --from=kernel-query /kernel-version.txt /kernel-version.txt
|
||||||
|
WORKDIR /etc/yum.repos.d
|
||||||
|
RUN curl -L -O https://src.fedoraproject.org/rpms/fedora-repos/raw/f${FEDORA_VERSION}/f/fedora-updates-archive.repo && \
|
||||||
|
sed -i 's/enabled=AUTO_VALUE/enabled=true/' fedora-updates-archive.repo
|
||||||
|
RUN dnf install -y jq dkms gcc make autoconf automake libtool rpm-build libtirpc-devel libblkid-devel \
|
||||||
|
libuuid-devel libudev-devel openssl-devel zlib-devel libaio-devel libattr-devel elfutils-libelf-devel \
|
||||||
|
kernel-$(cat /kernel-version.txt) kernel-modules-$(cat /kernel-version.txt) kernel-devel-$(cat /kernel-version.txt) \
|
||||||
|
python3 python3-devel python3-setuptools python3-cffi libffi-devel git ncompress libcurl-devel
|
||||||
|
WORKDIR /
|
||||||
|
# Uses project_id from: https://release-monitoring.org/project/11706/
|
||||||
|
RUN curl "https://release-monitoring.org/api/v2/versions/?project_id=11706" | jq --raw-output '.stable_versions[0]' >> /zfs_version.txt
|
||||||
|
RUN curl -L -O https://github.com/openzfs/zfs/releases/download/zfs-$(cat /zfs_version.txt)/zfs-$(cat /zfs_version.txt).tar.gz && \
|
||||||
|
tar xzf zfs-$(cat /zfs_version.txt).tar.gz && mv zfs-$(cat /zfs_version.txt) zfs
|
||||||
|
WORKDIR /zfs
|
||||||
|
RUN ./configure -with-linux=/usr/src/kernels/$(cat /kernel-version.txt)/ -with-linux-obj=/usr/src/kernels/$(cat /kernel-version.txt)/ \
|
||||||
|
&& make -j1 rpm-utils rpm-kmod
|
||||||
|
|
||||||
|
|
||||||
### 2. SOURCE IMAGE
|
### 3. SOURCE IMAGE
|
||||||
## this is a standard Containerfile FROM using the build ARGs above to select the right upstream image
|
## this is a standard Containerfile FROM using the build ARGs above to select the right upstream image
|
||||||
FROM ghcr.io/ublue-os/${SOURCE_IMAGE}${SOURCE_SUFFIX}:${SOURCE_TAG}
|
FROM ghcr.io/ublue-os/${SOURCE_IMAGE}${SOURCE_SUFFIX}:${SOURCE_TAG}
|
||||||
|
|
||||||
### 3. Add ZFS RPMS and matching kernel RPMs
|
### 4 Add ZFS RPMS and matching kernel RPMs
|
||||||
# COPY --from=kernel-cache /tmp/rpms/* /tmp/rpms/
|
#COPY --from=ghcr.io/0ranki/sb-zfs-kernel /rpms/ /tmp/rpms
|
||||||
# COPY --from=zfs-cache /rpms/kmods/zfs/*.rpm /tmp/rpms/
|
COPY --from=builder /zfs/*.rpm /zfs/
|
||||||
|
|
||||||
### 4. MODIFICATIONS
|
### 5. MODIFICATIONS
|
||||||
## make modifications desired in your image and install packages by modifying the build.sh script
|
## make modifications desired in your image and install packages by modifying the build.sh script
|
||||||
## the following RUN directive does all the things required to run "build.sh" as recommended.
|
## the following RUN directive does all the things required to run "build.sh" as recommended.
|
||||||
|
|
||||||
COPY build.sh /tmp/build.sh
|
COPY build.sh /tmp/build.sh
|
||||||
|
|
||||||
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
|
RUN mkdir -p /var/lib/alternatives && \
|
||||||
--mount=type=bind,from=kernel-cache,src=/tmp/rpms,dst=/tmp/rpms/kernel \
|
|
||||||
--mount=type=bind,from=zfs-cache,src=/rpms/kmods/zfs,dst=/tmp/rpms/zfs \
|
|
||||||
mkdir -p /var/lib/alternatives && \
|
|
||||||
/tmp/build.sh && \
|
/tmp/build.sh && \
|
||||||
ostree container commit
|
ostree container commit
|
||||||
## NOTES:
|
## NOTES:
|
||||||
|
|
16
README.md
16
README.md
|
@ -7,9 +7,15 @@ This is a customized Universal Blue image with the OpenZFS kernel module install
|
||||||
See [upstream Universal Blue](https://github.com/ublue-os/main/) repo for more detailed instructions how
|
See [upstream Universal Blue](https://github.com/ublue-os/main/) repo for more detailed instructions how
|
||||||
to rebase to this image.
|
to rebase to this image.
|
||||||
|
|
||||||
Image uses CoreOS' `stable` kernel from [Universal Blue kernel-cache image](https://ghcr.io/ublue-os/coreos-stable-kernel) and
|
The ZFS modules are built against the latest latest ublue-os:main image, Fedora 40 at the time of writing.
|
||||||
matching ZFS kmod RPMs from [Universal Blue `akmods-zfs` image](https://ghcr.io/ublue-os/akmods-zfs) are installed.
|
Building the modules is basically taken straight from [Fedora CoreOS](https://github.com/coreos/layering-examples/tree/main/build-zfs-module)
|
||||||
|
example, except the base image used to detect the correct kernel version to build against is `ublue-os:main`.
|
||||||
|
|
||||||
Other additions, subject to change:
|
## Known issues
|
||||||
- RPM firefox removed
|
The build fails consistently once a week. Most likely Fedora repos are already serving a newer kernel version,
|
||||||
- Sanoid installed from [gregw/extras COPR](https://copr.fedorainfracloud.org/coprs/gregw/extras)
|
while the pulled ublue image is still on the older kernel version. Next day's build succeeds, so this only means
|
||||||
|
a day without an updated image every week.
|
||||||
|
|
||||||
|
Dependencies for Jim Salter's excellent [Sanoid/Syncoid](https://github.com/jimsalterjrs/sanoid) might become
|
||||||
|
preinstalled at some stage, but for now I've decided to keep everything close to `ublue-os:main`. Suggestions,
|
||||||
|
issues and pull requests are welcome.
|
||||||
|
|
38
build.sh
38
build.sh
|
@ -4,16 +4,6 @@ set -ouex pipefail
|
||||||
|
|
||||||
RELEASE="$(rpm -E %fedora)"
|
RELEASE="$(rpm -E %fedora)"
|
||||||
|
|
||||||
## Package overrides
|
|
||||||
RMPKGS=(
|
|
||||||
firefox
|
|
||||||
firefox-langpacks
|
|
||||||
)
|
|
||||||
|
|
||||||
ADDPKGS=(
|
|
||||||
sanoid
|
|
||||||
)
|
|
||||||
|
|
||||||
### Install packages
|
### Install packages
|
||||||
|
|
||||||
# Packages can be installed from any enabled yum repo on the image.
|
# Packages can be installed from any enabled yum repo on the image.
|
||||||
|
@ -21,27 +11,13 @@ ADDPKGS=(
|
||||||
# List of rpmfusion packages can be found here:
|
# List of rpmfusion packages can be found here:
|
||||||
# https://mirrors.rpmfusion.org/mirrorlist?path=free/fedora/updates/39/x86_64/repoview/index.html&protocol=https&redirect=1
|
# https://mirrors.rpmfusion.org/mirrorlist?path=free/fedora/updates/39/x86_64/repoview/index.html&protocol=https&redirect=1
|
||||||
|
|
||||||
## Add gregw/extras COPR
|
rpm-ostree install \
|
||||||
curl -so /etc/yum.repos.d/gregw-extras-fedora-40.repo https://copr.fedorainfracloud.org/coprs/gregw/extras/repo/fedora-40/gregw-extras-fedora-40.repo
|
/zfs/*.$(rpm -qa kernel --queryformat '%{ARCH}').rpm && \
|
||||||
|
# Auto-load ZFS module
|
||||||
RMSTRING=""
|
depmod -a "$(rpm -qa kernel --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')" && \
|
||||||
ADDSTRING=""
|
echo "zfs" > /etc/modules-load.d/zfs.conf && \
|
||||||
|
# we don't want any files on /var
|
||||||
for pkg in ${ADDPKGS[@]}; do
|
rm -rf /var/lib/pcp
|
||||||
ADDSTRING="${ADDSTRING} --install=${pkg}"
|
|
||||||
done
|
|
||||||
|
|
||||||
for pkg in ${RMPKGS[@]}; do
|
|
||||||
RMSTRING="${RMSTRING} --remove=${pkg}"
|
|
||||||
done
|
|
||||||
|
|
||||||
rpm-ostree override replace ${ADDSTRING} ${RMSTRING} /tmp/rpms/kernel/*.rpm /tmp/rpms/zfs/*.rpm
|
|
||||||
|
|
||||||
# Auto-load ZFS module
|
|
||||||
depmod -a "$(rpm -qa kernel --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')" && \
|
|
||||||
echo "zfs" > /etc/modules-load.d/zfs.conf && \
|
|
||||||
# we don't want any files on /var
|
|
||||||
rm -rf /var/lib/pcp
|
|
||||||
|
|
||||||
#### Example for enabling a System Unit File
|
#### Example for enabling a System Unit File
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue