-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [x] Add install-zfs-dkms-module example Containerfile and readme - [x] Add install-zfs-dkms-module example to main readme - [x] Add install-zfs-dkms-module github workflow file - [x] Test build install-zfs-dkms-module example
- Loading branch information
1 parent
7442c84
commit ef51469
Showing
4 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "Build image: install-zfs-dkms-module" | ||
|
||
env: | ||
IMAGE_NAME: "install-zfs-dkms-module" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- install-zfs-dkms-module/* | ||
- .github/workflows/install-zfs-dkms-module.yml | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- install-zfs-dkms-module/* | ||
- .github/workflows/install-zfs-dkms-module.yml | ||
|
||
jobs: | ||
build-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build container image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
context: ${{ env.IMAGE_NAME }} | ||
containerfiles: ${{ env.IMAGE_NAME }}/Containerfile | ||
image: ${{ env.IMAGE_NAME }} | ||
layers: false | ||
oci: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Install ZFS DKMS Kernel Module | ||
FROM quay.io/fedora/fedora-coreos:stable | ||
|
||
# Install ZFS repository | ||
RUN rpm-ostree install \ | ||
https://zfsonlinux.org/fedora/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm && \ | ||
ostree container commit | ||
|
||
# Install dkms dependencies | ||
RUN rpm-ostree install kernel-devel kernel-devel-matched kernel-headers kernel-srpm-macros && \ | ||
ostree container commit | ||
|
||
# TODO: Remove the following line once these bugs are fixed: | ||
# - https://github.com/coreos/rpm-ostree/issues/4201 | ||
# - https://github.com/coreos/rpm-ostree/issues/1614 | ||
RUN test -f /usr/bin/ld || ln -s /usr/bin/ld.bfd /usr/bin/ld | ||
|
||
# Install zfs package and tell dkms to install the kernel module now | ||
RUN rpm-ostree install zfs && \ | ||
dkms autoinstall -k $(rpm -qa kernel --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}') && \ | ||
rm -vrf /var && \ | ||
test -h /usr/bin/ld && rm -v /usr/bin/ld && \ | ||
ostree container commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Install ZFS DKMS Kernel Module | ||
|
||
This example installs the [ZFS](https://openzfs.org/) [DKMS](https://en.wikipedia.org/wiki/Dynamic_Kernel_Module_Support) kernel module. | ||
|
||
This is useful because typically DKMS modules are built during system startup after a kernel has been updated. This doesn't work in `ostree` based distributions because DKMS attempts to install kernel modules into `/usr`, which on `ostree` based distributions is mounted read-only. | ||
|
||
This example is not specific to ZFS and should be able to be applied to other DKMS modules. |