alsa-utils/alsactl/init/00main
Jaroslav Kysela 24fe765fa6 alsactl init configuration syntax changes
- change SYSFS_DEVICE to CONFIG{sysfs_device}
- INCLUDE key now handles also directories
- RESULT key can assign value now
- EXIT="return" operation returns from included file immediately

Default 00main and hda configuration files changes:

- handle preinit and postinit directories

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-13 20:49:07 +02:00

43 lines
1.5 KiB
Text

# This is toplevel configuration for for 'alsactl init'.
# See 'man alsactl_init' for syntax.
# set root device directory in sysfs for soundcard for ATTR{} command
CONFIG{sysfs_device}="/class/sound/controlC$cardinfo{card}/device"
# test for extra commands
ENV{CMD}=="help", INCLUDE="help", GOTO="00main_end"
ENV{CMD}=="info", INCLUDE="info", GOTO="00main_end"
ENV{CMD}=="test", INCLUDE="test", GOTO="00main_end"
ENV{CMD}=="*", ERROR="Unknown command '$env{CMD}'\n", GOTO="00main_end"
# include files with real configuration
#
# steps are:
# 1) look for preinit subdirectory and parse all files in it
# 2) if RESULT=="skip", skip ALSA standard configuration files
# 3) do ALSA standard configuration
# 4) look for postinit subdirectory and parse all files in it
# 5) if RESULT!="true", print an error message and return with exit code 99
# 6) return with exit code 0 (success)
#
RESULT="unknown"
ACCESS=="preinit", INCLUDE="preinit"
RESULT=="skip", GOTO="init_end"
# real ALSA configuration database
CARDINFO{driver}=="HDA-Intel", INCLUDE="hda", GOTO="init_end"
CARDINFO{driver}=="Test", INCLUDE="test", GOTO="init_end"
LABEL="init_end"
ACCESS=="postinit", INCLUDE="postinit"
RESULT=="true", GOTO="00_mainend"
ERROR="Unknown hardware: \"$cardinfo{driver}\" \"$cardinfo{mixername}\" \"$cardinfo{components}\" \"$attr{subsystem_vendor}\" \"$attr{subsystem_device}\"\n"
ERROR="Hardware is left uninitialized\n"
EXIT="99"
#
# label identifying end of main file
#
LABEL="00main_end"