Bug 787801 - dkms-2.2 breaks dkms-openafs on RHEL 5.7
Summary: dkms-2.2 breaks dkms-openafs on RHEL 5.7
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: dkms
Version: el5
Hardware: i686
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Simone Caronni
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 965712
TreeView+ depends on / blocked
 
Reported: 2012-02-06 18:48 UTC by John Sopko
Modified: 2016-05-27 06:13 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-05-27 06:13:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
OpenAFS dkms.conf file (693 bytes, text/plain)
2012-02-07 13:37 UTC, John Sopko
no flags Details
OpenAFS make.log output (15.43 KB, text/plain)
2012-02-07 13:38 UTC, John Sopko
no flags Details

Description John Sopko 2012-02-06 18:48:28 UTC
Description of problem:
Upgraded from dkms-2.1 to dkms-2.2 and this broke our dkms-openafs
module which had been working fine for years. This on our
Red Hat Enterpise 5.7 systems.


Version-Release number of selected component (if applicable):

dkms-2.2.0.3-1.el5


How reproducible:

Always


Steps to Reproduce:
1. Upgraded dkms 2.2 from 2.1
2. 
3.
  
Actual results:

# /etc/init.d/dkms_autoinstaller start
dkms: running auto installation service for kernel 2.6.18-274.17.1.el5
grep: /boot/config-: No such file or directory
grep: /boot/config-: No such file or directory

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....(bad exit status: 2)
SMP=SP; eval ; [ -n  ] && SMP=MP; KMODNAME=openafs.ko; DSTKMOD=.; [  = 2.4 ] && KMODNAME=libafs-* && DSTKMOD=openafs.o; ./configure --with-linux-kernel-headers=/lib/modules/2.6.18-274.17.1.el5/build; make MPS=; mv src/libafs/MODLOAD-*/ .........................(bad exit status: 1)
Error! Bad return status for module build on kernel: 2.6.18-274.17.1.el5 (i686)
Consult /var/lib/dkms/openafs/el5.1.1/build/make.log for more information.
 Done. 



Expected results:

Would like it to not break dkms-openafs module.


Additional info:

Note the "grep: /boot/config-: No such file or directory" error.
The /usr/sbin/dkms script is pretty complicated. I could not find where the grep error was occuring. 

If I downgrade to dkms 2.1 things work fine.

Here is the error message at the end of /var/lib/dkms/openafs/el5.1.1/build/

make[1]: Leaving directory `/var/lib/dkms/openafs/el5.1.1/build/src/libafs'
mv: missing destination file operand after `src/libafs/MODLOAD-*/'
Try `mv --help' for more information.

Comment 1 John Sopko 2012-02-06 19:09:31 UTC
If I upgrade an existing rhel5.7 system that has dkms-openafs moudles already working and try a dkms status I get a similar grep error:

# rpm -q dkms
dkms-2.2.0.3-1.el5

# dkms status
grep: /boot/config-: No such file or directory
openafs, el5.1.1, 2.6.18-274.17.1.el5, i686: installedgrep: /boot/config-: No such file or directory

openafs, el5.1.1, 2.6.18-274.el5, i686: installed-weak from 2.6.18-274.17.1.el5

Comment 2 sunil 2012-02-07 07:24:45 UTC
Please provide the following

1) /var/lib/dkms/openafs/el5.1.1/build/make.log 

2)dkms.conf 

3)if possible openafs module which is being used to build the driver.

Comment 3 John Sopko 2012-02-07 13:36:14 UTC
I will attached the /var/lib/dkms/openafs/el5.1.1/build/make.log and the
/usr/src/openafs-el5.1.1/dkms.conf.

The dkms rpms we use are the last in the 1.4.x series, the latest openafs series is 1.6.x and it has the same problem. You can get the dkms-openafs rpm we use at:

http://dl.openafs.org/dl/openafs/1.4.14/rhel-5/i386/dkms-openafs-1.4.14-el5.1.1.i386.rpm

The kernel source is:
http://dl.openafs.org/dl/openafs/1.4.14/rhel-5/i386/openafs-kernel-source-1.4.14-el5.1.1.i386.rpm

We also use dkms on our Red Hat 6.2 systems, I see the epel dkms version is at 2.1  and it is working. Note we are a big Dell/Redhat shop and have lots of systems running OpenAFS. Thanks for your help.

Comment 4 John Sopko 2012-02-07 13:37:30 UTC
Created attachment 559952 [details]
OpenAFS dkms.conf file

Comment 5 John Sopko 2012-02-07 13:38:23 UTC
Created attachment 559953 [details]
OpenAFS make.log output

Comment 6 sunil 2012-02-08 10:19:22 UTC
From the dkms.conf the 

1)variable ${kernelver_array[0]} returns nothing hence grep fails.

The make.log suggests that

1)The mv src/libafs/MODLOAD-*/\$KMODNAME \$DSTKMOD" can not complete because there is no directory or file MODLOAD-*

---------------------------

[root@localhost src]# ls
afs  config  des  dir  fsint  JAVA  libafs  rx  rxkad  rxstat  util  vlserver
[root@localhost src]# pwd
/var/lib/dkms/openafs/el5.1.1/build/src
[root@localhost src]# find . -iname MODLOAD*
[root@localhost build]#

---------------------------

MAKE[0]="SMP=SP; eval \`grep CONFIG_SMP /boot/config-${kernelver_array[0]}\`; [ -n \"\$CONFIG_SMP\" ] && SMP=MP; KMODNAME=openafs.ko; DSTKMOD=\".\"; [ \"\`echo \"${kernelver_array[0]}\" | sed -e 's/^\([0-9]*\.[0-9]*\)\..*/\1/'\`\" = \"2.4\" ] && KMODNAME=\"libafs-*\" && DSTKMOD=openafs.o; ./configure --with-linux-kernel-headers=${kernel_source_dir}; make MPS=\$SMP; mv src/libafs/MODLOAD-*/\$KMODNAME \$DSTKMOD"

could you please check if there is a change in the directory structure of the built module?

Comment 7 sunil 2012-02-08 10:51:06 UTC
Error message from make.log.




                make -f Makefile.afs SMP_DEF="${SMP_DEF}" linux_compdirs_${TARG} CLIENT=2.6.18-274.el5PAE KDIR=${KDIR} || exit $?; \
                cd ../ ; \
        done
make[1]: Leaving directory `/var/lib/dkms/openafs/el5.1.1/build/src/libafs'
mv: missing destination file operand after `src/libafs/MODLOAD-*/'
Try `mv --help' for more information.

