public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Adolf Belka <adolf.belka@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH 3/3] alsa: Fixed Bug#13087 - Corrects the path for asound.state and adds start and stop service
Date: Fri, 21 Apr 2023 23:15:03 +0200	[thread overview]
Message-ID: <20230421211503.2647702-3-adolf.belka@ipfire.org> (raw)
In-Reply-To: <20230421211503.2647702-1-adolf.belka@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 2015 bytes --]

- 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(a)ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka(a)ipfire.org>
---
 src/paks/alsa/install.sh   | 7 ++++++-
 src/paks/alsa/uninstall.sh | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/paks/alsa/install.sh b/src/paks/alsa/install.sh
index 7b6b3dc80..d6ab7b465 100644
--- a/src/paks/alsa/install.sh
+++ b/src/paks/alsa/install.sh
@@ -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
diff --git a/src/paks/alsa/uninstall.sh b/src/paks/alsa/uninstall.sh
index 62e27008d..632b695ae 100644
--- a/src/paks/alsa/uninstall.sh
+++ b/src/paks/alsa/uninstall.sh
@@ -22,5 +22,7 @@
 ############################################################################
 #
 . /opt/pakfire/lib/functions.sh
+stop_service ${NAME}
 remove_files
 rm -rf /etc/rc.d/rc*.d/*alsa
+exit 0
-- 
2.40.0


      parent reply	other threads:[~2023-04-21 21:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21 21:15 [PATCH 1/3] alsa: Fix bug#13087 remove services entry Adolf Belka
2023-04-21 21:15 ` [PATCH 2/3] alsa: Fixes Bug#13087 - adds module removal for stopping alsa Adolf Belka
2023-04-21 21:15 ` Adolf Belka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230421211503.2647702-3-adolf.belka@ipfire.org \
    --to=adolf.belka@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox