summaryrefslogtreecommitdiff
path: root/src/udev/udev-rules.c
diff options
context:
space:
mode:
authorIan Stakenvicius <axs@gentoo.org>2012-12-12 09:00:10 -0500
committerAnthony G. Basile <blueness@gentoo.org>2012-12-12 09:56:16 -0500
commit036bc1a9509f5cf495817bc33624b8a4069e9f9f (patch)
tree8d6f2001e95e6b71e3bdce848870c5ab8ae0645c /src/udev/udev-rules.c
parent7f14ef6bb1ef188213a310c1a568ff1b6f7a6b32 (diff)
Changed --enable-split-usr to add hard-coded paths for rules etc in both / and /usr
This is necessary because the code originally defined paths assuming UDEV_LIBEXECDIR was /usr prefixed, and also that udevrulesdir was located in /etc. Since (1) both of these defaults have changed, and (2) they could be set to more or less anything, we want to ensure that there is support for the standard paths as well, irrespective of what UDEV_LIBEXECDIR and UDEV_RULES_DIR are set to. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udev-rules.c')
-rw-r--r--src/udev/udev-rules.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index 0611c1d6fa..55d9ba9a8a 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -1600,11 +1600,28 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names)
if (!rules->strbuf)
return udev_rules_unref(rules);
- rules->dirs = strv_new(UDEV_RULES_DIR,
+ /* Note - need a better way to manage these paths:
+ * ie, should have a list of paths we always support, and
+ * do not include the #define vars if they are duplicates
+ *
+ * original - UDEV_RULES_DIR should be /etc/udev/rules.d
+ * ..but we have it set to UDEV_LIBEXEC_DIR "/rules.d" so that
+ * ..the default rules are installed there instead of in /etc
+ *
+ * original2 - UDEV_LIBEXEC_DIR used to be forced to /usr/lib/udev
+ * ..by default, we have it as /lib/udev (or whatever rootlibdir is)
+ * ..therefore we did not include /usr/lib/udev/rules.d.
+ *
+ * Reworked code; there are duplicate paths here but at least
+ * everyting is listed.
+ */
+ rules->dirs = strv_new(UDEV_CONF_DIR "/rules.d",
+ UDEV_RULES_DIR,
"/run/udev/rules.d",
UDEV_LIBEXEC_DIR "/rules.d",
#ifdef HAVE_SPLIT_USR
"/lib/udev/rules.d",
+ "/usr/lib/udev/rules.d",
#endif
NULL);
if (!rules->dirs) {