Accepting request 706125 from home:tiwai:branches:multimedia:libs

- Add systemd service to load OSS and sequencer modules
  (bsc#1136562)

OBS-URL: https://build.opensuse.org/request/show/706125
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-utils?expand=0&rev=157
This commit is contained in:
Takashi Iwai 2019-05-28 18:57:39 +00:00 committed by Git OBS Bridge
parent 81503e1968
commit 10015c812d
4 changed files with 64 additions and 1 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue May 28 14:04:52 CEST 2019 - tiwai@suse.de
- Add systemd service to load OSS and sequencer modules
(bsc#1136562)
-------------------------------------------------------------------
Fri May 10 11:56:14 CEST 2019 - tiwai@suse.de

View File

@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@ -26,6 +26,8 @@ Group: Productivity/Multimedia/Sound/Players
URL: http://www.alsa-project.org/
Source: ftp://ftp.alsa-project.org/pub/utils/alsa-utils-%{version}.tar.bz2
Source1: 01beep.conf
Source2: sound-extra.service
Source5: load-sound-modules.sh
Patch101: alsa-utils-configure-version-revert.patch
BuildRequires: alsa-devel
BuildRequires: automake
@ -90,6 +92,23 @@ rm -f %{buildroot}%{_mandir}/man*/alsaconf.*
%find_lang %{name} --all-name
ln -s alsa-restore.service %{buildroot}%{_unitdir}/alsasound.service
mkdir -p %{buildroot}%{_localstatedir}/lib/alsa
# systemd unit files
install -c -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}
ln -s ../sound-extra.service %{buildroot}%{_unitdir}/sound.target.wants
mkdir -p %{buildroot}%{_libexecdir}/systemd/scripts
install -c -m 0755 %{SOURCE5} %{buildroot}%{_libexecdir}/systemd/scripts
%pre
%service_add_pre sound-extra.service
%post
%service_add_post sound-extra.service
%preun
%service_del_preun sound-extra.service
%postun
%service_del_postun sound-extra.service
%files -f %{name}.lang
%license COPYING
@ -108,6 +127,7 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/alsa
%{_udevdir}
%{_unitdir}/*.service
%{_unitdir}/sound.target.wants
%{_libexecdir}/systemd/scripts
%{_localstatedir}/lib/alsa
%files -n alsabat

29
load-sound-modules.sh Normal file
View File

@ -0,0 +1,29 @@
#!/bin/sh
test -r /etc/sysconfig/sound && . /etc/sysconfig/sound
if [ "$LOAD_OSS_EMUL_MODULES" = "yes" ]; then
/sbin/modprobe -q snd-mixer-oss
/sbin/modprobe -q snd-pcm-oss
fi
if [ "$LOAD_SEQUENCER" = "yes" ]; then
/sbin/modprobe -q snd-seq
fi
if [ -r /proc/asound/seq/drivers ]; then
OLDIFS="$IFS"
IFS=","
while read t x c; do
/sbin/modprobe -q $t
done < /proc/asound/seq/drivers
IFS="$OLDIFS"
fi
if [ -d /proc/asound/seq ]; then
if [ "$LOAD_OSS_SEQ_MODULE" = "yes" ]; then
/sbin/modprobe -q snd-seq-oss
fi
fi
exit 0

8
sound-extra.service Normal file
View File

@ -0,0 +1,8 @@
[Unit]
Description=Load extra kernel modules for sound stuff
After=alsasound.service
ConditionPathExists=/proc/asound
[Service]
Type=oneshot
ExecStart=/usr/lib/systemd/scripts/load-sound-modules.sh