[dkms/el5: 1/2] Add ZFS On Linux patches

Simone Caronni slaanesh at fedoraproject.org
Mon Nov 4 15:56:42 UTC 2013


commit 68fc3e033bc96fab9b00c48852f195ccb9e173ea
Author: Simone Caronni <negativo17 at gmail.com>
Date:   Mon Nov 4 16:55:42 2013 +0100

    Add ZFS On Linux patches

 dkms-add_BUILD_DEPENDS.patch                       |  120 ++++++++++++++++++++
 dkms-cleanup-after-removal.patch                   |   13 ++
 dkms-do-not-fail-on-modules-dir.patch              |   12 ++
 ...TRIP-0-as-the-default-for-the-STRIP-array.patch |   24 ++++
 dkms.spec                                          |   15 +++-
 5 files changed, 183 insertions(+), 1 deletions(-)
---
diff --git a/dkms-add_BUILD_DEPENDS.patch b/dkms-add_BUILD_DEPENDS.patch
new file mode 100644
index 0000000..18743c0
--- /dev/null
+++ b/dkms-add_BUILD_DEPENDS.patch
@@ -0,0 +1,120 @@
+diff -Naur dkms.old/dkms dkms/dkms
+--- dkms.old/dkms	2013-11-04 16:33:26.972039283 +0100
++++ dkms/dkms	2013-11-04 16:34:03.194710355 +0100
+@@ -3170,15 +3170,26 @@
+ # by hand if dkms_autoinstaller is not used.
+ autoinstall() {
+     local status mv mvka m v k a last_v last_m tenative
++    local install_count next_depends
+     local -a to_install=()
++    local -a next_install=()
++    local -a installed_modules=()
++    local -A build_depends=()
++
+     # Walk through our list of installed and built modules, and create
+     # a list of modules that need to be reinstalled.
+     while read status mvka; do
+         IFS='/' read m v k a <<< "$mvka"
+         [[ ! $last_m ]] && last_m="$m"
+         # If the module is already installed or weak-installed, skip it.
+-        _is_module_installed "$m" "$v" "$kernelver" "$arch" && continue
+-        module_status_weak "$m" "$v" "$kernelver" "$arch" >/dev/null && continue
++        if _is_module_installed "$m" "$v" "$kernelver" "$arch"; then
++		installed_modules[${#installed_modules[@]}]="$m"
++		continue
++	fi
++        if module_status_weak "$m" "$v" "$kernelver" "$arch" >/dev/null; then
++		installed_modules[${#installed_modules[@]}]="$m"
++		continue
++	fi
+         # if the module does not want to be autoinstalled, skip it.
+         read_conf_or_die "$k" "$a" "$dkms_tree/$m/$v/source/dkms.conf"
+         if [[ ! $AUTOINSTALL ]]; then
+@@ -3187,7 +3198,10 @@
+         elif [[ $last_m != $m ]]; then
+             last_m="$m"
+             last_v='0'
+-            [[ $tenative ]] && to_install[${#to_install[@]}]="$tenative"
++            if [[ $tenative ]]; then
++                to_install[${#to_install[@]}]="$tenative"
++                build_depends["$m"]="${BUILD_DEPENDS[@]}"
++            fi
+             tenative=''
+         fi
+         if [[ ($(VER $v) > $(VER $last_v)) ]]; then
+@@ -3197,14 +3211,50 @@
+     done < <(module_status)
+     # We may have exited the loop with $tenative set.  If it is,
+     # it contains something that should be updated.
+-    [[ $tenative ]] && to_install[${#to_install[@]}]="$tenative"
++    if [[ $tenative ]]; then
++        to_install[${#to_install[@]}]="$tenative"
++        build_depends["$m"]="${BUILD_DEPENDS[@]}"
++    fi
+     [[ $to_install ]] || return 0
+-    # 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) &
+-    done
+-    wait
++
++	while true; do
++		install_count=0
++		next_install=( )
++
++		# Step 1: Remove installed modules from all dependency lists.
++		for m in ${!build_depends[@]}; do
++			next_depends=
++			for d in ${build_depends[$m]}; do
++				for i in ${installed_modules[@]}; do
++					[[ "$d" = "$i" ]] && continue 2
++				done
++				next_depends+="$d "
++			done
++			build_depends[$m]="${next_depends%% }"
++		done
++
++		# Step 2: Install modules that have an empty dependency list.
++		for mv in "${to_install[@]}"; do
++			IFS=/ read m v <<< "$mv"
++			if [[ -z "${build_depends[$m]}" ]]; then
++				(module="$m"; module_version="$v"; install_module) &
++				installed_modules[${#installed_modules[@]}]="$m"
++				install_count=$(($install_count +1))
++			else
++				next_install[${#next_install[@]}]="$mv"
++			fi
++		done
++
++		wait
++
++		# Step 3: Keep going if at least one module was installed during
++		# this iteration.
++		[[ "$install_count" -gt 0 ]] || break;
++
++		# Step 4: Remove modules that were installed during Step 2 from
++		# the job queue.
++		to_install=( "${next_install[@]}" )
++	done
+ }
+ 
+ function make_redhat3_driver_disk ()
+diff -Naur dkms.old/dkms.8 dkms/dkms.8
+--- dkms.old/dkms.8	2013-11-04 16:33:26.973039274 +0100
++++ dkms/dkms.8	2013-11-04 16:34:03.194710355 +0100
+@@ -833,6 +833,14 @@
+ .B dkms_autoinstaller
+ for more information.
+ .TP
++.B BUILD_DEPENDS[#]=
++This optional directive is an array that allows you to specify other modules as
++dependencies for your module. Each array element should be the
++.B PACKAGE_NAME
++of another module that is managed by dkms. Do not specify a version or
++architecture in the dependency. Note that this directive is only advisory;
++missing or broken dependencies cause non-fatal warnings.
++.TP
+ .B BUILD_EXCLUSIVE_KERNEL=
+ This optional directive allows you to specify a regular expression which defines
+ the subset of kernels which DKMS is allowed to build your module for.  If the kernel
diff --git a/dkms-cleanup-after-removal.patch b/dkms-cleanup-after-removal.patch
new file mode 100644
index 0000000..27130bf
--- /dev/null
+++ b/dkms-cleanup-after-removal.patch
@@ -0,0 +1,13 @@
+diff -Naur dkms.old/dkms dkms/dkms
+--- dkms.old/dkms	2013-11-04 16:37:44.383701334 +0100
++++ dkms/dkms	2013-11-04 16:38:15.663417165 +0100
+@@ -1622,6 +1622,9 @@
+ 	    echo $" - Uninstallation"
+ 	    echo $"   - Deleting from: $install_tree/$1${real_dest_module_location}/"
+ 	    rm -f "$install_tree/$1${real_dest_module_location}/${dest_module_name[$count]}$module_suffix"
++	    dir_to_remove="${real_dest_module_location#/}"
++	    while [ "${dir_to_remove}" != "${dir_to_remove#/}" ]; do dir_to_remove="${dir_to_remove#/}" ; done
++	    (cd "$install_tree/$1" && rmdir --parents --ignore-fail-on-non-empty "${dir_to_remove}" || true)
+ 	    echo $" - Original module"
+ 	    if [[ -e $dkms_tree/$module/original_module/$1/$2/${dest_module_name[$count]}$module_suffix ]]; then
+ 		case "$running_distribution" in
diff --git a/dkms-do-not-fail-on-modules-dir.patch b/dkms-do-not-fail-on-modules-dir.patch
new file mode 100644
index 0000000..9e5a33f
--- /dev/null
+++ b/dkms-do-not-fail-on-modules-dir.patch
@@ -0,0 +1,12 @@
+diff -Naur dkms.old/dkms_common.postinst dkms/dkms_common.postinst
+--- dkms.old/dkms_common.postinst	2013-11-04 16:31:42.101991371 +0100
++++ dkms/dkms_common.postinst	2013-11-04 16:40:04.854424946 +0100
+@@ -146,7 +146,7 @@
+     exit 1
+ fi
+ 
+-KERNELS=$(ls /lib/modules/)
++KERNELS=$(ls /lib/modules/ 2>/dev/null || true)
+ CURRENT_KERNEL=$(uname -r)
+ 
+ #We never want to keep an older version side by side to prevent conflicts
diff --git a/dkms-use-STRIP-0-as-the-default-for-the-STRIP-array.patch b/dkms-use-STRIP-0-as-the-default-for-the-STRIP-array.patch
new file mode 100644
index 0000000..0539d64
--- /dev/null
+++ b/dkms-use-STRIP-0-as-the-default-for-the-STRIP-array.patch
@@ -0,0 +1,24 @@
+diff -Naur dkms.old/dkms dkms/dkms
+--- dkms.old/dkms	2013-11-04 16:31:42.100991381 +0100
++++ dkms/dkms	2013-11-04 16:32:51.595360475 +0100
+@@ -526,7 +526,8 @@
+ 	esac
+ 	case ${STRIP[$index]} in
+ 	    [nN]*) strip[$index]="no";;
+-	    *)     strip[$index]="yes";;
++	    [yY]*) strip[$index]="yes";;
++	    '')    strip[$index]=${strip[0]:-yes};;
+ 	esac
+ 
+ 	# If unset, set by defaults
+diff -Naur dkms.old/dkms.8 dkms/dkms.8
+--- dkms.old/dkms.8	2013-11-04 16:31:42.101991371 +0100
++++ dkms/dkms.8	2013-11-04 16:32:51.596360471 +0100
+@@ -727,6 +727,7 @@
+ .B STRIP[#]=
+ By default strip is considered to be "yes".  If set to "no", DKMS will not
+ run strip \-g against your built module to remove debug symbols from it.
++STRIP[0] is used as the default for any unset entries in the STRIP array.
+ .TP
+ .B PACKAGE_NAME=
+ This directive is used to give the name associated with the entire package of modules.  This is the same
diff --git a/dkms.spec b/dkms.spec
index 34b9fe0..72922b1 100644
--- a/dkms.spec
+++ b/dkms.spec
@@ -5,7 +5,7 @@
 Summary:        Dynamic Kernel Module Support Framework
 Name:           dkms
 Version:        2.2.0.3
-Release:        17%{dist}
+Release:        18%{dist}
 License:        GPLv2+
 Group:          System Environment/Base
 BuildArch:      noarch
@@ -19,6 +19,12 @@ Patch0:         %{name}-git.patch
 Patch1:         %{name}-fix-variables.patch
 Patch2:         %{name}-force-tarball.patch
 Patch3:         %{name}-fix-mkrpm.patch
+# Patches coming from ZFS On Linux project for functionality / bugfixes
+# https://github.com/zfsonlinux/dkms/tree/master/ubuntu/saucy/debian/patches
+Patch4:         %{name}-use-STRIP-0-as-the-default-for-the-STRIP-array.patch
+Patch5:         %{name}-add_BUILD_DEPENDS.patch
+Patch6:         %{name}-cleanup-after-removal.patch
+Patch7:         %{name}-do-not-fail-on-modules-dir.patch
 
 Requires:       coreutils
 Requires:       cpio
@@ -58,6 +64,10 @@ method for installing module RPMS as originally developed by Dell.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 %build
 
@@ -137,6 +147,9 @@ fi
 %{_sysconfdir}/bash_completion.d/%{name}
 
 %changelog
+* Mon Nov 04 2013 Simone Caronni <negativo17 at gmail.com> - 2.2.0.3-18
+- Add ZFS On Linux patches for additional functionality / bugfixes.
+
 * Thu Aug 29 2013 Simone Caronni <negativo17 at gmail.com> - 2.2.0.3-17
 - Add propert patch for 1002551.
 


More information about the scm-commits mailing list