Discussion:
Two problems
Tom
2012-03-12 15:57:46 UTC
Permalink
Hi,

I'm user of the latest stable version of dkms in Archlinux and I've
noticed two things:

First, I can't uninstall modules. The culprit is the have_one_kernel()
function. Inside that function, there are two tests where if at least
one of them are true, dkms dies with an error message. The problem goes
when those tests are false, which happens when everything for
uninstalling modules is correct.

Since the tests return a non-zero code when everything is correct, the
have_one_kernel function returns a non-zero code too and then dkms fails.

In summary, the uninstall argument comprises:
uninstall) check_root && have_one_kernel && uninstall_module;;

So if have_one_kernel doesn't return 0, it just exits after that and
bash doesn't run the uninstall_module function. The solution is the
have_one_kernel function must return 0 to continue.

Second, everytime I use dkms auto_installer it only installs one module
(sometimes two). I currently have three modules configured to be
installed automatically by dkms and dkms fails because of depmod. The
error message is:
FATAL: renameat(/lib/modules/3.2.9-1-ARCH, modules.dep.tmp,
/lib/modules/3.2.9-1-ARCH, modules.dep): No such file or directory

So debugging I've found dkms runs depmod in a parallel way. Avoiding
this paralellism, dkms autoinstalls all the modules correctly in one pass.

I'm not a linux expert, but I think you should review this part. The
argument used in depmod is -a which stands for "probe all modules", so I
think with just one depmod when all the modules are installed would
suffice, but maybe I'm wrong. But at least, I'm sure it's wrong to run
several depmods at the same time.

So that's it. I've added a patch with my two fixes. Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dkms_two_fixes.patch
Type: text/x-patch
Size: 642 bytes
Desc: not available
Url : http://lists.us.dell.com/pipermail/dkms-devel/attachments/20120312/d908cb2b/attachment.bin
Sunil_Gupta2
2012-03-13 06:14:44 UTC
Permalink
Tom,

Can u please apply this patch and let us know the result? This patch is to correct the condition in have_one_kernel().

---
dkms | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/dkms b/dkms
index abb01a4..265b69a 100644
--- a/dkms
+++ b/dkms
@@ -162,11 +162,14 @@ set_kernel_source_dir()

