DKMS patch to resolve 2 issues

Jeff Kirsher jeffrey.t.kirsher at intel.com
Sun Oct 16 03:28:59 CDT 2011


There are two issues that I have run into, 1 of which has been present
since 2.1.x which would be nice to finally resolve.

The first issue I found when I finally had to migrate to the latest
version (2.2.0.2).  While trying to make a driver disk image or mkrpm
command the sub command to make a DKMS tarball would create a tarball
with the name %{module name}-%{module version}-mktarball.dkms yet the
DKMS script would be looking for %{module name}-%{module
version}-mktarball.dkms.tgz.  I did not trace this back to when it first
was on issue.  I just know that this is a problem with version 2.2.0.2.
This was reproduced by the following command dkms mkrpm -m ixgbe -v
3.6.7 --all, and the output says that is creates a tarball of
ixgbe-3.6.7-mktarball.dkms.tgz in /var/lib/dkms/ixgbe/3.6.7/tarball//,
yet the mkrpm command fails because it is not able to find the tarball.
When you look in /var/lib/dkms/ixgbe/3.6.7/tarball/ it only has
ixgbe-3.6.7-mktarball.dkms.  I commented out the line below and
everything worked just fine.

--- dkms	2011-10-15 01:52:51.895694632 -0700
+++ dkms	2011-10-15 04:08:48.081239535 -0700
@@ -2477,7 +2477,6 @@ make_tarball()
     echo $"Tarball location: $tarball_dest/$tarball_name"
 
     local tarball_ext=${tarball_name##*.}
-    [[ $tarball_ext = tar ]] || tarball_name=${tarball_name
%.$tarball_ext}
 
     # Make the tarball
     cd $temp_dir_name

The second issue has been present since DKMS 2.1.x and was the main
reason I never upgraded from 2.0.22.0.  Now that I need the
functionality of DKMS 2.2.x because we create driver disk images in the
redhat3 version, I needed to resolve this long standing issue. The issue
was that when you try and make a source & binary RPM, the RPM does not
contain the module source.  This issue appeared when the logic changed.
Below is a patch that reverts the logic so that it is possible to make a
source & binary RPM in one RPM.

--- dkms	2011-10-15 01:52:51.895694632 -0700
+++ dkms	2011-10-15 04:08:48.081239535 -0700
@@ -2763,8 +2763,9 @@ make_rpm()
 
     # Run a dkms mktarball for use in the rpm
     local mktarball_line
-    if [[ ! $source_only || $binaries_only ]]; then
-	mktarball_line="--binaries-only"
+    if [  -n "$source_only" ]; then
+	mktarball_line="--source-only"
+    else
 	local i
 	echo $""
 	for ((i=0; i<${#kernelver[@]}; i++)); do
@@ -2776,8 +2777,6 @@ make_rpm()
 	    echo $"Marking ${kernelver[$i]} (${arch[$i]}) for RPM..."
 	    mktarball_line="-k ${kernelver[$i]} -a ${arch[$i]}
$mktarball_line"
 	done
-    else
-	mktarball_line="none"
     fi
 
     local temp_dir_name=$(mktemp_or_die -d $tmp_location/dkms.XXXXXX)

I have attached that entire patch as well
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix.patch
Type: text/x-patch
Size: 1020 bytes
Desc: not available
Url : http://lists.us.dell.com/pipermail/dkms-devel/attachments/20111016/d3c30aed/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://lists.us.dell.com/pipermail/dkms-devel/attachments/20111016/d3c30aed/attachment-0001.bin 


More information about the DKMS-devel mailing list