From 5acda3eaeabae9045609539303a8c12c4ce401f1 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 25 Apr 2016 12:01:08 +0200 Subject: merge with latest dev version --- .../etc/systemd/system/alsa-default-card.service | 11 ++++++ .../alsa-default-card.service | 1 + .../data/opt/openslx/scripts/alsa-default_card | 42 ++++++++++++++++++++++ core/modules/alsa/module.build | 19 ++++++++++ core/modules/alsa/module.conf | 8 +++++ core/modules/alsa/module.conf.debian | 10 ++++++ core/modules/alsa/module.conf.fedora | 13 +++++++ core/modules/alsa/module.conf.opensuse | 10 ++++++ core/modules/alsa/module.conf.scientific | 12 +++++++ core/modules/alsa/module.conf.ubuntu | 7 ++++ core/modules/alsa/module.conf.ubuntu.12 | 6 ++++ 11 files changed, 139 insertions(+) create mode 100644 core/modules/alsa/data/etc/systemd/system/alsa-default-card.service create mode 120000 core/modules/alsa/data/etc/systemd/system/multi-user.target.wants/alsa-default-card.service create mode 100755 core/modules/alsa/data/opt/openslx/scripts/alsa-default_card create mode 100644 core/modules/alsa/module.build create mode 100644 core/modules/alsa/module.conf create mode 100644 core/modules/alsa/module.conf.debian create mode 100644 core/modules/alsa/module.conf.fedora create mode 100644 core/modules/alsa/module.conf.opensuse create mode 100644 core/modules/alsa/module.conf.scientific create mode 100644 core/modules/alsa/module.conf.ubuntu create mode 100644 core/modules/alsa/module.conf.ubuntu.12 (limited to 'core/modules/alsa') diff --git a/core/modules/alsa/data/etc/systemd/system/alsa-default-card.service b/core/modules/alsa/data/etc/systemd/system/alsa-default-card.service new file mode 100644 index 00000000..db35eeb7 --- /dev/null +++ b/core/modules/alsa/data/etc/systemd/system/alsa-default-card.service @@ -0,0 +1,11 @@ +[Unit] +Description=Set default card ALSA will use +DefaultDependencies=no +After=tmp.target +Wants=tmp.target + +[Service] +Type=oneshot +ExecStart=/opt/openslx/scripts/alsa-default_card +RemainAfterExit=yes + diff --git a/core/modules/alsa/data/etc/systemd/system/multi-user.target.wants/alsa-default-card.service b/core/modules/alsa/data/etc/systemd/system/multi-user.target.wants/alsa-default-card.service new file mode 120000 index 00000000..55e393fd --- /dev/null +++ b/core/modules/alsa/data/etc/systemd/system/multi-user.target.wants/alsa-default-card.service @@ -0,0 +1 @@ +../alsa-default-card.service \ No newline at end of file diff --git a/core/modules/alsa/data/opt/openslx/scripts/alsa-default_card b/core/modules/alsa/data/opt/openslx/scripts/alsa-default_card new file mode 100755 index 00000000..214a4d73 --- /dev/null +++ b/core/modules/alsa/data/opt/openslx/scripts/alsa-default_card @@ -0,0 +1,42 @@ +#!/bin/ash +PATH=$PATH:/opt/openslx/sbin:/opt/openslx/bin + +PROC="/proc/asound/cards" + +if [ ! -r "$PROC" ]; then + echo "'${PROC}' not found or not readable." + exit 1 +fi + +if [ -w "/etc" ]; then + FILE="/etc/asound.conf" +elif [ -n "$HOME" ]; then + FILE="${HOME}/.asoundrc" +else + FILE="$(getent passwd root | awk -F ':' '{print $6}')/.asoundrc" +fi + +if [ -e "${FILE}" -a "x$1" != "x--force" ]; then + echo "'${FILE}' already exists, use --force to overwrite." + exit 1 +fi + +# Try to filter HDMI cards first +CARD=$(grep -v -i 'HDMI' "${PROC}" | grep -E -o '^[[:space:]]*[0-9]+[[:space:]]+' | head -n 1) +# If empty, try again with all +[ -z "${CARD}" ] && CARD=$(cat "${PROC}" | grep -E -o '^[[:space:]]*[0-9]+[[:space:]]+' | head -n 1) + +if [ -z "${CARD}" ]; then + echo "No sound card found." + exit 1 +fi + +cat > "${FILE}" <> "$COPYLIST" + tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" + +} + +post_copy() { + : +} diff --git a/core/modules/alsa/module.conf b/core/modules/alsa/module.conf new file mode 100644 index 00000000..2a8be7a1 --- /dev/null +++ b/core/modules/alsa/module.conf @@ -0,0 +1,8 @@ +REQUIRED_BINARIES=" + amixer + alsamixer +" +REQUIRED_DIRECTORIES=" /usr/share/alsa + /etc/modprobe.d +" + diff --git a/core/modules/alsa/module.conf.debian b/core/modules/alsa/module.conf.debian new file mode 100644 index 00000000..5f4d1283 --- /dev/null +++ b/core/modules/alsa/module.conf.debian @@ -0,0 +1,10 @@ +REQUIRED_INSTALLED_PACKAGES=" + alsa-utils + alsa-base + libasound2 +" +REQUIRED_CONTENT_PACKAGES=" + alsa-utils + alsa-base + libasound2 +" diff --git a/core/modules/alsa/module.conf.fedora b/core/modules/alsa/module.conf.fedora new file mode 100644 index 00000000..4ea213db --- /dev/null +++ b/core/modules/alsa/module.conf.fedora @@ -0,0 +1,13 @@ +REQUIRED_INSTALLED_PACKAGES=" + alsa-utils + alsa-lib +" +REQUIRED_CONTENT_PACKAGES=" + alsa-utils + alsa-lib +" +REQUIRED_DIRECTORIES=" + /usr/share/alsa +" + +# libasound2 diff --git a/core/modules/alsa/module.conf.opensuse b/core/modules/alsa/module.conf.opensuse new file mode 100644 index 00000000..a9ba1d50 --- /dev/null +++ b/core/modules/alsa/module.conf.opensuse @@ -0,0 +1,10 @@ +REQUIRED_CONTENT_PACKAGES=" + alsa-utils + alsa + libasound2 +" +REQUIRED_INSTALLED_PACKAGES=" + alsa-utils + alsa + libasound2 +" diff --git a/core/modules/alsa/module.conf.scientific b/core/modules/alsa/module.conf.scientific new file mode 100644 index 00000000..643e52d3 --- /dev/null +++ b/core/modules/alsa/module.conf.scientific @@ -0,0 +1,12 @@ +REQUIRED_INSTALLED_PACKAGES=" + module-init-tools + alsa-utils + alsa-lib +" +REQUIRED_CONTENT_PACKAGES=" + module-init-tools + alsa-utils + alsa-lib +" + +# libasound2 diff --git a/core/modules/alsa/module.conf.ubuntu b/core/modules/alsa/module.conf.ubuntu new file mode 100644 index 00000000..c07957ab --- /dev/null +++ b/core/modules/alsa/module.conf.ubuntu @@ -0,0 +1,7 @@ +REQUIRED_CONTENT_PACKAGES=" + alsa-utils + alsa-base + libasound2 + libasound2-data + libasound2-plugins +" diff --git a/core/modules/alsa/module.conf.ubuntu.12 b/core/modules/alsa/module.conf.ubuntu.12 new file mode 100644 index 00000000..2eb57b3d --- /dev/null +++ b/core/modules/alsa/module.conf.ubuntu.12 @@ -0,0 +1,6 @@ +REQUIRED_CONTENT_PACKAGES=" + alsa-utils + alsa-base + libasound2 + libasound2-plugins +" -- cgit v1.2.3-55-g7522