Comment 8 John Sopko 2012-02-08 14:50:46 UTC
During the build process the module MODLOAD* file is created and then
removed when "cleaning build area...." at the end of the make as shown 
below. I saw this during the build using the working dkms 2.1 version:

# pwd
/var/lib/dkms/openafs/el5.1.1/build/src
# find . -name \*MOD\* -print
./libafs/MODLOAD-2.6.18-274.17.1.el5-MP

Here is the build output for comparison, dkms 2.2 is not setting the 
variables like 2.1. Thanks for your help.

dkms 2.2 build output:
---------------------

# /usr/sbin/dkms build -m openafs -v el5.1.1 -k 2.6.18-274.17.1.el5
grep: /boot/config-: No such file or directory

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....(bad exit status: 2)
SMP=SP; eval ; [ -n  ] && SMP=MP; KMODNAME=openafs.ko; DSTKMOD=.; [  = 2.4 ] && KMODNAME=libafs-* && DSTKMOD=openafs.o; ./configure --with-linux-kernel-headers=/lib/modules/2.6.18-274.17.1.el5/build; make MPS=; mv src/libafs/MODLOAD-*/ ..........................(bad exit status: 1)
Error! Bad return status for module build on kernel: 2.6.18-274.17.1.el5 (i686)
Consult /var/lib/dkms/openafs/el5.1.1/build/make.log for more information.

# pwd
/var/lib/dkms/openafs/el5.1.1
# ls -l
total 4
drwxr-xr-x 4 root root 4096 Feb  8 09:18 build
lrwxrwxrwx 1 root root   24 Feb  8 09:13 source -> /usr/src/openafs-el5.1.1


dkms 2.1 build output;
---------------------

# /usr/sbin/dkms build -m openafs -v el5.1.1 -k 2.6.18-274.17.1.el5

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....(bad exit status: 2)
SMP=SP; eval `grep CONFIG_SMP /boot/config-2.6.18-274.17.1.el5`; [ -n "$CONFIG_SMP" ] && SMP=MP; KMODNAME=openafs.ko; DSTKMOD="."; [ "`echo "2.6.18-274.17.1.el5" | sed -e 's/^\([0-9]*\.[0-9]*\)\..*/\1/'`" = "2.4" ] && KMODNAME="libafs-*" && DSTKMOD=openafs.o; ./configure --with-linux-kernel-headers=/lib/modules/2.6.18-274.17.1.el5/build; make MPS=$SMP; mv src/libafs/MODLOAD-*/$KMODNAME $DSTKMOD.................................
cleaning build area....

DKMS: build Completed.

# pwd
/var/lib/dkms/openafs/el5.1.1
# ls -l
total 8
drwxr-xr-x 3 root root 4096 Feb  8 09:18 2.6.18-274.17.1.el5
drwxr-xr-x 4 root root 4096 Feb  8 09:18 build
lrwxrwxrwx 1 root root   24 Feb  8 09:13 source -> /usr/src/openafs-el5.1.1

# pwd
/var/lib/dkms/openafs/el5.1.1/2.6.18-274.17.1.el5/i686/module
# ls -l
total 10268
-rw-r--r-- 1 root root 10496304 Feb  8 09:35 openafs.ko

