Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zfs-dkms rpm: simplify scriptlets, fix uninstall
Two problems led to unexpected behaviour of the scriptlets: 1) Newer DKMS versions change the formatting of "dkms status": (old) zfs, 2.1.2, 5.14.10-300.fc35.x86_64, x86_64: installed (new) zfs/2.1.2, 5.14.10-300.fc35.x86_64, x86_64: installed Which broke a conditional determining whether to uninstall. 2) zfs_config.h not packaged properly, but was attempted to be read in the %preun scriptlet: CONFIG_H="/var/lib/dkms/zfs/2.1.2/*/*/zfs_config.h" Which broke the uninstallation of the module, which left behind a dangling symlink, which broke DKMS entirely with this error: Error! Could not locate dkms.conf file. File: /var/lib/dkms/zfs/2.1.1/source/dkms.conf does not exist. This change attempts to simplify life by: * Avoiding parsing anything (less prone to future breakage) * Uses %posttrans instead of %post for module installation, because %post happens before %preun, while %posttrans happens afterwards * Unconditionally reinstall module on upgrade, which is less efficient but the trade-off is that it's more reliable Alternative approaches could involve fixing the existing parsing bugs or improving the logic, but this comes at the cost of complexity and possible future bugs. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Jeremy Visser <[email protected]> Closes openzfs#10463 Closes openzfs#13182
- Loading branch information