From 9e0d1d389331652e255294abf7fed79cea2ce5aa Mon Sep 17 00:00:00 2001 From: Alexey Gladkov Date: Tue, 2 Oct 2018 12:39:52 +0300 Subject: Rename udev* to eudev* Signed-off-by: Alexey Gladkov --- configure.ac | 4 ++-- rules/64-btrfs.rules.in | 2 +- src/collect/collect.c | 2 +- src/libudev/Makefile.am | 16 +++++++-------- src/libudev/libudev-device-private.c | 6 +++--- src/libudev/libudev-device.c | 2 +- src/libudev/libudev-enumerate.c | 2 +- src/libudev/libudev-hwdb.c | 2 +- src/libudev/libudev-monitor.c | 2 +- src/libudev/libudev-queue.c | 6 +++--- src/libudev/libudev.c | 2 +- src/libudev/libudev.pc.in | 2 +- src/udev/Makefile.am | 6 ++++-- src/udev/udev-ctrl.c | 2 +- src/udev/udev-event.c | 4 ++-- src/udev/udev-node.c | 2 +- src/udev/udev-rules.c | 11 +++++----- src/udev/udev-watch.c | 16 +++++++-------- src/udev/udevadm-hwdb.c | 2 ++ src/udev/udevadm-info.c | 12 +++++------ src/udev/udevd.c | 30 ++++++++++++++++++---------- 21 files changed, 73 insertions(+), 60 deletions(-) diff --git a/configure.ac b/configure.ac index 508ec4b86..e92b1a398 100644 --- a/configure.ac +++ b/configure.ac @@ -135,7 +135,7 @@ AC_ARG_WITH( [--with-rootlibexecdir=DIR], [Root directory for libexecs necessary for boot])], [], - [with_rootlibexecdir=${with_rootlibdir}/udev] + [with_rootlibexecdir=${with_rootlibdir}/eudev] ) AC_ARG_WITH( @@ -171,7 +171,7 @@ AC_SUBST([rootlibexecdir], [${with_rootlibexecdir}]) AC_SUBST([udevlibexecdir], [${rootlibexecdir}]) # sysconfdir paths -AC_SUBST([udevconfdir],[${sysconfdir}/udev]) +AC_SUBST([udevconfdir],[${sysconfdir}/eudev]) AC_SUBST([udevconffile],[${udevconfdir}/udev.conf]) AC_SUBST([udevhwdbdir],[${udevconfdir}/hwdb.d]) AC_SUBST([udevhwdbbin],[${udevconfdir}/hwdb.bin]) diff --git a/rules/64-btrfs.rules.in b/rules/64-btrfs.rules.in index e10919b96..932ddd45d 100644 --- a/rules/64-btrfs.rules.in +++ b/rules/64-btrfs.rules.in @@ -11,6 +11,6 @@ IMPORT{builtin}="btrfs ready $devnode" ENV{ID_BTRFS_READY}=="0", ENV{SYSTEMD_READY}="0" # reconsider pending devices in case when multidevice volume awaits -ENV{ID_BTRFS_READY}=="1", RUN+="@bindir@/udevadm trigger -s block -p ID_BTRFS_READY=0" +ENV{ID_BTRFS_READY}=="1", RUN+="@bindir@/eudevadm trigger -s block -p ID_BTRFS_READY=0" LABEL="btrfs_end" diff --git a/src/collect/collect.c b/src/collect/collect.c index 2cf1f0054..8071e06b3 100644 --- a/src/collect/collect.c +++ b/src/collect/collect.c @@ -422,7 +422,7 @@ int main(int argc, char **argv) if (debug) fprintf(stderr, "Using checkpoint '%s'\n", checkpoint); - strscpyl(tmpdir, sizeof(tmpdir), UDEV_ROOT_RUN "/udev/collect", NULL); + strscpyl(tmpdir, sizeof(tmpdir), UDEV_ROOT_RUN "/eudev/collect", NULL); fd = prepare(tmpdir, checkpoint); if (fd < 0) { ret = 3; diff --git a/src/libudev/Makefile.am b/src/libudev/Makefile.am index d069956b3..a3a81d837 100644 --- a/src/libudev/Makefile.am +++ b/src/libudev/Makefile.am @@ -13,9 +13,9 @@ AM_CPPFLAGS = \ -I $(top_srcdir)/src/shared lib_LTLIBRARIES = \ - libudev.la + libeudev.la -libudev_la_SOURCES =\ +libeudev_la_SOURCES =\ libudev.sym \ libudev-private.h \ libudev.c \ @@ -28,7 +28,7 @@ libudev_la_SOURCES =\ libudev-hwdb-def.h \ libudev-hwdb.c -libudev_la_CFLAGS = \ +libeudev_la_CFLAGS = \ $(AM_CFLAGS) \ -fvisibility=hidden @@ -39,17 +39,17 @@ noinst_HEADERS = \ include_HEADERS = \ libudev.h -libudev_la_LDFLAGS = \ +libeudev_la_LDFLAGS = \ $(AM_LDFLAGS) \ -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \ -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym -libudev_la_LIBADD = \ +libeudev_la_LIBADD = \ $(top_builddir)/src/shared/libudev_shared.la \ $(SELINUX_LIBS) libudev_private_la_SOURCES = \ - $(libudev_la_SOURCES) \ + $(libeudev_la_SOURCES) \ libudev-device-private.c libudev_private_la_CFLAGS = \ @@ -70,7 +70,7 @@ CLEANFILES = \ libudev.pc install-exec-hook: - libname=libudev.so; if test "$(libdir)" != "$(rootlibdir)"; then \ + libname=libeudev.so; if test "$(libdir)" != "$(rootlibdir)"; then \ $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \ so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \ so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\)\?[^/]\+,..,g') && \ @@ -80,4 +80,4 @@ install-exec-hook: uninstall-hook: - rm -f $(DESTDIR)$(rootlibdir)/libudev.so* + rm -f $(DESTDIR)$(rootlibdir)/libeudev.so* diff --git a/src/libudev/libudev-device-private.c b/src/libudev/libudev-device-private.c index e1ddac478..2f0b3736b 100644 --- a/src/libudev/libudev-device-private.c +++ b/src/libudev/libudev-device-private.c @@ -38,7 +38,7 @@ static void udev_device_tag(struct udev_device *dev, const char *tag, bool add) id = udev_device_get_id_filename(dev); if (id == NULL) return; - strscpyl(filename, sizeof(filename), UDEV_ROOT_RUN "/udev/tags/", tag, "/", id, NULL); + strscpyl(filename, sizeof(filename), UDEV_ROOT_RUN "/eudev/tags/", tag, "/", id, NULL); if (add) { int fd; @@ -115,7 +115,7 @@ int udev_device_update_db(struct udev_device *udev_device) return -1; has_info = device_has_info(udev_device); - strscpyl(filename, sizeof(filename), UDEV_ROOT_RUN "/udev/data/", id, NULL); + strscpyl(filename, sizeof(filename), UDEV_ROOT_RUN "/eudev/data/", id, NULL); /* do not store anything for otherwise empty devices */ if (!has_info && @@ -183,7 +183,7 @@ int udev_device_delete_db(struct udev_device *udev_device) id = udev_device_get_id_filename(udev_device); if (id == NULL) return -1; - strscpyl(filename, sizeof(filename), UDEV_ROOT_RUN "/udev/data/", id, NULL); + strscpyl(filename, sizeof(filename), UDEV_ROOT_RUN "/eudev/data/", id, NULL); unlink(filename); return 0; diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c index ac67ce846..ab1af057a 100644 --- a/src/libudev/libudev-device.c +++ b/src/libudev/libudev-device.c @@ -610,7 +610,7 @@ int udev_device_read_db(struct udev_device *udev_device) if (id == NULL) return -1; - strscpyl(filename, sizeof(filename), UDEV_ROOT_RUN "/udev/data/", id, NULL); + strscpyl(filename, sizeof(filename), UDEV_ROOT_RUN "/eudev/data/", id, NULL); f = fopen(filename, "re"); if (f == NULL) diff --git a/src/libudev/libudev-enumerate.c b/src/libudev/libudev-enumerate.c index 2a647a7b7..254546dca 100644 --- a/src/libudev/libudev-enumerate.c +++ b/src/libudev/libudev-enumerate.c @@ -798,7 +798,7 @@ static int scan_devices_tags(struct udev_enumerate *udev_enumerate) struct dirent *dent; char path[UTIL_PATH_SIZE]; - strscpyl(path, sizeof(path), UDEV_ROOT_RUN "/udev/tags/", udev_list_entry_get_name(list_entry), NULL); + strscpyl(path, sizeof(path), UDEV_ROOT_RUN "/eudev/tags/", udev_list_entry_get_name(list_entry), NULL); dir = opendir(path); if (dir == NULL) continue; diff --git a/src/libudev/libudev-hwdb.c b/src/libudev/libudev-hwdb.c index 951205cb2..d9f3e2176 100644 --- a/src/libudev/libudev-hwdb.c +++ b/src/libudev/libudev-hwdb.c @@ -358,7 +358,7 @@ bool udev_hwdb_validate(struct udev_hwdb *hwdb) { return false; if (!hwdb->f) return false; - if (stat("/etc/udev/hwdb.bin", &st) < 0) + if (stat("/etc/eudev/hwdb.bin", &st) < 0) return true; if (timespec_load(&hwdb->st.st_mtim) != timespec_load(&st.st_mtim)) diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c index 060ba733f..a6c576977 100644 --- a/src/libudev/libudev-monitor.c +++ b/src/libudev/libudev-monitor.c @@ -186,7 +186,7 @@ struct udev_monitor *udev_monitor_new_from_netlink_fd(struct udev *udev, const c * We do not set a netlink multicast group here, so the socket * will not receive any messages. */ - if (access(UDEV_ROOT_RUN "/udev/control", F_OK) < 0) { + if (access(UDEV_ROOT_RUN "/eudev/control", F_OK) < 0) { log_debug("the udev service seems not to be active, disable the monitor"); group = UDEV_MONITOR_NONE; } else diff --git a/src/libudev/libudev-queue.c b/src/libudev/libudev-queue.c index 9750057c7..1761ab910 100644 --- a/src/libudev/libudev-queue.c +++ b/src/libudev/libudev-queue.c @@ -167,7 +167,7 @@ _public_ unsigned long long int udev_queue_get_udev_seqnum(struct udev_queue *ud **/ _public_ int udev_queue_get_udev_is_active(struct udev_queue *udev_queue) { - return access(UDEV_ROOT_RUN "/udev/control", F_OK) >= 0; + return access(UDEV_ROOT_RUN "/eudev/control", F_OK) >= 0; } /** @@ -180,7 +180,7 @@ _public_ int udev_queue_get_udev_is_active(struct udev_queue *udev_queue) **/ _public_ int udev_queue_get_queue_is_empty(struct udev_queue *udev_queue) { - return access(UDEV_ROOT_RUN "/udev/queue", F_OK) < 0; + return access(UDEV_ROOT_RUN "/eudev/queue", F_OK) < 0; } /** @@ -245,7 +245,7 @@ _public_ int udev_queue_get_fd(struct udev_queue *udev_queue) { if (fd < 0) return -errno; - r = inotify_add_watch(fd, UDEV_ROOT_RUN "/udev" , IN_DELETE); + r = inotify_add_watch(fd, UDEV_ROOT_RUN "/eudev" , IN_DELETE); if (r < 0) { r = -errno; close(fd); diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c index e656b352c..b576f274f 100644 --- a/src/libudev/libudev.c +++ b/src/libudev/libudev.c @@ -168,7 +168,7 @@ _public_ struct udev *udev_new(void) { prio = util_log_priority(val); if (prio < 0) - log_debug("/etc/udev/udev.conf:%u: invalid log level '%s', ignoring.", line_nr, val); + log_debug("/etc/eudev/udev.conf:%u: invalid log level '%s', ignoring.", line_nr, val); else log_set_max_level(prio); continue; diff --git a/src/libudev/libudev.pc.in b/src/libudev/libudev.pc.in index e5aae5ab6..4439a9d4f 100644 --- a/src/libudev/libudev.pc.in +++ b/src/libudev/libudev.pc.in @@ -13,5 +13,5 @@ includedir=@includedir@ Name: libudev Description: Library to access udev device information Version: @UDEV_VERSION@ -Libs: -L${libdir} -ludev +Libs: -L${libdir} -leudev Cflags: -I${includedir} diff --git a/src/udev/Makefile.am b/src/udev/Makefile.am index 9b4917ad9..dab83b53d 100644 --- a/src/udev/Makefile.am +++ b/src/udev/Makefile.am @@ -136,8 +136,10 @@ CLEANFILES += \ # install udevadm symlink in sbindir install-exec-hook: + mv -f -- "$(DESTDIR)$(bindir)/udevadm" "$(DESTDIR)$(bindir)/eudevadm"; + mv -f -- "$(DESTDIR)$(sbindir)/udevd" "$(DESTDIR)$(sbindir)/eudevd"; test "$(bindir)" = "$(sbindir)" || \ - $(LN_S) -n -f $(bindir)/udevadm $(DESTDIR)$(sbindir)/udevadm + $(LN_S) -n -f $(bindir)/eudevadm $(DESTDIR)$(sbindir)/eudevadm uninstall-hook: - rm -Rf $(DESTDIR)$(sbindir)/udevadm + rm -Rf $(DESTDIR)$(sbindir)/eudevadm diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c index 85a13ff75..0d51c2c36 100644 --- a/src/udev/udev-ctrl.c +++ b/src/udev/udev-ctrl.c @@ -99,7 +99,7 @@ struct udev_ctrl *udev_ctrl_new_from_fd(struct udev *udev, int fd) { log_warning_errno(errno, "could not set SO_PASSCRED: %m"); uctrl->saddr.un.sun_family = AF_LOCAL; - strscpy(uctrl->saddr.un.sun_path, sizeof(uctrl->saddr.un.sun_path), UDEV_ROOT_RUN "/udev/control"); + strscpy(uctrl->saddr.un.sun_path, sizeof(uctrl->saddr.un.sun_path), UDEV_ROOT_RUN "/eudev/control"); uctrl->addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(uctrl->saddr.un.sun_path); return uctrl; } diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index 4120c04f2..b1aa94037 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -739,12 +739,12 @@ int udev_event_spawn(struct udev_event *event, /* allow programs in /usr/lib/udev/ to be called without the path */ if (argv[0][0] != '/') { strscpyl(program, sizeof(program), UDEV_LIBEXEC_DIR "/", argv[0], NULL); -#ifdef HAVE_SPLIT_USR + if(access(program, X_OK)) strscpyl(program, sizeof(program), "/usr/lib/udev/", argv[0], NULL); if(access(program, X_OK)) strscpyl(program, sizeof(program), "/lib/udev/", argv[0], NULL); -#endif + argv[0] = program; } diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c index 021051e89..f6185a91f 100644 --- a/src/udev/udev-node.c +++ b/src/udev/udev-node.c @@ -187,7 +187,7 @@ static void link_update(struct udev_device *dev, const char *slink, bool add) { char buf[UTIL_PATH_SIZE]; util_path_encode(slink + strlen("/dev"), name_enc, sizeof(name_enc)); - strscpyl(dirname, sizeof(dirname), UDEV_ROOT_RUN "/udev/links/", name_enc, NULL); + strscpyl(dirname, sizeof(dirname), UDEV_ROOT_RUN "/eudev/links/", name_enc, NULL); strscpyl(filename, sizeof(filename), dirname, "/", udev_device_get_id_filename(dev), NULL); if (!add && unlink(filename) == 0) diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index 766c00b5e..d29aed769 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -51,12 +51,11 @@ struct uid_gid { static const char* const rules_dirs[] = { UDEV_CONF_DIR "/rules.d", UDEV_RULES_DIR, - UDEV_ROOT_RUN "/udev/rules.d", + UDEV_ROOT_RUN "/eudev/rules.d", UDEV_LIBEXEC_DIR "/rules.d", -#ifdef HAVE_SPLIT_USR + "/etc/udev/rules.d", "/lib/udev/rules.d", "/usr/lib/udev/rules.d", -#endif NULL}; struct udev_rules { @@ -2693,7 +2692,7 @@ int udev_rules_apply_static_dev_perms(struct udev_rules *rules) { STRV_FOREACH(t, tags) { _cleanup_free_ char *unescaped_filename = NULL; - strscpyl(tags_dir, sizeof(tags_dir), UDEV_ROOT_RUN "/udev/static_node-tags/", *t, "/", NULL); + strscpyl(tags_dir, sizeof(tags_dir), UDEV_ROOT_RUN "/eudev/static_node-tags/", *t, "/", NULL); r = udev_mkdir_p(tags_dir, 0755); if (r < 0) return log_error_errno(r, "failed to create %s: %m", tags_dir); @@ -2757,9 +2756,9 @@ finish: if (f) { fflush(f); fchmod(fileno(f), 0644); - if (ferror(f) || rename(path, UDEV_ROOT_RUN "/udev/static_node-tags") < 0) { + if (ferror(f) || rename(path, UDEV_ROOT_RUN "/eudev/static_node-tags") < 0) { r = -errno; - unlink(UDEV_ROOT_RUN "/udev/static_node-tags"); + unlink(UDEV_ROOT_RUN "/eudev/static_node-tags"); unlink(path); } fclose(f); diff --git a/src/udev/udev-watch.c b/src/udev/udev-watch.c index b6a0d3e93..50a0a2609 100644 --- a/src/udev/udev-watch.c +++ b/src/udev/udev-watch.c @@ -50,13 +50,13 @@ void udev_watch_restore(struct udev *udev) { if (inotify_fd < 0) return; - if (rename(UDEV_ROOT_RUN "/udev/watch", UDEV_ROOT_RUN "/udev/watch.old") == 0) { + if (rename(UDEV_ROOT_RUN "/eudev/watch", UDEV_ROOT_RUN "/eudev/watch.old") == 0) { DIR *dir; struct dirent *ent; - dir = opendir(UDEV_ROOT_RUN "/udev/watch.old"); + dir = opendir(UDEV_ROOT_RUN "/eudev/watch.old"); if (dir == NULL) { - log_error_errno(errno, "unable to open old watches dir " UDEV_ROOT_RUN "/udev/watch.old; old watches will not be restored: %m"); + log_error_errno(errno, "unable to open old watches dir " UDEV_ROOT_RUN "/eudev/watch.old; old watches will not be restored: %m"); return; } @@ -85,10 +85,10 @@ unlink: } closedir(dir); - rmdir(UDEV_ROOT_RUN "/udev/watch.old"); + rmdir(UDEV_ROOT_RUN "/eudev/watch.old"); } else if (errno != ENOENT) { - log_error_errno(errno, "unable to move watches dir " UDEV_ROOT_RUN "/udev/watch; old watches will not be restored: %m"); + log_error_errno(errno, "unable to move watches dir " UDEV_ROOT_RUN "/eudev/watch; old watches will not be restored: %m"); } } @@ -108,7 +108,7 @@ void udev_watch_begin(struct udev *udev, struct udev_device *dev) { return; } - snprintf(filename, sizeof(filename), UDEV_ROOT_RUN "/udev/watch/%d", wd); + snprintf(filename, sizeof(filename), UDEV_ROOT_RUN "/eudev/watch/%d", wd); mkdir_parents(filename, 0755); unlink(filename); r = symlink(udev_device_get_id_filename(dev), filename); @@ -132,7 +132,7 @@ void udev_watch_end(struct udev *udev, struct udev_device *dev) { log_debug("removing watch on '%s'", udev_device_get_devnode(dev)); inotify_rm_watch(inotify_fd, wd); - snprintf(filename, sizeof(filename), UDEV_ROOT_RUN "/udev/watch/%d", wd); + snprintf(filename, sizeof(filename), UDEV_ROOT_RUN "/eudev/watch/%d", wd); unlink(filename); udev_device_set_watch_handle(dev, -1); @@ -146,7 +146,7 @@ struct udev_device *udev_watch_lookup(struct udev *udev, int wd) { if (inotify_fd < 0 || wd < 0) return NULL; - snprintf(filename, sizeof(filename), UDEV_ROOT_RUN "/udev/watch/%d", wd); + snprintf(filename, sizeof(filename), UDEV_ROOT_RUN "/eudev/watch/%d", wd); len = readlink(filename, device, sizeof(device)); if (len <= 0 || (size_t)len == sizeof(device)) return NULL; diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c index 9df043835..e6e967f4e 100644 --- a/src/udev/udevadm-hwdb.c +++ b/src/udev/udevadm-hwdb.c @@ -38,6 +38,8 @@ static const char * const conf_file_dirs[] = { UDEV_HWDB_DIR, UDEV_LIBEXEC_DIR "/hwdb.d", + "/etc/udev/hwdb.d", + "/lib/udev/hwdb.d", NULL }; diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index 0aec976a3..cc6f37e6f 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -224,33 +224,33 @@ static void cleanup_dir(DIR *dir, mode_t mask, int depth) { static void cleanup_db(struct udev *udev) { DIR *dir; - unlink(UDEV_ROOT_RUN "/udev/queue.bin"); + unlink(UDEV_ROOT_RUN "/eudev/queue.bin"); - dir = opendir(UDEV_ROOT_RUN "/udev/data"); + dir = opendir(UDEV_ROOT_RUN "/eudev/data"); if (dir != NULL) { cleanup_dir(dir, S_ISVTX, 1); closedir(dir); } - dir = opendir(UDEV_ROOT_RUN "/udev/links"); + dir = opendir(UDEV_ROOT_RUN "/eudev/links"); if (dir != NULL) { cleanup_dir(dir, 0, 2); closedir(dir); } - dir = opendir(UDEV_ROOT_RUN "/udev/tags"); + dir = opendir(UDEV_ROOT_RUN "/eudev/tags"); if (dir != NULL) { cleanup_dir(dir, 0, 2); closedir(dir); } - dir = opendir(UDEV_ROOT_RUN "/udev/static_node-tags"); + dir = opendir(UDEV_ROOT_RUN "/eudev/static_node-tags"); if (dir != NULL) { cleanup_dir(dir, 0, 2); closedir(dir); } - dir = opendir(UDEV_ROOT_RUN "/udev/watch"); + dir = opendir(UDEV_ROOT_RUN "/eudev/watch"); if (dir != NULL) { cleanup_dir(dir, 0, 1); closedir(dir); diff --git a/src/udev/udevd.c b/src/udev/udevd.c index cf826c6dc..40d82e937 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -684,13 +684,13 @@ static void event_queue_update(void) { int r; if (!udev_list_node_is_empty(&event_list)) { - r = touch("/run/udev/queue"); + r = touch("/run/eudev/queue"); if (r < 0) - log_warning_errno(r, "could not touch /run/udev/queue: %m"); + log_warning_errno(r, "could not touch /run/eudev/queue: %m"); } else { - r = unlink("/run/udev/queue"); + r = unlink("/run/eudev/queue"); if (r < 0 && errno != ENOENT) - log_warning("could not unlink /run/udev/queue: %m"); + log_warning("could not unlink /run/eudev/queue: %m"); } } @@ -1179,9 +1179,9 @@ int main(int argc, char *argv[]) { udev_list_init(udev, &properties_list, true); - r = mkdir(UDEV_ROOT_RUN "/udev", 0755); + r = mkdir(UDEV_ROOT_RUN "/eudev", 0755); if (r < 0 && errno != EEXIST) { - r = log_error_errno(errno, "could not create " UDEV_ROOT_RUN "/udev: %m"); + r = log_error_errno(errno, "could not create " UDEV_ROOT_RUN "/eudev: %m"); goto exit; } @@ -1308,10 +1308,20 @@ int main(int argc, char *argv[]) { inotify_add_watch(fd_inotify, UDEV_CONF_DIR "/rules.d", IN_DELETE | IN_MOVE | IN_CLOSE_WRITE); - if (access(UDEV_ROOT_RUN "/udev/rules.d", F_OK) < 0) { - udev_mkdir_p(UDEV_ROOT_RUN "/udev/rules.d", 0755); + if (access("/etc/udev/rules.d", F_OK) == 0) { + inotify_add_watch(fd_inotify, "/etc/udev/rules.d", + IN_DELETE | IN_MOVE | IN_CLOSE_WRITE); } - inotify_add_watch(fd_inotify, UDEV_ROOT_RUN "/udev/rules.d", + + if (access("/lib/udev/rules.d", F_OK) == 0) { + inotify_add_watch(fd_inotify, "/lib/udev/rules.d", + IN_DELETE | IN_MOVE | IN_CLOSE_WRITE); + } + + if (access(UDEV_ROOT_RUN "/eudev/rules.d", F_OK) < 0) { + udev_mkdir_p(UDEV_ROOT_RUN "/eudev/rules.d", 0755); + } + inotify_add_watch(fd_inotify, UDEV_ROOT_RUN "/eudev/rules.d", IN_DELETE | IN_MOVE | IN_CLOSE_WRITE); udev_watch_restore(udev); @@ -1547,7 +1557,7 @@ int main(int argc, char *argv[]) { exit: udev_ctrl_cleanup(udev_ctrl); - unlink(UDEV_ROOT_RUN "/udev/queue"); + unlink(UDEV_ROOT_RUN "/eudev/queue"); if (fd_ep >= 0) close(fd_ep); -- 2.25.4