Comment 9 John Sopko 2012-02-09 12:59:38 UTC
The dkms 2.1 command sets the kernelver_array[] array:

kernelver_array[${#kernelver_array[@]}]=2.6.18-274.17.1.el5

and dkms 2.2 does not. The dkms-openafs dkms.conf uses this variable in
its make command:

# Items below here should not have to change with each driver version
PACKAGE_NAME="openafs"
MAKE[0]="SMP=SP; eval \`grep CONFIG_SMP /boot/config-${kernelver_array[0]}\`; [ -n \"\$CONFIG_SMP\" ] && SMP=MP; KMODNAME=openafs.ko; DSTKMOD=\".\"; [ \"\`echo \"${kernelver_array[0]}\" | sed -e 's/^\([0-9]*\.[0-9]*\)\..*/\1/'\`\" = \"2.4\" ] && KMODNAME=\"libafs-*\" && DSTKMOD=openafs.o; ./configure --with-linux-kernel-headers=${kernel_source_dir}; make MPS=\$SMP; mv src/libafs/MODLOAD-*/\$KMODNAME \$DSTKMOD"

They should be using the $kernelver as the dkms man page indicates. I changed
${kernelver_array[0]} to ${kernelver} in dkms.conf and it works for dkms 2.1 but
still has problems under dkms 2.2 which is not handling the make command the same. The $SMP $KMODNAME $DSTKMOD variables are not being set like in 2.1:

dkms 2.2 output
---------------
% /usr/sbin/dkms build -m openafs -v el5.1.1 -k 2.6.18-274.17.1.el5

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....(bad exit status: 2)
SMP=SP; eval CONFIG_SMP=y; [ -n  ] && SMP=MP; KMODNAME=openafs.ko; DSTKMOD=.; [ 2.6 = 2.4 ] && KMODNAME=libafs-* && DSTKMOD=openafs.o; ./configure --with-linux-kernel-headers=/lib/modules/2.6.18-274.17.1.el5/build; make MPS=; mv src/libafs/MODLOAD-*/ .........................(bad exit status: 1)
Error! Bad return status for module build on kernel: 2.6.18-274.17.1.el5 (i686)
Consult /var/lib/dkms/openafs/el5.1.1/build/make.log for more information.

dkms 2.1 output
---------------
% /usr/sbin/dkms build -m openafs -v el5.1.1 -k 2.6.18-274.17.1.el5

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....(bad exit status: 2)
SMP=SP; eval `grep CONFIG_SMP /boot/config-2.6.18-274.17.1.el5`; [ -n "$CONFIG_SMP" ] && SMP=MP; KMODNAME=openafs.ko; DSTKMOD="."; [ "`echo "2.6.18-274.17.1.el5" | sed -e 's/^\([0-9]*\.[0-9]*\)\..*/\1/'`" = "2.4" ] && KMODNAME="libafs-*" && DSTKMOD=openafs.o; ./configure --with-linux-kernel-headers=/lib/modules/2.6.18-274.17.1.el5/build; make MPS=$SMP; mv src/libafs/MODLOAD-*/$KMODNAME $DSTKMOD.................................
cleaning build area....

DKMS: build Completed.

Comment 10 sunil 2012-02-09 13:41:43 UTC
The variable is changed to "$kernelver". I am checking upstream for change of variable problem. Will update with more info.

Thanks,
Sunil

Comment 11 todd_lewis 2012-04-11 14:07:12 UTC
(In reply to comment #10)
Sunil,

If it helps, I had to change my dkms.conf line from this:

MAKE[0]="KV0=${kernelver}; KMODNAME=openafs.ko; DSTKMOD=\".\"; [ \"\`echo \"${kernelver_array[0]}\" | sed -e 's/^\([0-9]*\.[0-9]*\)\..*/\1/'\`\" = \"2.4\" ] && KMODNAME=\"libafs-*\" && DSTKMOD=openafs.o; ./configure --with-linux-kernel-headers=${kernel_source_dir} --with-linux-kernel-packaging; make; mv src/libafs/MODLOAD-*/\$KMODNAME \$DSTKMOD"

...to this:

MAKE[0]="KMODNAME=openafs.ko; DSTKMOD=\".\"; [ \"\`echo \"${kernelver_array[0]}${kernelver[0]}\" | sed -e 's/^\([0-9]*\.[0-9]*\)\..*/\1/'\`\" = \"2.4\" ] && KMODNAME=\"libafs-*\" && DSTKMOD=openafs.o; ./configure --with-linux-kernel-headers=${kernel_source_dir} --with-linux-kernel-packaging; make; mv src/libafs/MODLOAD-*/\\\$KMODNAME \\\$DSTKMOD"

That works with either $kernelver_array or $kernver, and it solves a problem with un-escaped "$".


Note You need to log in before you can comment on or make changes to this bug.