Skip to content
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

[0.8.5 too] was 0.8.4 dkms won't compile unless I remove 0.8.3 folder from /var/lib/dkms/zfs/ #10463

Closed
Germano0 opened this issue Jun 15, 2020 · 9 comments · Fixed by #13182
Closed
Labels
Component: Packaging custom packages

Comments

@Germano0
Copy link

System information

Type Version/Name
Distribution Name CentOS
Distribution Version 8.2
Linux Kernel 4.18.0-193.6.3.el8_2.x86_64
Architecture x86_64
ZFS Version 0.8.4-1
SPL Version 0.8.4-1

Describe the problem you're observing

I updated to CentOS 8.2 and ZFS 0.8.4, so after the reboot I had to reload ZFS module (due #10462) so I ran

# modprobe zfs
modprobe: FATAL: Module zfs not found in directory /lib/modules/4.18.0-193.6.3.el8_2.x86_64

to fix this error I tried

[root@machine user]# dkms autoinstall
Error! Could not locate dkms.conf file.
File: /var/lib/dkms/zfs/0.8.3/source/dkms.conf does not exist.

Since it is a kind of error I have seen on other packages like Wireguard, I knew that if after an package update, dkms autoinstall failed, I have to remove the older folder in /var/lib/dkms, so I did it:

[root@machine user]# ls /var/lib/dkms/zfs/
0.8.3  0.8.4  kernel-4.18.0-147.5.1.el8_1.x86_64-x86_64  kernel-4.18.0-147.8.1.el8_1.x86_64-x86_64
[root@machine user]# rm -rf /var/lib/dkms/zfs/0.8.3/
[root@machine user]# dkms autoinstall

and then the machine started to compile the new module

@Hermanio
Copy link

Ran into the exact same issue, removing /var/lib/dkms/zfs/0.8.3/ did the trick.

@AllKind
Copy link
Contributor

AllKind commented Jun 17, 2020

I remember having that problem with other dkms modules.
I needed to do the steps manually.
first: dkms build ..., then: dkms install ...
might be a dkms problem?

@Germano0 Germano0 changed the title 0.8.4 dkms won't compile unless I remove 0.8.3 folder from /var/lib/dkms/zfs/ [0.8.5 too] was 0.8.4 dkms won't compile unless I remove 0.8.3 folder from /var/lib/dkms/zfs/ Oct 20, 2020
@Germano0
Copy link
Author

it's happening also with 0.8.5 not compiling unless I remove 0.8.4 folder

# dkms autoinstall
Error! Could not locate dkms.conf file.
File: /var/lib/dkms/zfs/0.8.4/source/dkms.conf does not exist.
# rm -rf /var/lib/dkms/zfs/0.8.4
# dkms autoinstall
everything compiled successfully

@jeremyvisser
Copy link
Contributor

This still happens without fail every single ZFS and kernel upgrade on Fedora 33.

Yesterday I did a regular upgrade, which broke ZFS:

  • From:
    • kernel-core-5.10.19-200.fc33.x86_64
    • zfs-dkms-2.0.3-1.fc33.x86_64
  • To:
    • kernel-core-5.10.21-200.fc33.x86_64
    • zfs-dkms-2.0.4-1.fc33.x86_64

On the following boot, dkms.service output the following logs:

Error! Could not locate dkms.conf file.
File: /var/lib/dkms/zfs/2.0.3/source/dkms.conf does not exist.

Looking at /var/lib/dkms/zfs there's a whole lot of stale broken symlinks left behind, as well as the old source dir for 2.0.3:

% ls -l /var/lib/dkms/zfs
total 112
drwxr-xr-x. 1 root root 150 Mar  3 08:53 2.0.3
drwxr-xr-x. 1 root root  58 Mar 14 00:13 2.0.4
lrwxrwxrwx. 1 root root  36 Feb 19 18:07 kernel-5.10.10-200.fc33.x86_64-x86_64 -> 2.0.3/5.10.10-200.fc33.x86_64/x86_64
lrwxrwxrwx. 1 root root  36 Feb 19 20:41 kernel-5.10.15-200.fc33.x86_64-x86_64 -> 2.0.3/5.10.15-200.fc33.x86_64/x86_64
lrwxrwxrwx. 1 root root  36 Mar 14 00:13 kernel-5.10.19-200.fc33.x86_64-x86_64 -> 2.0.4/5.10.19-200.fc33.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Jan 23 07:56 kernel-5.10.8-200.fc33.x86_64-x86_64 -> 2.0.1/5.10.8-200.fc33.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Jan 26 10:04 kernel-5.10.9-201.fc33.x86_64-x86_64 -> 2.0.1/5.10.9-201.fc33.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Sep 19  2019 kernel-5.2.14-200.fc30.x86_64-x86_64 -> 0.8.1/5.2.14-200.fc30.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Sep 20  2019 kernel-5.2.15-200.fc30.x86_64-x86_64 -> 0.8.1/5.2.15-200.fc30.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Oct  3  2019 kernel-5.2.16-200.fc30.x86_64-x86_64 -> 0.8.2/5.2.16-200.fc30.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Oct  3  2019 kernel-5.2.17-200.fc30.x86_64-x86_64 -> 0.8.2/5.2.17-200.fc30.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Oct  9  2019 kernel-5.2.18-200.fc30.x86_64-x86_64 -> 0.8.2/5.2.18-200.fc30.x86_64/x86_64
lrwxrwxrwx. 1 root root  34 Aug 18  2019 kernel-5.2.8-200.fc30.x86_64-x86_64 -> 0.8.1/5.2.8-200.fc30.x86_64/x86_64
lrwxrwxrwx. 1 root root  34 Sep  4  2019 kernel-5.2.9-200.fc30.x86_64-x86_64 -> 0.8.1/5.2.9-200.fc30.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Dec  4  2019 kernel-5.3.13-300.fc31.x86_64-x86_64 -> 0.8.2/5.3.13-300.fc31.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Dec 12  2019 kernel-5.3.14-300.fc31.x86_64-x86_64 -> 0.8.2/5.3.14-300.fc31.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Dec 13  2019 kernel-5.3.15-300.fc31.x86_64-x86_64 -> 0.8.2/5.3.15-300.fc31.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Dec 22  2019 kernel-5.3.16-300.fc31.x86_64-x86_64 -> 0.8.2/5.3.16-300.fc31.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Jan 25  2020 kernel-5.4.10-200.fc31.x86_64-x86_64 -> 0.8.3/5.4.10-200.fc31.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Feb  2  2020 kernel-5.4.14-200.fc31.x86_64-x86_64 -> 0.8.3/5.4.14-200.fc31.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Feb  2  2020 kernel-5.4.15-200.fc31.x86_64-x86_64 -> 0.8.3/5.4.15-200.fc31.x86_64/x86_64
lrwxrwxrwx. 1 root root  34 Jan 10  2020 kernel-5.4.7-200.fc31.x86_64-x86_64 -> 0.8.2/5.4.7-200.fc31.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 May 13  2020 kernel-5.5.18-200.fc31.x86_64-x86_64 -> 0.8.4/5.5.18-200.fc31.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Sep 24 09:24 kernel-5.8.10-200.fc32.x86_64-x86_64 -> 0.8.4/5.8.10-200.fc32.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Sep 28 16:53 kernel-5.8.11-200.fc32.x86_64-x86_64 -> 0.8.4/5.8.11-200.fc32.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Oct  8 00:04 kernel-5.8.12-200.fc32.x86_64-x86_64 -> 0.8.5/5.8.12-200.fc32.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Nov  5 00:17 kernel-5.8.17-300.fc33.x86_64-x86_64 -> 0.8.5/5.8.17-300.fc33.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Nov  8 11:04 kernel-5.8.18-300.fc33.x86_64-x86_64 -> 0.8.5/5.8.18-300.fc33.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Dec 16 09:43 kernel-5.9.13-200.fc33.x86_64-x86_64 -> 2.0.0/5.9.13-200.fc33.x86_64/x86_64
lrwxrwxrwx. 1 root root  35 Dec 25 00:40 kernel-5.9.15-200.fc33.x86_64-x86_64 -> 2.0.0/5.9.15-200.fc33.x86_64/x86_64

The problem is the existence of the 2.0.3 directory (/var/lib/dkms/zfs/2.0.3), which was evidently not correctly cleaned up.

I can manually work around the problem by running:

$ rm -r /var/lib/dkms/zfs/2.0.3

But obviously it's not a reasonable expectation for users to be doing this.

@SpComb
Copy link

SpComb commented Aug 18, 2021

See #9891 -> 4d6043f

Is this fixed in zfs 2.0.x packages? The fix is at package uninstall time, so it only takes effect for upgrades from 2.0.x.

@jeremyvisser
Copy link
Contributor

This happened to me again last night on Fedora 35.

The sequence of events that led up to it were:

  • Starting state (as at 2021-12-03):
    • zfs-dkms-2.1.1-1.fc35
    • kernel-core-5.15.6-200.fc35
  • ZFS upgrade (on 2021-12-16, which worked fine):
    • Upgrade: zfs-dkms 2.1.1-1.fc35 → 2.1.2-1.fc35
  • Kernel upgrade (on 2021-12-23, this is where things broke):
    • Install: kernel-core-5.15.10-200.fc35
    • dkms.service fails with:
      Error! Could not locate dkms.conf file.
      File: /var/lib/dkms/zfs/2.1.1/source/dkms.conf does not exist.
      
    • Noticed that /var/lib/dkms/zfs/2.1.1 still exists (probably left behind by prior upgrade)

Even though the problem only triggered on the kernel upgrade, I think the root cause happened during the zfs-dkms upgrade, where it failed to clean up the old /var/lib/dkms/zfs/$old_version directory.

The issue is still reliably reproducible, so it definitely has not been fixed.

@denizzzka
Copy link

Still happens with /var/lib/dkms/zfs/2.0.1/ during moving to a new kernel and zfs 2.1.2

@jeremyvisser
Copy link
Contributor

jeremyvisser commented Mar 1, 2022

Having a bit of a poke around, it seems the zfs-dkms RPM is all kinds of broken:

  • Determining the version doesn’t make any sense:

    NEWEST_VER=$(dkms status zfs | tr -d , | sort -r -V | awk '/installed/{print $2; exit}')
    if [ "$NEWEST_VER" != "%{version}" ] ; then

    If you look at the output, you’ll see:

    % sudo dkms status zfs 2>&-
    zfs/2.1.2, 5.14.10-300.fc35.x86_64, x86_64: installed
    % sudo dkms status zfs 2>&- | sed 's/,//g' | sort -r -V | awk '/installed/{print $2; exit}'
    5.14.10-300.fc35.x86_64
    

    This means that the above line 90 will be:

    if [ "5.14.10-300.fc35.x86_64" != "2.1.2" ] ; then
    

    Which makes no sense. This may have been broken by dell/dkms@f83b758.

  • This zfs_config.h does not exist:

    CONFIG_H="/var/lib/dkms/%{module}/%{version}/*/*/%{module}_config.h"
    SPEC_META_ALIAS="@PACKAGE@-@VERSION@-@RELEASE@"
    DKMS_META_ALIAS=`cat $CONFIG_H 2>/dev/null |
    awk -F'"' '/META_ALIAS\s+"/ { print $2; exit 0 }'`

    Or as shipped in zfs-dkms-2.1.2:

    CONFIG_H="/var/lib/dkms/zfs/2.1.2/*/*/zfs_config.h"
    SPEC_META_ALIAS="zfs-2.1.2-1"
    DKMS_META_ALIAS=`cat $CONFIG_H 2>/dev/null |
        awk -F'"' '/META_ALIAS\s+"/ { print $2; exit 0 }'`
    

    This file does not exist, but a similar one does exist although it doesn’t contain what you’re looking for:

    % ls /var/lib/dkms/zfs/2.1.2/*/*/zfs_config.h
    no matches found: /var/lib/dkms/zfs/2.1.2/*/*/zfs_config.h
    % find -L /var/lib/dkms/zfs -name '*zfs_config.h*'
    /var/lib/dkms/zfs/2.1.2/source/zfs_config.h.in
    % rpm -ql zfs-dkms | grep 'zfs_config.h'          
    /usr/src/zfs-2.1.2/zfs_config.h.in
    

    Just to be explicit, $DKMS_META_ALIAS is empty:

    % DKMS_META_ALIAS=`cat $CONFIG_H 2>/dev/null |
        awk -F'"' '/META_ALIAS\s+"/ { print $2; exit 0 }'`
    % echo $DKMS_META_ALIAS 
    

    I don’t know why zfs_config.h isn’t being created properly.

  • As a result, this will never work:

    if [ "$SPEC_META_ALIAS" = "$DKMS_META_ALIAS" ]; then
    echo -e
    echo -e "Uninstall of %{module} module ($SPEC_META_ALIAS) beginning:"
    dkms remove -m %{module} -v %{version} --all %{!?not_rpm:--rpm_safe_upgrade}
    fi

    Which would effectively be doing:

    SPEC_META_ALIAS="zfs-2.1.2-1"
    DKMS_META_ALIAS=""  # effectively empty string as per above
    if [ "zfs-2.1.2-1" = "" ]; then
        dkms remove -m zfs -v 2.1.2 --all --rpm_safe_upgrade    # will never execute
    fi
    

    This at least proves that it’s impossible for it to work correctly, and backs up the above claims that things are not being cleaned up properly.

So yeah, very broken.

@jeremyvisser
Copy link
Contributor

After looking into the history of this issue, which has surfaced multiple times (#8160, dell/dkms#25, #6902, etc.), I am convinced the complexity of the existing scripts are not justified with the simplicity of the problem. I think a more reliable solution is actually quite minimal:

%preun
dkms remove -m %{module} -v %{version} --all

%posttrans
/usr/lib/dkms/common.postinst %{module} %{version}

Notes:

@behlendorf behlendorf added the Component: Packaging custom packages label Mar 2, 2022
jeremyvisser added a commit to jeremyvisser/zfs that referenced this issue Mar 8, 2022
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.

Fixes openzfs#10463.
jeremyvisser added a commit to jeremyvisser/zfs that referenced this issue Mar 8, 2022
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.

Fixes openzfs#10463.
jeremyvisser added a commit to jeremyvisser/zfs that referenced this issue Mar 8, 2022
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 <jeremyvisser@google.com>
Fixes openzfs#10463.
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Mar 24, 2022
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 <jeremyvisser@google.com>
Fixes openzfs#10463.
behlendorf pushed a commit that referenced this issue Mar 28, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes #10463
Closes #13182
mcmilk pushed a commit to mcmilk/zfs that referenced this issue Mar 30, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
nicman23 pushed a commit to nicman23/zfs that referenced this issue Aug 22, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
nicman23 pushed a commit to nicman23/zfs that referenced this issue Aug 22, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
lundman pushed a commit to openzfsonwindows/openzfs that referenced this issue Sep 2, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
beren12 pushed a commit to beren12/zfs that referenced this issue Sep 19, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Jun 8, 2023
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes openzfs#10463
Closes openzfs#13182
behlendorf pushed a commit that referenced this issue Jun 9, 2023
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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes #10463
Closes #13182
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Packaging custom packages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants