/udevadm
/udevd
/v4l_id
+/test-libudev
+/test-udev
DISTCHECK_HOOKS =
DISTCLEAN_LOCAL_HOOKS =
pkginclude_HEADERS =
+noinst_LTLIBRARIES =
lib_LTLIBRARIES =
include_HEADERS =
pkgconfiglib_DATA =
$(MANPAGES_ALIAS)
# ------------------------------------------------------------------------------
-noinst_LTLIBRARIES = \
- libsystemd-basic.la \
- libsystemd-capability.la \
- libsystemd-audit.la \
- libsystemd-acl.la \
- libsystemd-core.la
+noinst_LTLIBRARIES += \
+ libsystemd-basic.la
libsystemd_basic_la_SOURCES = \
src/shared/util.c \
$(SELINUX_LIBS)
# ------------------------------------------------------------------------------
+noinst_LTLIBRARIES += \
+ libsystemd-capability.la
+
libsystemd_capability_la_SOURCES = \
src/shared/capability.c \
src/shared/capability.h
$(CAP_LIBS)
# ------------------------------------------------------------------------------
+noinst_LTLIBRARIES += \
+ libsystemd-audit.la
+
libsystemd_audit_la_SOURCES = \
src/shared/audit.c \
src/shared/audit.h
libsystemd-capability.la
# ------------------------------------------------------------------------------
+noinst_LTLIBRARIES += \
+ libsystemd-acl.la
+
libsystemd_acl_la_SOURCES = \
src/shared/acl.c \
src/shared/acl.h
$(ACL_LIBS)
# ------------------------------------------------------------------------------
+noinst_LTLIBRARIES += \
+ libsystemd-core.la
+
libsystemd_core_la_SOURCES = \
src/unit.c \
src/unit.h \
lib_LTLIBRARIES += \
libudev.la
-noinst_LTLIBRARIES += \
- libudev-private.la
-
libudev_la_SOURCES =\
src/udev/libudev-private.h \
src/udev/libudev.c \
src/udev/libudev-monitor.c \
src/udev/libudev-queue.c
+libudev_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ -fvisibility=hidden
+
libudev_la_LDFLAGS = \
$(AM_LDFLAGS) \
-version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE)
-libudev_private_la_SOURCES =\
- $(libudev_la_SOURCES) \
- src/udev/libudev-util-private.c \
- src/udev/libudev-device-private.c \
- src/udev/libudev-queue-private.c
-
-if HAVE_SELINUX
-libudev_private_la_SOURCES +=\
- src/udev/libudev-selinux-private.c
-endif
-
-libudev_private_la_LIBADD = \
- $(SELINUX_LIBS)
-
pkgconfiglib_DATA += \
src/udev/libudev.pc
INSTALL_EXEC_HOOKS += libudev-install-move-hook
UNINSTALL_EXEC_HOOKS += libudev-uninstall-move-hook
+# ------------------------------------------------------------------------------
+noinst_LTLIBRARIES += \
+ libudev-private.la
+
+libudev_private_la_SOURCES =\
+ $(libudev_la_SOURCES) \
+ src/udev/libudev-util-private.c \
+ src/udev/libudev-device-private.c \
+ src/udev/libudev-queue-private.c
+
+libudev_private_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ -fvisibility=default
+
+if HAVE_SELINUX
+libudev_private_la_SOURCES +=\
+ src/udev/libudev-selinux-private.c
+
+libudev_private_la_LIBADD = \
+ $(SELINUX_LIBS)
+endif
+
# ------------------------------------------------------------------------------
udev-confdirs:
-mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d
udevlibexec_PROGRAMS = \
udevd
-udev_common_sources = \
+noinst_LTLIBRARIES += \
+ libudev-core.la
+
+libudev_core_la_SOURCES = \
src/udev/udev.h \
src/udev/udev-event.c \
src/udev/udev-watch.c \
src/udev/udev-builtin-input_id.c \
src/udev/udev-builtin-kmod.c \
src/udev/udev-builtin-path_id.c \
- src/udev/udev-builtin-usb_id.c \
- src/systemd/sd-daemon.h \
- src/sd-daemon.c
+ src/udev/udev-builtin-usb_id.c
-udev_common_CFLAGS = \
+libudev_core_la_CFLAGS = \
$(AM_CFLAGS) \
$(BLKID_CFLAGS) \
$(KMOD_CFLAGS)
-udev_common_LDADD = \
+libudev_core_la_LIBADD = \
libudev-private.la \
+ libsystemd-daemon.la \
$(BLKID_LIBS) \
$(KMOD_LIBS)
-udev_common_CPPFLAGS = \
+libudev_core_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DFIRMWARE_PATH="$(FIRMWARE_PATH)" \
-DUSB_DATABASE=\"$(USB_DATABASE)\" -DPCI_DATABASE=\"$(PCI_DATABASE)\"
if HAVE_ACL
-udev_common_sources += \
+libudev_core_la_SOURCES += \
src/udev/udev-builtin-uaccess.c \
src/login/logind-acl.c
-udev_common_LDADD += \
+libudev_core_la_LIBADD += \
libsystemd-login.la \
libsystemd-acl.la
endif
udevd_SOURCES = \
- $(udev_common_sources) \
src/udev/udevd.c
-udevd_CFLAGS = \
- $(udev_common_CFLAGS)
-
udevd_LDADD = \
- $(udev_common_LDADD) \
- libsystemd-basic.la
-
-udevd_CPPFLAGS = \
- $(udev_common_CPPFLAGS)
+ libudev-core.la \
+ libsystemd-basic.la \
+ libsystemd-daemon.la
udevadm_SOURCES = \
- $(udev_common_sources) \
src/udev/udevadm.c \
src/udev/udevadm-info.c \
src/udev/udevadm-control.c \
src/udev/udevadm-test.c \
src/udev/udevadm-test-builtin.c
-udevadm_CFLAGS = \
- $(udev_common_CFLAGS)
-
udevadm_LDADD = \
- $(udev_common_LDADD) \
- libsystemd-basic.la
-
-udevadm_CPPFLAGS = \
- $(udev_common_CPPFLAGS)
+ libudev-core.la \
+ libudev-private.la \
+ libsystemd-basic.la \
+ libsystemd-daemon.la
# ------------------------------------------------------------------------------
TESTS = \
libudev.la
test_udev_SOURCES = \
- $(udev_common_sources) \
src/udev/test-udev.c
-test_udev_CFLAGS = \
- $(udev_common_CFLAGS)
-
test_udev_LDADD = \
- $(udev_common_LDADD) \
+ libudev-core.la \
+ libudev-private.la \
libsystemd-basic.la
-test_udev_CPPFLAGS = \
- $(udev_common_CPPFLAGS)
-
test_udev_DEPENDENCIES = \
src/udev/test/sys
src/udev/cdrom_id/cdrom_id.c
cdrom_id_LDADD = \
- libudev-private.la \
+ libudev.la \
libsystemd-basic.la
udevlibexec_PROGRAMS += \
src/udev/v4l_id/v4l_id.c
v4l_id_LDADD = \
- libudev-private.la
+ libudev.la
udevlibexec_PROGRAMS += \
v4l_id
src/udev/accelerometer/accelerometer.c
accelerometer_LDADD = \
- libudev-private.la -lm \
+ libudev.la -lm \
libsystemd-basic.la
udevlibexec_PROGRAMS += \
static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool test)
{
- struct udev *udev = udev_device_get_udev(dev);
int64_t offset = 0;
bool noraid = false;
int fd = -1;
#define LONG(x) ((x)/BITS_PER_LONG)
#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
/*
* Read a capability attribute and return bitmask.
* @param dev udev_device
unsigned long *bitmask, size_t bitmask_size,
bool test)
{
- struct udev *udev = udev_device_get_udev(dev);
char text[4096];
unsigned i;
char* word;
log_debug(text, i * BITS_PER_LONG, bitmask[i]);
}
}
+#pragma GCC diagnostic pop
/* pointer devices */
static void test_pointers (struct udev_device *dev,
const unsigned long* bitmask_key,
bool test)
{
- struct udev *udev = udev_device_get_udev(dev);
unsigned i;
unsigned long found;
unsigned long mask;
static void set_usb_iftype(char *to, int if_class_num, size_t len)
{
- char *type = "generic";
+ const char *type = "generic";
switch (if_class_num) {
case 1:
{
int type_num = 0;
char *eptr;
- char *type = "generic";
+ const char *type = "generic";
type_num = strtoul(from, &eptr, 0);
if (eptr != from) {
{
int type_num;
char *eptr;
- char *type = "generic";
+ const char *type = "generic";
type_num = strtoul(from, &eptr, 0);
if (eptr != from) {
const char *driver = NULL;
char serial[256];
- struct udev *udev = udev_device_get_udev(dev);
struct udev_device *dev_interface = NULL;
struct udev_device *dev_usb = NULL;
const char *if_class, *if_subclass;
struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn)
{
- struct udev *udev = conn->uctrl->udev;
struct udev_ctrl_msg *uctrl_msg;
ssize_t size;
struct msghdr smsg;
SUBST_SYS,
};
static const struct subst_map {
- char *name;
- char fmt;
+ const char *name;
+ const char fmt;
enum subst_type type;
} map[] = {
{ .name = "devnode", .fmt = 'N', .type = SUBST_DEVNODE },
const char *cmd, char *const argv[], char **envp, const sigset_t *sigmask,
int fd_stdout, int fd_stderr)
{
- struct udev *udev = event->udev;
int err;
int fd;
int fd_stdout, int fd_stderr,
char *result, size_t ressize)
{
- struct udev *udev = event->udev;
size_t respos = 0;
int fd_ep = -1;
struct epoll_event ep_outpipe, ep_errpipe;
static int spawn_wait(struct udev_event *event, const char *cmd, pid_t pid)
{
- struct udev *udev = event->udev;
struct pollfd pfd[1];
int err = 0;
udev_device_unref(event->dev_db);
event->dev_db = NULL;
}
-out:
return err;
}
void udev_node_update_old_links(struct udev_device *dev, struct udev_device *dev_old)
{
- struct udev *udev = udev_device_get_udev(dev);
struct udev_list_entry *list_entry;
/* update possible left-over symlinks */
struct udev *udev = udev_device_get_udev(dev);
char filename[UTIL_PATH_SIZE];
struct udev_list_entry *list_entry;
- int err = 0;
log_debug("handling device node '%s', devnum=%s, mode=%#o, uid=%d, gid=%d\n",
udev_device_get_devnode(dev), udev_device_get_id_filename(dev), mode, uid, gid);
{
struct udev *udev = udev_device_get_udev(dev);
struct udev_list_entry *list_entry;
- const char *devnode;
- struct stat stats;
- struct udev_device *dev_check;
char filename[UTIL_PATH_SIZE];
/* remove/update symlinks, remove symlinks from name index */
static int import_parent_into_properties(struct udev_device *dev, const char *filter)
{
- struct udev *udev = udev_device_get_udev(dev);
struct udev_device *dev_parent;
struct udev_list_entry *list_entry;
}
/* extract possible KEY{attr} */
-static char *get_key_attribute(struct udev *udev, char *str)
+static const char *get_key_attribute(struct udev *udev, char *str)
{
char *pos;
char *attr;
const char *filename, unsigned int filename_off, unsigned int lineno)
{
char *linepos;
- char *attr;
+ const char *attr;
struct rule_tmp rule_tmp;
memset(&rule_tmp, 0x00, sizeof(struct rule_tmp));
static void print_all_attributes(struct udev_device *device, const char *key)
{
- struct udev *udev = udev_device_get_udev(device);
struct udev_list_entry *sysattr;
udev_list_entry_foreach(sysattr, udev_device_get_sysattr_list_entry(device)) {
static void exec_list(struct udev_enumerate *udev_enumerate, const char *action)
{
- struct udev *udev = udev_enumerate_get_udev(udev_enumerate);
struct udev_list_entry *entry;
udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(udev_enumerate)) {
static void static_dev_create_links(struct udev *udev)
{
DIR *dir;
-
- dir = opendir(udev_get_dev_path(udev));
- if (dir == NULL)
- return;
-
struct stdlinks {
const char *link;
const char *target;
};
unsigned int i;
+ dir = opendir(udev_get_dev_path(udev));
+ if (dir == NULL)
+ return;
+
for (i = 0; i < ARRAY_SIZE(stdlinks); i++) {
struct stat sb;
int fd_worker = -1;
struct epoll_event ep_ctrl, ep_inotify, ep_signal, ep_netlink, ep_worker;
struct udev_ctrl_connection *ctrl_conn = NULL;
- char **s;
int rc = 1;
udev = udev_new();
continue;
if ((now_usec() - worker->event_start_usec) > 30 * 1000 * 1000) {
- log_error("worker [%u] timeout, kill it\n", worker->pid,
+ log_error("worker [%u] %s timeout; kill it\n", worker->pid,
worker->event ? worker->event->devpath : "<idle>");
kill(worker->pid, SIGKILL);
worker->state = WORKER_KILLED;