Patchwork [3/3] alsa: Added audio group support.

login
register
mail settings
Submitter Kim Bøndergaard
Date Sept. 19, 2013, 1:39 p.m.
Message ID <5869716a7cd64a5e37890ab6893c261e656cbd84.1379597807.git.kibo@prevas.dk>
Download mbox | patch
Permalink /patch/275972/
State New
Delegated to: Christian Sørensen
Headers show

Comments

Kim Bøndergaard - Sept. 19, 2013, 1:39 p.m.
---
 recipes/alsa/alsa-lib.inc    | 17 ++++++++++++++++-
 recipes/alsa/files/group     |  1 +
 recipes/alsa/files/mdev.conf | 10 +++++-----
 recipes/alsa/files/passwd    |  0
 4 files changed, 22 insertions(+), 6 deletions(-)
 create mode 100644 recipes/alsa/files/group
 create mode 100644 recipes/alsa/files/passwd

diff --git a/recipes/alsa/files/passwd b/recipes/alsa/files/passwd
new file mode 100644
index 0000000..e69de29

Patch

diff --git a/recipes/alsa/alsa-lib.inc b/recipes/alsa/alsa-lib.inc
index ca9796f..856490b 100644
--- a/recipes/alsa/alsa-lib.inc
+++ b/recipes/alsa/alsa-lib.inc
@@ -2,10 +2,12 @@  DEPENDS += "libdl \
 			libpthread \
 			libm"
 
-inherit autotools-autoreconf pkgconfig mdev
+inherit autotools-autoreconf pkgconfig mdev passwd
 
 SRC_URI = "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-${PV}.tar.bz2 \
 file://mdev.conf \
+file://group \
+file://passwd \
 "
 
 EXTRA_OECONF = "--with-cards=pdaudiocf --with-oss=yes --disable-python"
@@ -50,3 +52,16 @@  libm \
 libdl \
 libc \
 "
+
+RECIPE_FLAGS += "alsa_audio_users"
+DEFAULT_alsa_audio_users = ""
+
+DO_PATCH_UPDATE_AUDIO_GROUP = ""
+DO_PATCH_UPDATE_AUDIO_GROUP:USE_alsa_audio_users = "do_patch_update_audio_group"
+
+do_patch[postfuncs] += "${DO_PATCH_UPDATE_AUDIO_GROUP}"
+do_patch_update_audio_group[expand] = "3"
+do_patch_update_audio_group() {
+	sed -i -e 's/^\(audio:x:102:\).*/\1${USE_alsa_audio_users}/'   \
+		${SRCDIR}/group
+}
diff --git a/recipes/alsa/files/group b/recipes/alsa/files/group
new file mode 100644
index 0000000..78f5bc8
--- /dev/null
+++ b/recipes/alsa/files/group
@@ -0,0 +1 @@ 
+audio:x:102:
diff --git a/recipes/alsa/files/mdev.conf b/recipes/alsa/files/mdev.conf
index 9bd2623..3f027a7 100644
--- a/recipes/alsa/files/mdev.conf
+++ b/recipes/alsa/files/mdev.conf
@@ -1,6 +1,6 @@ 
 # Alsa
-pcm.*		0:0 660 =snd/
-control.*	0:0 660 =snd/
-midi.*		0:0 660 =snd/
-seq			0:0 660 =snd/
-timer		0:0 660 =snd/
+pcm.*		0:audio 660 =snd/
+control.*	0:audio 660 =snd/
+midi.*		0:audio 660 =snd/
+seq		0:audio 660 =snd/
+timer		0:audio 660 =snd/