I’m a Fedora Linux consumer who runs
yum improve day by day. While this behavior permits me to run all the newest software program (considered one of Fedora’s four foundations is “first,” and it lives as much as that), it additionally highlights any incompatibilities between the ZFS storage platform and a brand new kernel.
As a developer, typically I want new options from the newest ZFS department. For instance, ZFS 2.Zero.Zero accommodates an thrilling new function significantly improving ZVOL sync performance, which is crucial to me as a KVM consumer. But which means if I wish to use the two.Zero.Zero department, I’ve to construct ZFS myself.
At first, I simply compiled ZFS manually from its Git repo after each kernel replace. If I forgot, ZFS would fail to be acknowledged on the following boot. Luckily, I rapidly discovered how you can arrange dynamic kernel module assist (DKMS) for ZFS. However, this resolution is not excellent. For one factor, it would not make the most of the highly effective yum system, which may also help with resolving dependencies and upgrading. In addition, switching between your individual package deal and an upstream package deal is fairly straightforward with yum.
In this text, I’ll show how you can arrange a yum repo for packaging ZFS. The resolution has two steps:
- Create RPM packages from the ZFS Git repository
- Set up a yum repo to host the packages
Create RPM packages
To create RPM packages, it’s worthwhile to set up the RPM toolchain. Yum offers teams to bundle putting in the instruments:
sudo dnf group set up 'C Development Tools and Libraries' 'RPM Development Tools'
After these have been put in, you should set up all of the packages essential to construct ZFS from the ZFS Git repo. The packages belong to 3 teams:
- Autotools to generate construct recordsdata from platform configurations
- Libraries for constructing ZFS kernel and userland instruments
- Libraries for constructing RPM packages
sudo dnf set up libtool autoconf automake gettext createrepo
libuuid-devel libblkid-devel openssl-devel libtirpc-devel
lz4-devel libzstd-devel zlib-devel
libaio-devel libattr-devel libudev-devel
Now you might be able to create your individual packages.
OpenZFS offers wonderful infrastructure. To construct it:
- Clone the repository with
gitand swap to the department/tag that you simply hope to make use of.
- Run Autotools to generate a makefile.
make rpmand, if every little thing works, RPM recordsdata shall be positioned within the construct folder.
$ git clone --branch=zfs-2.Zero.Zero-rc3 https://github.com/openzfs/zfs.git zfs
$ cd zfs
$ make rpm
Set up a yum repo
In yum, a repo is a server or native path that features metadata and RPM recordsdata. A shopper units up an INI configuration file, and the
yum command routinely resolves the metadata and downloads the corresponding packages.
Fedora offers the
createrepo software to arrange a yum repo. First, create the repo and duplicate all RPM recordsdata from the ZFS folder to the repo. Then run
createrepo --update to incorporate all packages within the metadata:
$ sudo mkdir -p /var/lib/zfs.repo
$ sudo createrepo /var/lib/zfs.repo
$ sudo cp *.rpm /var/lib/zfs.repo/
$ sudo createrepo --update /var/lib/zfs.repo
Create a brand new configuration file in
/and so forth/yum.repos.d to incorporate the repo path:
"[zfs-local]ntitle=ZFS Localnbaseurl=file:///var/lib/zfs.reponenabled=1ngpgcheck=Zero" |
sudo tee /and so forth/yum.repos.d/zfs-local.repo
$ sudo dnf --repo=zfs-local listing out there --refresh
Finally, you might have reached the top of the journey! You have a working yum repo and ZFS packages. Now you simply want to put in them:
$ sudo dnf set up zfs
$ sudo /sbin/modprobe zfs
sudo zfs model to see the model of your userland and kernel instruments. Congratulations! You have ZFS for Fedora.