summaryrefslogtreecommitdiff
path: root/src/udev
AgeCommit message (Collapse)Author
2013-07-31Revert "static-nodes: remove creation of static nodes if HAVE_LIBKMOD"Ian Stakenvicius
This reverts commit aa417a4d83999f6d7f092161d5c411b8cbce9977. Preface: The kmod+tmpfiles static dev-node creation requires two commands to be executed at runtime -- it is not something that will automatically occur without a system's setup being explicitly designed or changed so that these commands are executed. Preface2: In order for the kmod+tmpfiles static dev-node creation to work properly, that -must- be executed at startup before {systemd-,}udevd starts. The reason for this is because udevd will only set permissions on those files at startup, and so if udevd starts beforehand then these nodes will exist with permissions that are (probably) too restrictive. The function in udevd which creates static-nodes is non-fatal and only updates mtime on the devnodes if they already exist. As such, if a system is configured to execute kmod+tmpfiles to create static-nodes, because that must occur first, eudev's udevd will not conflict. Also, if a system does not execute kmod+tmpfiles, then eudev will still create the static devnodes, even if kmod-14 or higher is installed. There *may* be a conflict if kmod+tmpfiles is executed after udevd starts, but as per "preface2" this is not a supported configuration. Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-07-31static-nodes: remove creation of static nodes if HAVE_LIBKMODAnthony G. Basile
This address upstream commit edeb68c53f1cdc452016b4c8512586a70b1262e3 and https://bugs.gentoo.org/show_bug.cgi?id=477890. If eudev is configured with --enable-libkmod then we check for kmod >= 14 and ifdef out the code removed in the upstream commit. Otherwise we retain it for modutils. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-30src/udev/udevadm-hwdb.c: rename variable to match upstreamAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-30udev: export tags of "dead" device nodes to /run/udev/static_node-tags/Anthony G. Basile
This is upstream 84b6ad702e64db534f67ce32d4dd2fec00a16784 Based on a patch by Kay Sievers. A tag is exported at boot as a symlinks to the device node in the folder /run/udev/static_node-tags/<tagname>/, if the device node exists. These tags are cleaned up by udevadm info --cleanup-db, but are otherwise never removed. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-30udev-rules: report rule parsing errors from get_keyDave Reisner
2013-07-30Bring collect.c and udevadm-hwdb.c in line with upstreamAnthony G. Basile
This brings these two files in line with upstream's commit: ef89eef77ee098a6828169a6d0d74128e236bcbd udev: fix two trivial memleaks in error path Based-on-a-patch-by: Ian Stakenvicius <axs@gentoo.org> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-24Switch from external keymaps to internal (hwdb) keymapsIan Stakenvicius
This commit imports the new internal keyboard handling from upstream. This is a combination of many upstream commits, including those that added code, removed old code, and updated the hwdb. Some commits (hwdb ones specifically) were unrelated but brought in anyways to keep the whole hwdb consistent. Each upstream commit included is as follows: 9d7d42bc406a2ac04639674281ce3ff6beeda790 - internal keymap support 0c959b39175b126fdb70ae00de37ca6d9c8ca3a1 - hwdb: keyboard -- add file e8193554925a22b63bef0e77b8397b56d63a91ff - hwdb: keyboard -- update comments c79d894d590fc9df4861738555cc43c477e33376 - hwdb: import data aedc2eddd16e48d468e6ad0aea2caf00c7d37365 - hwdb: keyboard update 97a9313cafccf772ce03f5ebd36fe4d9d8412583 - hwdb: drop non-existant Samsung 900XC3 from keymap ddc77f62244bb41d5c8261517e2e1ff1b763fc94 - switch from udev keymaps to hwdb 0c3815773331b263713f4f7b9d80bc1ca159338e - also remove keymaps-force-release directory 1b6bce89b3383904d0dab619dd38bff673f7286e - keymap: re-add Logitech USB corded/cordless models bf89b99c5a39115112c2eda4c2103e2db54988d2 - 60-keyboard.hwdb: Fix syntax error ce39bb6909578017aa10031638e724e038f0b859 - hwdb: data update, upstream 884c86812c51479496edd50b278383d7bb67baf0 - rules: keyboard - use builtin command All code from each of the above commits is attributed to the original authors. There were some adjustments made in order to support the code differences between upstream and eudev, which was done by myself. Also of note is that the code can still be disabled via the --disable-keymaps configure option, which was removed from upstream. Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-07-11src/udev/udevadm-hwdb.c: fix double freeeudev/v1.1Anthony G. Basile
clang is stupid and I will never blindly trust it again. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-11src/udev/udev-builtin-kmod.c: fix char *const declarationAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-10Fix potential memleak and use-after-free errors as reported by clangIan Stakenvicius
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-10src/udev/udev-builtin-kmod.c: fix const char* declarationAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-10src/udev/mkdir.c: import path_startswith() from upstreamAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-10src/udev/udev-ctrl.c: explicitly declare return valueAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-10Bring mkdir.c, label.c and util.c in better line with upstreamAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-10hwdb: allow list of lookup keys per given recordKay Sievers
This allows to specify: dmi:bvn*:bvr*:bd*:svnVENDOR:pn:Model 231*:pvr* dmi:bvn*:bvr*:bd*:svnVENDOR:pn:Series 12*:pvr* KEY_A=value KEY_B=value Instead of: dmi:bvn*:bvr*:bd*:svnVENDOR:pn:Model 231*:pvr* KEY_A=value KEY_B=value dmi:bvn*:bvr*:bd*:svnVENDOR:pn:Series 12*:pvr* KEY_A=value KEY_B=value Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-10hwdb: return false if no property is foundKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-09hwdb: add --lookup-prefix= optionKay Sievers
2013-07-07hwdb: allow to query arbitrary keysKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-07hwdb: add --device=<device-id> and --filter=<key name glob>Kay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-07hwdb: remove support for (not fully implemented) conditional propertiesKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-07dev-setup: do not create a dangling /proc/kcore symlinkZbigniew Jędrzejewski-Szmek
https://bugs.freedesktop.org/show_bug.cgi?id=65382 https://bugs.gentoo.org/472060?id=472060 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-07Import strxcpyx from upstreamAnthony G. Basile
This commit imports strxcpyx from upstream. This is upstream commit d5a89d7dc17a5ba5cf4fc71f82963c5c94a31c3d Note: there were also some very minor code cleanups to accelerometer.c: line 187 collect.c: lines 35, 140 libudev-device.c: line 780 libudev-hwdb.c: line 300 These are part of upstream commits: 507f22bd0172bff5e5d98145b1419bd472a2c57f 3cf7b686e6b29f78de0af5929602cae4482f6d49 67410e9f73a6cdd8453c78b966451b5151def14a Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-29src/udev/udev-ctrl.c: restore accept4_fallback codeAnthony G. Basile
This code was accidentally removed in commit 601c4e8ce69338652b3c9178386cbc05de8bae8d We restore it here. Since most modern systems have accept4() this code will seldom be triggered. You can test by configuring as follows: ac_cv_have_decl_accept4="no" ./configure Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-26udev: handle network controllers in nonstandard domainsSean McGovern
Onboard network controllers are not always on PCI domain 0. [Kay: use int instead of long, add [P] to slot naming, remove sysname var] Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-26libudev: Use correct type for sizeofJan Janssen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-06Fix ordering of params for conf_files_list_strvAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-05Remove unused functions from src/udev/{label,mkdir}Anthony G. Basile
We remove the following unused functions: label_socket_set label_socket_clear label_free label_get_create_label_from_exe label_retest_selinux label_bind mkdir_label mkdir_safe mkdir_safe_label mkdir_p_label Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-03Add printf attributes in exported headersZbigniew Jędrzejewski-Szmek
gcc (and other compilers) sometimes generate spurious warnings, and thus users of public headers must be able to disable warnings. Printf format attributes can be disabled by setting #define _sd_printf_attr_ before including the header file. Also, add similar logic for sentinel attribute: #define _sd_sentinel_attr_ before including the header file disables the attribute.
2013-06-03Standarize on one spelling of symlink error messageZbigniew Jędrzejewski-Szmek
It's polite to print the name of the link that wasn't created, and it makes little sense to print the target. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-03Move remaining _cleanup_free_ in front of typeAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-02src/udev/udev-rules.c: fix a spelling errorAnatol Pomozov
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-02udev/udev-ctrl.c:udev_ctrl_new_from_fd() enable SO_PASSCREDHarald Hoyer
Avoid "sender uid=65534, message ignored" case, where no credentials can be read on the sender side. Seems, the server socket does not enable credential receiving fast enough, and the message from the client (without credential) sometimes is queued before the credential passing was active. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-02Use initalization instead of explicit zeroingZbigniew Jędrzejewski-Szmek
Before, we would initialize many fields twice: first by filling the structure with zeros, and then a second time with the real values. We can let the compiler do the job for us, avoiding one copy. A downside of this patch is that text gets slightly bigger. This is because all zero() calls are effectively inlined: $ size build/.libs/systemd text data bss dec hex filename before 897737 107300 2560 1007597 f5fed build/.libs/systemd after 897873 107300 2560 1007733 f6075 build/.libs/systemd … actually less than 1‰. A few asserts that the parameter is not null had to be removed. I don't think this changes much, because first, it is quite unlikely for the assert to fail, and second, an immediate SEGV is almost as good as an assert. NOTE by Basile: the above analysis is for all systemd. This commit is just a sliver of the commit for all of system and so we can't expect size to be the same. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-02udevadm: do not free node on successZbigniew Jędrzejewski-Szmek
A fix for ff03aed06a422.
2013-06-02udev-builtin-usb_id: avoid comparison of unsigned and ssize_tZbigniew Jędrzejewski-Szmek
For some reason this shows up on i686 only: src/udev/udev-builtin-usb_id.c:192:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
2013-06-02udevadm-hwdb: avoid leak in error pathZbigniew Jędrzejewski-Szmek
2013-04-21src/udev/Makefile.am: do not fail if sym link already existsAnthony G. Basile
This fixes two issues: 1) The -r option does not exist for busybox and we do not need relative sym linking anyhow, and 2) if the sym link already exists, we want to overwrite it, hence -f. X-Eudev-Bug: 58 X-Eudev-Bug-URL: https://github.com/gentoo/eudev/issues/58 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-09build-sys: fix HAVE/ENABLE_FIRMWAREKay Sievers
This fixes: https://github.com/gentoo/eudev/issues/55 https://bugs.freedesktop.org/show_bug.cgi?id=62864 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-07src/udev/udev-event.c: restore code to allow rule generator to workAnthony G. Basile
This code was dropped while importing from upstream. It is needed to allow the legacy renaming of interfaces like eth* or wlan*. X-Eudev-Bug: 56 X-Eudev-Bug-URL: https://github.com/gentoo/eudev/issues/56 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-07src/udev/Makefile.am: fix symlink to udevadmAnthony G. Basile
The installation was overwriting udevadm when building with --sbindir=/usr/bin and ignoring $bindir. Both situations lead to a symlink which points to nowhere. Thanks TZ86. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-04src/udev/udev-rules.c: fix bug introduced in our 601c4e8Anthony G. Basile
This error was introduced in our commit 601c4e8ce69338652b3c9178386cbc05de8bae8d when importing from upstream. The revert line works only in the context of all of upstream's commit 7850b3b83791ba0e2377ba40383c5abc258b839d Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-04-04Initial forward-port of rules.d inotify supportIan Stakenvicius
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-04Use LN_S instead of directly calling ln -sIan Stakenvicius
configure.ac has AC_PROG_LN_S already so we should use it. upstream did this in commit 783162123dbac43d5b7a3fab9d4f11dcf86d06e1 Signed-off-by: Ian Stakenvicius <axs@gentoo.org> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-04Move udevadm from sbin to binIan Stakenvicius
Follow upstream commit f432bb914499e2c28b43f592bb273f0a8664f352 but refactor the patch for eudev build system. Provide a compatibility symlink in sbindir for anything that hard-codes the path to udevadm Signed-off-by: Ian Stakenvicius <axs@gentoo.org> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-02udev: updateAnthony G. Basile
This updates the daemon codebase to upstream. Authors: Zbigniew Jędrzejewski-Szmek Lennart Poettering Václav Pavlín Kay Sievers Harald Hoyer Rob Clark Zeeshan Ali (Khattak) See http://cgit.freedesktop.org/systemd/systemd/log/src/udev Ian is signing off but has some concerns on a few of the changes that he may fix in future commits. Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-04-02udev: ifdef all firmware special handlingKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-04-02udev: make firmware loading optional and disable by defaultTom Gundersen
Distros that whish to support old kernels should set --with-firmware-dirs="/usr/lib/firmware/updates:/usr/lib/firmware" to retain the old behaviour. Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-03-14udev: fix segfault with android rndisRob Clark
The android gadget driver for network tethering over rndis somehow has a parent device with a null subsystem. Probably this is bug in android driver, but it is easy enough to make systemd/udev behave gracefully and not segfault. And this will help for making linux distros with systemd (like fedora) work on android devices. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-03-14udev: usb_id: parse only 'size' bytes of the 'descriptors' bufferKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-03-14udev: usb_id - ignore non-ASCII serial numbersKay Sievers
On Thu, Feb 7, 2013 at 3:52 PM, Robert Milasan <rmilasan@suse.com> wrote: > Hi, seems that using some strange usb devices with really bogus serial > numbers usb_id creates links with junk strings in it: > > /dev/disk/by-id/usb-TSSTcorp_BDDVDW_SE-506AB_㡒䍌䜶䉗ぁㄴ㌴†ँ-0:0 > > Initially was believed that usb_id is to blame, then the kernel, but it > turns out that really the usb cd/dvd drive has this bogus serial number: > > output from dmesg: > [ 538.200160] usb 1-2: new high-speed USB device number 5 using > ehci_hcd [ 538.335067] usb 1-2: New USB device found, idVendor=0e8d, > idProduct=1956 [ 538.335080] usb 1-2: New USB device strings: Mfr=1, > Product=2, SerialNumber=3 [ 538.335089] usb 1-2: Product: MT1956 > [ 538.335097] usb 1-2: Manufacturer: MediaTek Inc > [ 538.335105] usb 1-2: SerialNumber: > \xffffffe3\xffffffa1\xffffff92\xffffffe4\xffffff8d\xffffff8c ... > [ 538.337540] scsi6 : usb-storage 1-2:1.0 [ 539.341385] scsi 6:0:0:0: > CD-ROM TSSTcorp BDDVDW SE-506AB TS00 PQ: 0 ANSI: 0 > [ 539.354240] sr0: scsi3-mmc drive: 0x/24x writer dvd-ram cd/rw > xa/form2 cdda tray [ 539.354777] sr 6:0:0:0: Attached scsi CD-ROM sr0 > [ 539.355122] sr 6:0:0:0: Attached scsi generic sg2 type 5 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>