SHA256
1
0
forked from pool/dkms

Accepting request 1112078 from home:breadyx_:branches:X11:Bumblebee

Drop custom dkms.service in favour of the one provided by upstream

OBS-URL: https://build.opensuse.org/request/show/1112078
OBS-URL: https://build.opensuse.org/package/show/X11:Bumblebee/dkms?expand=0&rev=33
This commit is contained in:
Ferdinand Thiessen 2023-10-06 14:05:12 +00:00 committed by Git OBS Bridge
parent 2a81d19305
commit f520af8ec7
4 changed files with 15 additions and 83 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Sep 17 20:45:05 UTC 2023 - Alexandru Gabriel Bradatan <alex.bradatan85@yahoo.it>
- Drop custom dkms.service in favour of the one provided by
upstream
-------------------------------------------------------------------
Sat May 13 10:43:48 UTC 2023 - Alexandru Gabriel Bradatan <alex.bradatan85@yahoo.it>

View File

@ -1,12 +0,0 @@
[Unit]
Description=Dynamic Kernel Modules System
Before=display-manager.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/lib/systemd/system/dkms.systemd start
ExecStop=/usr/lib/systemd/system/dkms.systemd stop
[Install]
WantedBy=multi-user.target

View File

@ -24,14 +24,13 @@ License: GPL-2.0-only
Group: System/Kernel
URL: https://github.com/dell/dkms
Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: dkms.service
Source2: dkms.systemd
Source3: dkms.default
Source100: %{name}.rpmlintrc
# PATCH-FIX-OPENSUSE fix-kernel-postinst_d.patch boo#1194723
Patch1: fix-kernel-postinst_d.patch
# PATCH-FIX-OPENSUSE fix-weak-modules_dkms_in.patch boo#1194723
Patch2: fix-weak-modules_dkms_in.patch
BuildRequires: make
BuildRequires: pkgconfig(systemd)
Requires: bash > 1.99
Requires: cpio
@ -47,6 +46,7 @@ Requires: modutils
Requires: sed
Requires: tar
Requires: zstd
Recommends: openssl
BuildArch: noarch
%systemd_requires
@ -78,16 +78,17 @@ mv %{buildroot}%{_sysconfdir}/kernel/install.d/%{name} \
%{buildroot}%{_sysconfdir}/kernel/install.d/40-%{name}.install
# systemd
mkdir -p %{buildroot}%{_unitdir}
install -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
install -p -m 755 %{SOURCE2} %{buildroot}%{_unitdir}
mkdir -p "%{buildroot}%{_sysconfdir}/default"
install -m 644 %{SOURCE3} "%{buildroot}%{_sysconfdir}/default/dkms"
install -p -m 644 -D dkms.service %{buildroot}%{_unitdir}/dkms.service
install -m 644 -D %{SOURCE3} %{buildroot}%{_sysconfdir}/default/dkms
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcdkms
sed -i \
-e 's:# tmp_location="/tmp":tmp_location="%{_localstatedir}/tmp/dkms":' \
%{buildroot}%{_sysconfdir}/dkms/framework.conf
sed -i \
-e 's/# modprobe_on_install="true"/modprobe_on_install="true"/g' \
%{buildroot}%{_sysconfdir}/%{name}/framework.conf
# Install /usr/lib/tmpfiles.d/dkms.conf
mkdir -p %{buildroot}%{_tmpfilesdir}
@ -126,14 +127,13 @@ exit 0
%{_libexecdir}/%{name}
%{_tmpfilesdir}/dkms.conf
%{_mandir}/man8/dkms.8%{ext_man}
# these dirs are for plugins - owned by other packages
%{_sysconfdir}/kernel/postinst.d/%{name}
%{_sysconfdir}/kernel/prerm.d/%{name}
%{_sysconfdir}/kernel/install.d/40-%{name}.install
%{_datadir}/bash-completion/completions/%{name}
%{_unitdir}/dkms.service
%{_unitdir}/dkms.systemd
%config %{_sysconfdir}/default/dkms
# these dirs are for plugins - owned by other packages
%dir %{_sysconfdir}/kernel
%dir %{_sysconfdir}/kernel/postinst.d
%dir %{_sysconfdir}/kernel/install.d

View File

@ -1,62 +0,0 @@
#!/bin/bash
. /etc/default/dkms
# list dkms modules for the current running kernel
list_dkms_modules() {
shopt -s nullglob
declare -ag DKMS_MODULES
# dkms status needs uname -r to list correctly intalled version for current kernel
local modules_path=($(dkms status -k "$(uname -r)"|sed -rn 's#(.*), (.*), (.*): installed#\1/\2/\3#p'))
for p in "${modules_path[@]}"; do
for m in /var/lib/dkms/"$p"/module/*.ko{,.gz,.zst}; do
m=${m##*/}
m=${m%.gz}
m=${m%.zst}
m=${m%.ko}
DKMS_MODULES+=("$m")
done
done
}
# load installed kernel modules for the current kernel version
load_dkms_modules() {
local ret=0
list_dkms_modules
for m in "${DKMS_MODULES[@]}"; do
modprobe "$m"
ret+=$?
done
return $ret
}
# unload installed kernel modules for the current kernel version
unload_dkms_modules() {
list_dkms_modules
# ask for removal
for m in "${DKMS_MODULES[@]}"; do
modprobe --remove --quiet "$m"
done
# check modules are unloaded
# sometimes modprobe -r fail but modules are removed
for m in "${DKMS_MODULES[@]}"; do
[[ -e /sys/modules/$m ]] && return 1
done
return 0
}
case "$1" in
start)
dkms autoinstall -k "$(uname -r)"
[[ $LOAD =~ [Yy][Ee][Ss] ]] && load_dkms_modules
;;
stop)
[[ $UNLOAD =~ [Yy][Ee][Ss] ]] && unload_dkms_modules
;;
*)
echo "usage: $0 {start|stop}" >&2
;;
esac
:
# vim:set ts=2 sw=2 ft=sh et: