Commit Graph

9759 Commits

Author SHA1 Message Date
Anthony G. Basile
3e501c7b92 src/udev/udevadm-hwdb.c: fix help
This follows upstream commit e32a4e1ef4c61561b08f50f73f82587bdc946b40

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-03-14 16:21:50 -04:00
Matthew Thode
15cad0e19b Merge pull request #51 from gentoo/issue50
Only check for gperf if --enable-keymap

reviewed by me
2013-03-10 12:04:02 -07:00
Anthony G. Basile
489ca457ea Only check for gperf if --enable-keymap
gperf is only used to generate some header file for src/keymap,
and so we should only test for its existence if --enable-keymap
is given.

See:
 https://github.com/gentoo/eudev/issues/50
 https://bugs.gentoo.org/show_bug.cgi?id=452760

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-03-10 14:50:10 -04:00
Richard Yao
5cdd4e3c93 Merge pull request #44 from lu-zero/master
add --root to support generating hwdb in offsetted rootfs

People using DESTDIR to prepare packages had issues with the hardware database. We add an autotools option to handle that.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
2013-02-08 22:59:23 -08:00
Luca Barbato
96da532526 udevadm: support updating hwdb from an offset root
Introduce `--root` option to make users run udevadm on rootfs not
mounted as /

Ease the life of distribution packagers.
2013-02-07 13:53:28 +01:00
Ian Stakenvicius
94d7639cf2 Make udevlibexecdir be /lib
ie, fix another regression in our build system ; gentoo bug 455326

it's common for eg. mips systems to not have symlink from the directory
{lib32 or lib64} to /lib.  only the libraries belong to /$(get_libdir) and
everything in /lib/udev goes to, well, /lib/udev, NOT /$(get_libdir)/udev
     -- ssuominen

Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-02-04 11:22:30 -05:00
Ian Stakenvicius
c661732bc2 Fix AM_CONDITIONAL for HAVE_BLKID
Corrects error caused in commit a9ef3ca764

Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>
2013-01-29 09:10:41 -05:00
Ian Stakenvicius
a9ef3ca764 Make blkid optional
Embedded systems may not want to include util-linux when they do
not intend to use blkid functionality

Modified from original author's commit to not install
60-persistent-storage.rules if blkid is disabled

systemd commit f553b3b1074151200187df916427a1468186435e
Original author: Anders Olofsson <Anders.Olofsson@axis.com>

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-28 17:42:47 -05:00
Ian Stakenvicius
34bcd6cd8c Set device node permissions only at "add" events
New behavioural change -- has potential to fix bugs..?

systemd commit 48a849ee17fb25e0001bfcc0f28a4aa633d016a1
Author: Kay Sievers <kay@vrfy.org>

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-28 17:42:47 -05:00
Ian Stakenvicius
760eeae32a Cleanup of spacing to help with diffs
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-28 17:42:47 -05:00
Ian Stakenvicius
0354eeacf8 Add missing ':' to getopt_long 'e'
Parameter -e is set without additional argument in getopt
and this leads to segfault when calling 'udevd -e'.

systemd commit 5bbbe461fd4d133eac49f41210e2fd4846f577d8
Author: Lukas Nykryn <lnykryn@redhat.com>

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-28 17:42:47 -05:00
Ian Stakenvicius
eb256defbe Handle scsi Hyper-V devices properly
Hyper-V has an abstract bus, which gets renumbered on guest
startup. So instead of the bus numbers we should be using
the device GUIDs, which can be retrieved from the 'device_id'
sysfs attribute.

