[3/3] alsa: Fixed Bug#13087 - Corrects the path for asound.state and adds start and stop service
Commit Message
- start_service added to install.sh and stop_service to uninstall.sh
This ensures that the modules are loaded after install and that when doing uninstall
the stop_service ensures that the snd modules are unloaded.
- the asound.state file was touched by the install.sh cript but the alsactl store and
restore commands have default location of /var/lib/alsa/ so the touch command created
an asound.state file that was then not used subsequently. It also meant that the first
start of alsa would fail as it would try and restore from /var/lib/alsa/asound.state
but the file did not exist.
- This patch also corrects the path for the touch command for asound.state
- The install.sh script also checks if /etc/asound.state exists and if it does removes it.
Fixes: Bug#13087
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
src/paks/alsa/install.sh | 7 ++++++-
src/paks/alsa/uninstall.sh | 2 ++
2 files changed, 8 insertions(+), 1 deletion(-)
@@ -24,7 +24,12 @@
. /opt/pakfire/lib/functions.sh
extract_files
groupadd audio 2>/dev/null
-touch /etc/asound.state
+touch /var/lib/alsa/asound.state
+if [ -f /etc/asound.state ]; then
+ rm /etc/asound.state
+fi
ln -svf ../init.d/alsa /etc/rc.d/rc3.d/S65alsa
ln -svf ../init.d/alsa /etc/rc.d/rc0.d/K35alsa
ln -svf ../init.d/alsa /etc/rc.d/rc6.d/K35alsa
+start_service ${NAME}
+exit 0
@@ -22,5 +22,7 @@
############################################################################
#
. /opt/pakfire/lib/functions.sh
+stop_service ${NAME}
remove_files
rm -rf /etc/rc.d/rc*.d/*alsa
+exit 0