Skip to content

Commit 4f12d0a

Browse files
committed
contrib: add example rules script
1 parent 3026c4e commit 4f12d0a

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33

44
PREFIX = /usr/local
55
LIBDIR = ${PREFIX}/lib
6+
LIBEXECDIR = ${PREFIX}/libexec
67
INCLUDEDIR = ${PREFIX}/include
78
PKGCONFIGDIR = ${LIBDIR}/pkgconfig
89
XCFLAGS = ${CPPFLAGS} ${CFLAGS} -std=c99 -fPIC -D_XOPEN_SOURCE=700 \
910
-Wall -Wextra -Wpedantic -Wmissing-prototypes -Wstrict-prototypes \
10-
-Wno-unused-parameter
11+
-Wno-unused-parameter \
12+
-DRULES_HELPER_PATH=\"${LIBEXECDIR}/libudev-zero-rules-helper\"
1113
XLDFLAGS = ${LDFLAGS} -shared -Wl,-soname,libudev.so.1
1214
XARFLAGS = -rc
1315
AR = ar
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh -e
2+
3+
if [ "$SUBSYSTEM" = "sound" ]
4+
then
5+
if printf '%s' "$SYSNAME" | grep '^card' > /dev/null
6+
then
7+
printf 'SOUND_INITIALIZED=1\n'
8+
fi
9+
10+
if printf '%s' "$SYSNAME" | grep '^pcmC.*D2c$' > /dev/null \
11+
&& grep '^AppleJ' "$SYSPATH/device/id" 2>/dev/null
12+
then
13+
printf 'ACP_IGNORE=1\n'
14+
fi
15+
fi

udev_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#endif
5656

5757
#ifndef RULES_HELPER_PATH
58-
#define RULES_HELPER_PATH "/sbin/libudev-zero-rules-helper"
58+
#error "RULES_HELPER_PATH not specified"
5959
#endif
6060

6161
#ifndef UEVENT_NUM_ENVP

0 commit comments

Comments
 (0)