Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / patches / eudev-rules-directory.patch
1 Add $EUDEV_RULES_DIRECTORY to the list of rules directories.
2
3 The old udev 182 supported $UDEV_CONFIG_FILE, which in turn allowed
4 the search path to be customized, but eudev no longer has this, hence
5 this hack.
6
7 --- eudev-1.9/src/udev/udev-rules.c 2014-09-13 10:21:59.615980259 +0200
8 +++ eudev-1.9/src/udev/udev-rules.c 2014-09-13 10:24:13.839976335 +0200
9 @@ -46,15 +46,11 @@
10 };
11 };
12
13 -static const char* const rules_dirs[] = {
14 +static const char* rules_dirs[] = {
15 UDEV_CONF_DIR "/rules.d",
16 UDEV_RULES_DIR,
17 - "/run/udev/rules.d",
18 UDEV_LIBEXEC_DIR "/rules.d",
19 -#ifdef HAVE_SPLIT_USR
20 - "/lib/udev/rules.d",
21 - "/usr/lib/udev/rules.d",
22 -#endif
23 + NULL, /* placeholder for $EUDEV_RULES_DIRECTORY */
24 NULL};
25
26 struct udev_rules {
27 @@ -1637,6 +1633,9 @@
28
29 udev_rules_check_timestamp(rules);
30
31 + /* Allow the user to specify an additional rules directory. */
32 + rules_dirs[3] = getenv("EUDEV_RULES_DIRECTORY");
33 +
34 r = conf_files_list_strv(&files, ".rules", NULL, rules_dirs);
35 if (r < 0) {
36 log_error("failed to enumerate rules files: %s", strerror(-r));