When a newer kernel has been released but the zfs packages have not yet been released at the same version, fetch the correct kernel matching the zfs package from the Arch Linux archive.
This should fix failures that occur when the ZFS packages are not yet caught up to the kernel.
Explanation
In order to get the matching kernel, request info on the zfs package used:
pacman -S --info zfs-linux|grep "Depends On"
Depends On : kmod spl-linux zfs-utils=0.7.12 linux=4.20.13.arch1-1
Summary
When a newer kernel has been released but the zfs packages have not yet been released at the same version, fetch the correct kernel matching the zfs package from the Arch Linux archive.
This should fix failures that occur when the ZFS packages are not yet caught up to the kernel.
Explanation
In order to get the matching kernel, request info on the zfs package used:
Get the linux version from
linux=
with:We then compare the actual
linux
version, and if it is not the same as the one we found above we download from the archive.In practice we use a few functions for readability:
And then get the version using:
Tests Ran