From ce10972958e03254d8ac63407c41a991a3a20c81 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 21:49:47 +0100 Subject: [PATCH] added a patch to avoid failed with dkms status and remove if missing source directory [release 2.2.0.3-3mamba;Sat Apr 13 2013] --- README.md | 2 + ...3-dont_fail_if_module_source_removed.patch | 24 +++++ dkms.spec | 89 +++++++++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 dkms-2.2.0.3-dont_fail_if_module_source_removed.patch create mode 100644 dkms.spec diff --git a/README.md b/README.md index 5fa0309..04e17b7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # dkms +DKMS stands for Dynamic Kernel Module Support. It is designed to create a framework where kernel dependent module source can reside so that it is very easy to rebuild modules as you upgrade kernels. This will allow Linux vendors to provide driver drops without having to wait for new kernel releases while also taking out the guesswork for customers attempting to recompile modules for new kernels. + diff --git a/dkms-2.2.0.3-dont_fail_if_module_source_removed.patch b/dkms-2.2.0.3-dont_fail_if_module_source_removed.patch new file mode 100644 index 0000000..ee07cbb --- /dev/null +++ b/dkms-2.2.0.3-dont_fail_if_module_source_removed.patch @@ -0,0 +1,24 @@ +diff -Nru dkms-2.2.0.3.orig/dkms dkms-2.2.0.3/dkms +--- dkms-2.2.0.3.orig/dkms 2013-04-04 16:57:08.987698428 +0200 ++++ dkms-2.2.0.3/dkms 2013-04-13 14:19:14.182300156 +0200 +@@ -455,8 +455,11 @@ + [[ $conf ]] && read_conf_file="$conf" + [[ $3 ]] && read_conf_file="$3" + ++ [[ ! -r $read_conf_file && -r $dkms_tree/$module/$module_version/build/dkms.conf ]] && \ ++ read_conf_file="$dkms_tree/$module/$module_version/build/dkms.conf" ++ + [[ -r $read_conf_file ]] || die 4 $"Could not locate dkms.conf file." \ +- $"File: $conf does not exist." ++ $"File: $read_conf_file does not exist." + + [[ $last_mvka = $module/$module_version/$1/$2 && \ + $last_mvka_conf = $(readlink -f $read_conf_file) ]] && return +@@ -1436,6 +1439,7 @@ + is_module_added() { + [[ $1 && $2 ]] || return 1 + [[ -d $dkms_tree/$1/$2 ]] || return 2 ++ [[ -d $dkms_tree/$1/$2/source/ ]] || return 2 + [[ -L $dkms_tree/$1/$2/source || -d $dkms_tree/$1/$2/source ]]; + } + diff --git a/dkms.spec b/dkms.spec new file mode 100644 index 0000000..44be1ac --- /dev/null +++ b/dkms.spec @@ -0,0 +1,89 @@ +Name: dkms +Version: 2.2.0.3 +Release: 3mamba +Summary: Dynamic Kernel Module Support +Group: System/Tools +Vendor: openmamba +Distribution: openmamba +Packager: Ercole 'ercolinux' Carpanetto +URL: http://linux.dell.com/projects.shtml#dkms +Source: http://linux.dell.com/dkms/permalink/dkms-%{version}.tar.gz +Patch0: dkms-2.2.0.3-dont_fail_if_module_source_removed.patch +License: GPL +## AUTOBUILDREQ-BEGIN +## AUTOBUILDREQ-END +Requires: kernelheaders +Requires: gcc +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +DKMS stands for Dynamic Kernel Module Support. It is designed to create a framework where kernel dependent module source can reside so that it is very easy to rebuild modules as you upgrade kernels. This will allow Linux vendors to provide driver drops without having to wait for new kernel releases while also taking out the guesswork for customers attempting to recompile modules for new kernels. + +%prep +%setup -q +%patch0 -p1 + +%build + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +make install-redhat DESTDIR=%{buildroot} + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post +if [ $1 -ge 1 ]; then + /sbin/chkconfig --add dkms_autoinstaller + /sbin/service dkms_autoinstaller start +fi +: + +%preun +if [ $1 -eq 0 ]; then + /sbin/chkconfig --del dkms_autoinstaller +fi +: + +%files +%defattr(-,root,root) +%{_sysconfdir}/dkms/template-dkms-mkrpm.spec +%{_sysconfdir}/dkms/template-dkms-redhat-kmod.spec +%{_initrddir}/dkms_autoinstaller +%{_sysconfdir}/bash_completion.d/dkms +%{_sysconfdir}/dkms/framework.conf +%{_sysconfdir}/kernel/postinst.d/dkms +%{_sysconfdir}/kernel/prerm.d/dkms +%{_sbindir}/dkms +%dir %{_prefix}/lib/dkms +%{_prefix}/lib/dkms/common.postinst +%{_prefix}/lib/dkms/dkms_autoinstaller +%{_prefix}/lib/dkms/find-provides +%{_prefix}/lib/dkms/lsb_release +%{_prefix}/lib/dkms/mkkerneldoth +%dir %{_localstatedir}/lib/dkms +%{_localstatedir}/lib/dkms/dkms_dbversion +%{_mandir}/man8/dkms.8.gz +%doc AUTHORS COPYING README.dkms TODO + +%changelog +* Sat Apr 13 2013 Silvan Calarco 2.2.0.3-3mamba +- added a patch to avoid failed with dkms status and remove if missing source directory + +* Thu Apr 04 2013 Silvan Calarco 2.2.0.3-2mamba +- install and configure init script (by using make install-redhat) + +* Fri Jun 15 2012 Automatic Build System 2.2.0.3-1mamba +- automatic version update by autodist + +* Sat Oct 08 2011 Silvan Calarco 2.2.0.2-2mamba +- added requirements for kernelheaders and gcc + +* Fri Oct 07 2011 Silvan Calarco 2.2.0.2-1mamba +- update to 2.2.0.2 + +* Fri Apr 04 2009 Ercole 'ercolinux' Carpanetto 2.0.21.1-2mamba +- modified Group and Packager + +* Wed Apr 01 2009 Ercole 'ercolinux' Carpanetto 2.0.21.1-1mamba +- package created by autospec