systemd commit a24d03b8ee2ca62cd1273e27cf4e79ddcc0fbb1c
Author: Hannes Reinecke <hare@suse.de>

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-28 17:42:47 -05:00
Ian Stakenvicius
e34b05dc4c Port new net_id capabilities from systemd-udev-197
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-28 17:42:47 -05:00
Ian Stakenvicius
ab779c8146 Honor DEVUID, DEVGID in addition to DEVMODE
New behaviour in udev-197
systemd commit 1edefa4f1d7bae6cc19aa4a97238400c5a04f7a4
Author: Kay Sievers <kay@vrfy.org>

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-28 17:42:47 -05:00
Ian Stakenvicius
cc9cf4c078 Fix missing endian wrappers
https://bugs.freedesktop.org/show_bug.cgi?id=58067
systemd commit f4443fa5976eca51661947dd4df60847213f27fa

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-28 17:42:47 -05:00
Ian Stakenvicius
3066d402f6 save a line of code
This mainly just helps keep diff's between eudev and systemd a little more clean, but it
does drop one line of duplicate code.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-28 17:42:47 -05:00
Ian Stakenvicius
27a018b94e Abort udev_enumerate_new if udev obj is null
https://bugs.freedesktop.org/show_bug.cgi?id=58289
systemd commit e68893075083a7461b1572233d23fdb23541d630

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-28 17:42:47 -05:00
Ian Stakenvicius
26e9261926 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>
2013-01-28 12:12:41 -05:00
Anthony G. Basile
82f60023e3 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>
2013-01-23 20:16:57 -05:00
Ian Stakenvicius
0407037a7b 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>
2013-01-22 14:34:39 -05:00
Anthony G. Basile
0342e13a32 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>
2013-01-22 14:29:53 -05:00
Anthony G. Basile
1ebf647b05 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>
2013-01-21 19:07:16 -05:00
Ian Stakenvicius
dd43e0b64c 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>
2013-01-21 15:49:32 -05:00
Ian Stakenvicius
6d72c38a3f 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>
2013-01-21 14:34:02 -05:00
Ian Stakenvicius
f715f6d34a Remove the remaining systemd code since it is not needed anymore
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-21 11:09:11 -05:00
Ian Stakenvicius
cb44e7c891 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>
2013-01-21 10:23:19 -05:00
Richard Yao
7c9974f31a 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
2013-01-20 13:37:10 -05:00
Richard Yao
ebf12c2f32 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>
2013-01-20 13:30:56 -05:00
Richard Yao
eeb8d70a6b Correct /dev/null permissions on older kernels
Older kernels rely on udev to set proper permissions on /dev/null.
Commit 378f2e074e 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>
2013-01-14 12:51:44 -05:00
Richard Yao
f6b4945845 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>
2013-01-14 12:19:33 -05:00
Ian Stakenvicius
09f41d6de4 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>
2013-01-08 14:24:04 -05:00
Ian Stakenvicius
5f1d6a94ca 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>
2013-01-07 12:20:54 -05:00
Ian Stakenvicius
c18029abe9 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>
2013-01-07 12:17:23 -05:00
Ian Stakenvicius
374546c239 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
2013-01-04 16:22:36 -05:00
Ian Stakenvicius
8638965ac2 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)
2013-01-04 14:34:52 -05:00
Ian Stakenvicius
5ea3e4deff 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
2013-01-04 11:33:33 -05:00
blueness
74852a5aeb 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>
2012-12-31 20:24:27 -08:00
Luca Barbato
bdd4de160c cgroup: factorize path
Spare few bytes and make typos less likely.
2012-12-27 23:27:06 +01:00
Luca Barbato
8e92264b4e build: switch to C99
Remove some redundant checks while at it.
2012-12-27 23:23:23 +01:00
Ian Stakenvicius
9e4b735b05 Fixed some cosmetic naming in log entries 2012-12-17 11:58:10 -05:00
blueness
cc5c144a70 Merge pull request #32 from nvinson/distcheck_fix
Fix make distcheck error: "gtk-doc must be installed and enabled in order to make dist"

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-12-12 06:58:49 -08:00
Ian Stakenvicius
036bc1a950 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>
2012-12-12 09:56:16 -05:00
Nick Vinson
db8d865e62 Move DISTCHECK_CONFIGURE_FLAGS var to Makefile.am
DISTCHECK_CONFIGURE_FLAGS is an automake variable and is not properly
detected when it is inside configure.ac
2012-12-08 11:46:18 -05:00
Richard Yao
7f14ef6bb1 eudev 1_beta1
Signed-off-by: Richard Yao <ryao@gentoo.org>
2012-12-08 09:56:49 -05:00
Richard Yao
bfc850a01b Add fallback path when accept4() is not available.
Commit ff2c503df0 introduced accept4() into
udev, which broke compatibility with kernels older than Linux 2.6.32 (or
Linux 2.6.36 on ARM). The purpose of accept4() is to permit
O_NONBLOCK and O_CLOEXEC to be specified at the accept() call site
while previously, they had to be set using fcntl() because Linux does
not inherit them.

Since accept4() increases the minimum kernel version, we add a fallback
path for situations in which it is unavailable.

Reported-by: Stephen Klimaszewski <steev@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
2012-12-08 09:48:07 -05:00
Ian Stakenvicius
551346ef4d Restored persistent-net-generator rules as per issue 13 2012-12-06 16:04:58 -05:00
Matthew Thode
9d261224be Merge pull request #30 from gentoo/blueness
CONTRIBUTING: documentation on how to contribute
2012-12-04 15:54:00 -08:00
Anthony G. Basile
3b76e0c84c CONTRIBUTING: documentation on how to contribute
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-12-04 17:50:37 -05:00
Richard Yao
2718feb9ed Fix autotools module checks
Module loading support was unconditionally disabled in the initial
autotools tests. I had missed this in my testing because I still had the
80-drivers.rules file from udev 171 on my system, which masked this
issue by invoking modprobe explicitly. This patch corrects the issue.

Signed-off-by: Richard Yao <ryao@gentoo.org>
2012-12-02 19:45:55 -05:00
Richard Yao
bfbd4ee14e Use udev version instead of eudev version for compatibility
The use of the eudev version in pkgconfig files caused build failures,
so we switch to the udev version for compatibility purposes.

Resolves gentoo/eudev#22

Signed-off-by: Richard Yao <ryao@gentoo.org>
2012-12-02 16:55:22 -05:00