为什么会出现 dkms 状态“警告!构建模块和安装模块之间存在差异”?

为什么会出现 dkms 状态“警告!构建模块和安装模块之间存在差异”?
generic@motorbrot:~$ sudo dkms status
zfs, 0.8.4, 5.3.0-51-generic, x86_64: installed (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!)
zfs, 0.8.4, 5.3.0-53-generic, x86_64: installed (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!)

为什么会出现此消息?

我已尝试删除并重新安装zfs这两个内核之一。

generic@motorbrot:~$ sudo dkms remove -m zfs -v 0.8.4 -k 5.3.0-53-generic

-------- Uninstall Beginning --------
Module:  zfs
Version: 0.8.4
Kernel:  5.3.0-53-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

zavl.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.3.0-53-generic/
rmdir: failed to remove '': No such file or directory
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

# [skipping long output that all looks similar but for different something.ko]

spl.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.3.0-53-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod...

DKMS: uninstall completed.
generic@motorbrot:~$ sudo dkms install -m zfs -v 0.8.4 -k 5.3.0-53-generic

Kernel preparation unnecessary for this kernel.  Skipping...

Running the pre_build script:

# [Skipping "checking for blah... blah" outputs]

Building module:
cleaning build area...
make -j8 KERNELRELEASE=5.3.0-53-generic............

Running the post_build script:
Signing module:
 - /var/lib/dkms/zfs/0.8.4/5.3.0-53-generic/x86_64/module/spl.ko
 - /var/lib/dkms/zfs/0.8.4/5.3.0-53-generic/x86_64/module/icp.ko
 - /var/lib/dkms/zfs/0.8.4/5.3.0-53-generic/x86_64/module/zfs.ko
 - /var/lib/dkms/zfs/0.8.4/5.3.0-53-generic/x86_64/module/zcommon.ko
 - /var/lib/dkms/zfs/0.8.4/5.3.0-53-generic/x86_64/module/zlua.ko
 - /var/lib/dkms/zfs/0.8.4/5.3.0-53-generic/x86_64/module/znvpair.ko
 - /var/lib/dkms/zfs/0.8.4/5.3.0-53-generic/x86_64/module/zunicode.ko
 - /var/lib/dkms/zfs/0.8.4/5.3.0-53-generic/x86_64/module/zavl.ko
Secure Boot not enabled on this system.
cleaning build area...

DKMS: build completed.

zavl.ko:
Running module version sanity check.

Good news! Module version 0.8.4-1 for zavl.ko
exactly matches what is already found in kernel 5.3.0-53-generic.
DKMS will not replace this module.
You may override by specifying --force.

znvpair.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/5.3.0-53-generic/updates/dkms/

zunicode.ko:
Running module version sanity check.

Good news! Module version 0.8.4-1 for zunicode.ko
exactly matches what is already found in kernel 5.3.0-53-generic.
DKMS will not replace this module.
You may override by specifying --force.

zcommon.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/5.3.0-53-generic/updates/dkms/

zfs.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/5.3.0-53-generic/updates/dkms/

icp.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/5.3.0-53-generic/updates/dkms/

zlua.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/5.3.0-53-generic/updates/dkms/

spl.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/5.3.0-53-generic/updates/dkms/

depmod...

DKMS: install completed.

但输出dkms status保持不变。

为什么会发生这种情况?我应该担心吗?如果我应该担心,我该如何解决这个问题?

答案1

您可以在输出中看到答案。

Good news! Module version 0.8.4-1 for zavl.ko
exactly matches what is already found in kernel 5.3.0-53-generic.
DKMS will not replace this module.
You may override by specifying --force.

dkms发现模块版本(不是 dkms 包版本)与现在运行的内核中的版本相同,因此不会替换它。

但代码不同,并显示在dkms status输出中。

您可以通过增加源代码中的模块版本或使用--force建议的选项来修复此问题。

简短的回答是:发生这种情况是因为没有真正安装任何东西。

看起来您需要这个带有旧版 5.0 内核的 D​​KMS 包。现在 Ubuntu 18.04 正在使用 5.3 内核,该内核本身就带有该模块。因此您现在可以删除 dkms。

相关内容