-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zfs-dkms rpm: simplify scriptlets, fix uninstall #13182
Conversation
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. Signed-off-by: Jeremy Visser <[email protected]> Fixes openzfs#10463.
I notice that the CentOS 8 tests are failing in the attached buildbot output. Though I may have missed something in the logs (they are quite verbose), the failures I saw seemed to be filesystem–level, with many successes mixed in, so I think the failures are unrelated to my change. At least CentOS 7 and Fedora 35 are succeeding, which suggests the package is working at least somewhat. |
Thanks for looking at this! I'm all for improving the packaging and making this more reliable. Unfortunately, the CI doesn't do its testing using the dkms packages, instead if builds kmod packages for testing. So in order to get this merged, it's going to need to be manually tested at least on the latest CentOS 7.x, Rocky|AlmaLinux 8.x, and Fedora 35 (which you've done). Just to make sure there are no surprises with those older dkms versions. In principle this looks nice to me as long as it works everywhere we need it to! As for the CentOS 8 failure that's definitely unrelated and can be ignored. We've got a handful of spurious failures still in the test suite. |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Is there any chance this can be merged into the 2.1 branch? I still encounter this problem on every 2.1.x release because the fix never reached that branch. |
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
@jeremyvisser thanks for the heads-up. I just put out a PR for the backport to the next release here: #14958 |
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 #10463 Closes #13182
A postinst script is no longer generated during package build with this change which results in the kernel module not being built during installation: #15328 |
@JKDingwall No, that's incorrect. The actual root cause is this: |
@jeremyvisser can you provide some references how the PR breaks things for zfs? Also don't be afraid to CC me - I don't bite :-P |
Motivation and Context
Two problems led to unexpected behaviour of the scriptlets:
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.
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.
Description
This change attempts to simplify life by:
%post happens before %preun, while %posttrans happens afterwards
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.
Signed-off-by: Jeremy Visser [email protected]
Fixes #10463.
How Has This Been Tested?
I ad-hoc tested this on my Fedora 35 system with the following scenarios:
I used
dnf upgrade
ordnf downgrade
for these tasks. I do not believe the ZFS Test Suite is applicable to RPM packaging, as it appears to test ZFS itself, whereas this change applies only to the surrounding package.Types of changes
Checklist:
Signed-off-by
.