ZFS Build Script

The following shell script (zfs-build-latest.sh) will automatically download the latest OpenZFS release and compile it


  • Build tools (gcc, make etc)
  • autoconf
  • jq (cli json parser)
  • openssl-dev
  • kernel headers that match your installed kernel
  • curl
  • zstandard libs (if zstd support is required)
  • you will have to install other missing libs if required
sudo eopkg it -c system.devel
sudo eopkg it git linux-current-headers libelf-devel libtirpc-devel 
sudo eopkg it jq curl-devel openssl-11-devel

curl -s https://api.github.com/repos/openzfs/zfs/releases/latest > git-release.json
tag=$(jq -r ".tag_name" git-release.json)
jq '.assets[] | select(.content_type == "application/gzip")' git-release.json >latest-asset.json

url=$(jq -r '.browser_download_url' latest-asset.json)
file=$(jq -r '.name' latest-asset.json)

echo "Latest Release: ${tag} : ${file} -> ${url}"

if [ -f "previous-tag.txt" ]
  previousTag=$(cat previous-tag.txt)

if [ "${previousTag}" = "${tag}" ]
  echo "Already downloaded this version, compiling..."

if [ ! -f "${file}" ]
  echo "Downloading ${url}"
  curl -L "${url}" -O

rm -rf "${tag}"
tar zxf "${file}"
cd "${tag}"

# We try to determine the latest kernel headers here, sometimes this may not work as intended.

./configure --with-linux=/usr/src/$(ls -t /usr/src/ | grep linux-headers | head -n 1)
make -j$(nproc)

cd ..
echo "${tag}" >previous-tag.txt

echo "Now you can install with the following commands:"
echo "cd ${tag} && sudo make install && sudo depmod"

Configuration guide here: http://blog.twbc.net/2019/01/07/solus-linux-openzfs/

Solus Linux – Repo change

Swapping out the Solus repo from https to http so we can cache it in a local server.

$ eopkg lr
 Solus [active]
$ sudo eopkg ar solus http://mirrors.rit.edu/solus/packages/shannon/eopkg-index.xml.xz
Repo solus added to system.
 Updating repository: solus
 eopkg-index.xml.xz.sha1sum     (40.0  B)100%      2.96 MB/s [00:00:00] [complete]
 eopkg-index.xml.xz             (2.3 MB)100%    328.90 KB/s [00:00:01] [complete]
 Package database updated.
$ sudo eopkg rr Solus
Repo Solus removed from system.