- alsa has an initscript but it is not starting and stopping a traditional daemon service. The initscript loads some alsa modules and then restores the asound.state file - This patch updates the PAK_VER number and removes the services entry and explicitly adds alsa in for the initscript installation.
Fixes: Bug#13087 Signed-off-by: Adolf Belka adolf.belka@ipfire.org --- lfs/alsa | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lfs/alsa b/lfs/alsa index 2d89af880..5c74bd182 100644 --- a/lfs/alsa +++ b/lfs/alsa @@ -37,11 +37,11 @@ DL_FILE = $(THISAPP).tar.bz2 DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) PROG = alsa -PAK_VER = 15 +PAK_VER = 16
DEPS =
-SERVICES = alsa +SERVICES =
TARGET = $(DIR_INFO)/$(THISAPP)
@@ -104,6 +104,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP)/alsa-firmware-$(FVER) && make $(MAKETUNING) $(EXTRA_MAKE) cd $(DIR_APP)/alsa-firmware-$(FVER) && make install # install initscript - $(call INSTALL_INITSCRIPTS,$(SERVICES)) + $(call INSTALL_INITSCRIPTS,alsa) @rm -rf $(DIR_SRC)/alsa* @$(POSTBUILD)
- Stopping alsa or uninstalling it left the sound modules installed until a reboot was carried out. Uninstallation or stopping the kernel modules should also unload them. This patch adds in the modprobe -r commands to unload all the snd modules installed with the start command. The stop command is then added into the uninstall script to remove the modules.
Fixes: Bug#13087 Tested-by: Adolf Belka adolf.belka@ipfire.org Signed-off-by: Adolf Belka adolf.belka@ipfire.org --- src/initscripts/packages/alsa | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/src/initscripts/packages/alsa b/src/initscripts/packages/alsa index 348e33846..3bfb69f62 100644 --- a/src/initscripts/packages/alsa +++ b/src/initscripts/packages/alsa @@ -33,6 +33,10 @@ case "$1" in ;; stop) boot_mesg "Stopping ALSA... Saving volumes..." + modprobe -r snd_pcm_oss >/dev/null 2>&1 || failed=1 + modprobe -r snd_timer >/dev/null 2>&1 || failed=1 + (exit ${failed}) + evaluate_retval loadproc /usr/sbin/alsactl store ;;
- 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(-)
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