Merge pull request #37 from lu-zero/master

configure.ac: require C99 and drop excess checks
src/libudev/cgroup-util.c: refacotirze cgroup_path

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Adjust the install path of keymaps to $(libdir)/udev

Since these keymaps are the default reference files they should be
installed in the same location as the default rules files.  This
matches sys-fs/udev behaviour as well
Fixed some comments relating to udevlibexecdir paths

Keymaps rules had stated to add or modify /usr/lib/udev/* files instead
of using generic paths, and there was no mention of /etc/udev/* being valid
even though it is (and is the better way to do system-specific
modifications)
Fix bugs in execv() calls to modprobe

Change the execv() call to an execvp() call so that --with-modprobe="modprobe"
is supported; also added the command as argv[0] in the call to execvp(), which
fixes the failures when 'modprobe' is a symlink to kmod

Signed off by ryao
Added LIBUDEV_196 symbol versioning

systemd-udev-196 added four more functions to their libudev.sym under
the LIBUDEV_196 version; consumers such as udisks use the symbol versions
at link time and so it is absolutely necessary for us to provide the same
symbol versioning and functions in order to provide compatibility.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
The only functional changes in systemd-udev-196

As far as I can tell these are the only functional changes between the current
eudev codebase and the codebase of systemd-196, in relation to udev hwdb code.
There are some code style differences, and a number of error-trap-and-log
lines that are not present, but that's about it

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Bump UDEV_VERSION as libudev is 196 compliant

We haven't confirmed yet that everything is compliant with
196 but libudev is and it seems relevant that udevadm reports
the udev version that provides hwdb functions

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Make binaries report udev version compatibility version instead of eudev version

Software such as dracut performs a sanity check on udev by querying the
udev tools for the version. Reporting the eudev version causes this
check to fail, so we resort to reporting the udev compatibility
versionj.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Correct /dev/null permissions on older kernels

Older kernels rely on udev to set proper permissions on /dev/null.
Commit 378f2e074e38490103f999173bf717a5394170f8 by Kay Sievers removed
the rule that set these permissions, which caused a regression. We
reintroduce that rule to restore compatibility.

Reported-by: Stephen Klimaszewski <steev@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Switch to dup2 from dup3

dup3() was being used in a situation where dup2() would suffice. uclibc
does not support dup3(), so we switch to dup2().

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Comment out sd_is_mq()

sd_is_mq() calls mq_getattr, which requires -lrt on systems using
uclibc. Ordinarily, I would write an autotools check to handle this, but
we do not use this code for anything, so I am commenting it out until a
decision on the fate of this code is made.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>

temp
Make all udev tools dynamically link to libudev.so

Move libudev.so back to $(rootlibdir) for lvm2 support, and have
all udev tools dynamically link to it.  The symbol versioning and
hidden-visibility on libudev were modified accordingly: we rebase
against the public LIBUDEV_196 symbol versioning, and marked all
other symbols (which used to be local) as  LIBUDEV_internal.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Remove the remaining systemd code since it is not needed anymore

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Forward-port of libudev.so.0 code from libudev-171

Add --enable-legacylib option to configure, allowing for build and
installation of libudev.so.0 shared library for supporting pre-udev-183
software.  Library is installed to rootlibdir.

Note that this legacy library will not be maintained, and should not be used
for anything other than supporting a working system until all software
on the system is migrated to use libudev.so.1

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Adjust version in configure.ac for beta2 release

 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
 Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Fall back on POSIX mkstemp() for systems lacking mkostemp()

We add an autotools check to use mkstemp() and fcntl() when mkostemp()
is missing. This is not strictly equivalent because we have no way of
setting the file access mode O_WRONLY flag, but that should produce no
functional difference.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Fix test-udev.c to build and work on a uclibc system

Two issues are addressed: 1) Makefile.am has to provide config.h
information on HAVE_UNSHARE to test-udev.c.  2) MS_PRIVATE and
MS_REC are defined in <linux/fs.h> which must be directly included
on a uclibc system because of different header stackings.  Its
inclusion makes no difference on a glibc system.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Fix --disable-modules config option

This option should be enabled by default, however there was no logic
in AC_ARG_ENABLE to set the variable to be enabled when the flag was
unspecified

Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
src/libudev/util.c: fix typo introduce at commit 1ebf647

The first argument of fcntl should be 'fd', the file descriptor.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Add missing selinux code to udev core (convenience lib)

Original Author: Alexey D. (TZ86)
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>