# A little test function for DKMS commands that only work on one kernel.
have_one_kernel() {
- (( ${#kernelver[@]} > 1 )) && \
- die 4 $"The action $1 does not support multiple kernel version" \
- $"parameters on the command line."
- [[ $all ]] && die 5 $"The action $1 does not support the --all" \
- $"parameter."
+ if (( ${#kernelver[@]} != 1 )); then
+ die 4 $"The action $1 does not support multiple kernel version" \
+ $"parameters on the command line."
+ fi
+ if [[ $all ]]; then
+ die 5 $"The action $1 does not support the --all" \
+ $"parameter."
+ fi
}

Thanks,
Sunil

-----Original Message-----
From: dkms-devel-bounces-Lists On Behalf Of Tom
Sent: Monday, March 12, 2012 9:28 PM
To: dkms-devel-Lists
Subject: Two problems

Hi,

I'm user of the latest stable version of dkms in Archlinux and I've noticed two things:

First, I can't uninstall modules. The culprit is the have_one_kernel() function. Inside that function, there are two tests where if at least one of them are true, dkms dies with an error message. The problem goes when those tests are false, which happens when everything for uninstalling modules is correct.

Since the tests return a non-zero code when everything is correct, the have_one_kernel function returns a non-zero code too and then dkms fails.

In summary, the uninstall argument comprises:
uninstall) check_root && have_one_kernel && uninstall_module;;

So if have_one_kernel doesn't return 0, it just exits after that and bash doesn't run the uninstall_module function. The solution is the have_one_kernel function must return 0 to continue.

Second, everytime I use dkms auto_installer it only installs one module (sometimes two). I currently have three modules configured to be installed automatically by dkms and dkms fails because of depmod. The error message is:
FATAL: renameat(/lib/modules/3.2.9-1-ARCH, modules.dep.tmp, /lib/modules/3.2.9-1-ARCH, modules.dep): No such file or directory

So debugging I've found dkms runs depmod in a parallel way. Avoiding this paralellism, dkms autoinstalls all the modules correctly in one pass.

I'm not a linux expert, but I think you should review this part. The argument used in depmod is -a which stands for "probe all modules", so I think with just one depmod when all the modules are installed would suffice, but maybe I'm wrong. But at least, I'm sure it's wrong to run several depmods at the same time.

So that's it. I've added a patch with my two fixes. Thanks.
Tom
2012-03-13 09:37:14 UTC
Permalink
Post by Sunil_Gupta2
Tom,
Can u please apply this patch and let us know the result? This patch is to correct the condition in have_one_kernel().
---
dkms | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dkms b/dkms
index abb01a4..265b69a 100644
--- a/dkms
+++ b/dkms
@@ -162,11 +162,14 @@ set_kernel_source_dir()
# A little test function for DKMS commands that only work on one kernel.
have_one_kernel() {
- die 4 $"The action $1 does not support multiple kernel version" \
- $"parameters on the command line."
- [[ $all ]] && die 5 $"The action $1 does not support the --all" \
- $"parameter."
+ die 4 $"The action $1 does not support multiple kernel version" \
+ $"parameters on the command line."
+ fi
+ if [[ $all ]]; then
+ die 5 $"The action $1 does not support the --all" \
+ $"parameter."
+ fi
}
Thanks,
Sunil
Done. That way works too.
Post by Sunil_Gupta2
-----Original Message-----
From: dkms-devel-bounces-Lists On Behalf Of Tom
Sent: Monday, March 12, 2012 9:28 PM
To: dkms-devel-Lists
Subject: Two problems
Hi,
First, I can't uninstall modules. The culprit is the have_one_kernel() function. Inside that function, there are two tests where if at least one of them are true, dkms dies with an error message. The problem goes when those tests are false, which happens when everything for uninstalling modules is correct.
Since the tests return a non-zero code when everything is correct, the have_one_kernel function returns a non-zero code too and then dkms fails.
uninstall) check_root && have_one_kernel && uninstall_module;;
So if have_one_kernel doesn't return 0, it just exits after that and bash doesn't run the uninstall_module function. The solution is the have_one_kernel function must return 0 to continue.
FATAL: renameat(/lib/modules/3.2.9-1-ARCH, modules.dep.tmp, /lib/modules/3.2.9-1-ARCH, modules.dep): No such file or directory
So debugging I've found dkms runs depmod in a parallel way. Avoiding this paralellism, dkms autoinstalls all the modules correctly in one pass.
I'm not a linux expert, but I think you should review this part. The argument used in depmod is -a which stands for "probe all modules", so I think with just one depmod when all the modules are installed would suffice, but maybe I'm wrong. But at least, I'm sure it's wrong to run several depmods at the same time.
So that's it. I've added a patch with my two fixes. Thanks.
Julien Floret
2013-11-07 13:30:07 UTC
Permalink
Post by Sunil_Gupta2
Post by Tom
Second, everytime I use dkms auto_installer it only installs one module
(sometimes two). I currently
Post by Sunil_Gupta2
have three modules configured to be installed automatically by dkms and
dkms fails because of depmod. The
Post by Sunil_Gupta2
Post by Tom
FATAL: renameat(/lib/modules/3.2.9-1-ARCH, modules.dep.tmp,
/lib/modules/3.2.9-1-ARCH,
Post by Sunil_Gupta2
modules.dep): No such file or directory
Post by Tom
So debugging I've found dkms runs depmod in a parallel way. Avoiding
this paralellism, dkms autoinstalls
Post by Sunil_Gupta2
all the modules correctly in one pass.
Post by Tom
I'm not a linux expert, but I think you should review this part. The
argument used in depmod is -a which
Post by Sunil_Gupta2
stands for "probe all modules", so I think with just one depmod when all
the modules are installed would
Post by Sunil_Gupta2
suffice, but maybe I'm wrong. But at least, I'm sure it's wrong to run
several depmods at the same time.

Hello,

I use the latest stable dkms version 2.2.0.3, and I'm having the same
problem of several depmod being made in parallel during "dkms autoinstall".
The problem seems to be still there in the dkms master branch.

The second part of the patch proposed by Tom fixes the problem for me :

@@ -3159,7 +3160,7 @@
# Install modules that need to be updated in parallel.
for mv in "${to_install[@]}"; do
IFS=/ read m v <<< "$mv"
- (module="$m"; module_version="$v"; install_module) &
+ (module="$m"; module_version="$v"; install_module)
done
wait
}

Is it planned to apply this in a future version of dkms ?

Thanks,
--
Julien Floret
6WIND

Continue reading on narkive:
Loading...