summaryrefslogtreecommitdiff
path: root/src/udev
AgeCommit message (Collapse)Author
2014-08-05src/libudev/missing.h: clean up unused BTRFS_* declsAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05udev-builtin-keyboard: Allow numeric key codesMartin Pitt
Like with the old udev rules, allow hwdb entries to specify numeric key codes. Based on a patch from Mircea Miron. https://launchpad.net/bugs/1247584 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05udev: path_id - suppress ID_PATH for devices with an unknown parent device typeKay Sievers
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1321816 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05Unify parse_argv styleZbigniew Jędrzejewski-Szmek
getopt is usually good at printing out a nice error message when commandline options are invalid. It distinguishes between an unknown option and a known option with a missing arg. It is better to let it do its job and not use opterr=0 unless we actually want to suppress messages. So remove opterr=0 in the few places where it wasn't really useful. When an error in options is encountered, we should not print a lengthy help() and overwhelm the user, when we know precisely what is wrong with the commandline. In addition, since help() prints to stdout, it should not be used except when requested with -h or --help. Also, simplify things here and there. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05Include missing.h in udev-builtin-btrfs.c, and move BTRFS_IOC_DEVICES_READY ↵Anthony G. Basile
to missing.h This is a combination of upstream commits dced15575f7bf172e3c9d798c43477539525558c 7bed7f0e3b1f9596aedb64657e432e5b267adebb by Simon McVittie <simon.mcvittie@collabora.co.uk> 7bed7f0e3b1f9596aedb64657e432e5b267adebb Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-04man: add udev.conf(5)Zbigniew Jędrzejewski-Szmek
We generally have separate man pages for all configuration files. In this case udev.conf was already described in systemd-udevd.service(8), but it was hard to find. Docbook makes it hard to add a .so link from a different section, so describe udev.conf in its own page. Signedaoff-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-04Reject invalid quoted stringsZbigniew Jędrzejewski-Szmek
String which ended in an unfinished quote were accepted, potentially with bad memory accesses. Reject anything which ends in a unfished quote, or contains non-whitespace characters right after the closing quote. _FOREACH_WORD now returns the invalid character in *state. But this return value is not checked anywhere yet. Also, make 'word' and 'state' variables const pointers, and rename 'w' to 'word' in various places. Things are easier to read if the same name is used consistently. mbiebl_> am I correct that something like this doesn't work mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"' mbiebl_> systemd seems to strip of the quotes mbiebl_> systemctl status shows mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS $RootDir $MountPoint mbiebl_> which is pretty weird Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-07-30udev: fixup commit dd5eddd28a74a49607a8fffcaf960040dba98479Hannes Reinecke
Commit dd5eddd28a74a49607a8fffcaf960040dba98479 accidentally removed one line too many. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-07-30udev: place opening { at the same line as the function declarationKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-07-30udev: unify event timeout handlingKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-07-30udevd: add --event-timeout commandline optionHannes Reinecke
Some events take longer than the default 30 seconds. Killing those events will leave the machine halfway configured. Add a commandline option '--event-timeout' to handle these cases. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-07-25udev: exclude MD from block device ownership event lockingKay Sievers
MD instantiates devices at open(). This is incomptible with the locking logic, as the "change" event emitted when stopping a device will bring it back. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-07-19Be more careful when checking for empty filesZbigniew Jędrzejewski-Szmek
If we want to avoid reading a totally empty file, it seems better to check after we have opened the file, not before. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-07-01libudev: queue - watch entire directory to allow the re-use of the watch ↵Kay Sievers
descriptor Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-07-01libudev: queue provide file descriptor to watch busy event queueKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-06-15udev: check the return value from udev_enumerate_scan_devicesThomas Hindoe Paaboel Andersen
The return value from udev_enumerate_scan_devices was stored but never used. I assume this was meant to be checked. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-06-15udev: really exclude device-mapper from block device ownership event lockingChristian Hesse
Arguments were wrong order, no? This fixes commits: e918a1b5a94f270186dca59156354acd2a596494 3d06f4183470d42361303086ed9dedd29c0ffc1b Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-06-07udev: guard REREADPT by exclusive lock instead of O_EXCLKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-06-07udev: make sure we always get "change" for the diskKay Sievers
The kernel will return 0 for REREADPT when no partition table is found, we have to send out "change" ourselves. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-06-07udev: guard REREADP logic with open(O_ECXL)Kay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-06-07[PATCH] udev: try first re-reading the partition tableAnthony G. Basile
mounted partitions: # dd if=/dev/zero of=/dev/sda bs=1 count=1 UDEV [4157.369250] change .../0:0:0:0/block/sda (block) UDEV [4157.375059] change .../0:0:0:0/block/sda/sda1 (block) UDEV [4157.397088] change .../0:0:0:0/block/sda/sda2 (block) UDEV [4157.404842] change .../0:0:0:0/block/sda/sda4 (block) unmounted partitions: # dd if=/dev/zero of=/dev/sdb bs=1 count=1 UDEV [4163.450217] remove .../target6:0:0/6:0:0:0/block/sdb/sdb1 (block) UDEV [4163.593167] change .../target6:0:0/6:0:0:0/block/sdb (block) UDEV [4163.713982] add .../target6:0:0/6:0:0:0/block/sdb/sdb1 (block) Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-06-07udev: synthesize "change' events for partitions when tools change the diskKay Sievers
This should make sure that fdisk-like programs will automatically cause an update of all partitions, just like mkfs-like programs cause an update of the partition. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-06-06udevd: inotify - modernizationsKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-06-06udev: exclude device-mapper from block device ownership event lockingKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-06-06udev: always close lock file descriptorKay Sievers
https://bugs.freedesktop.org/show_bug.cgi?id=79576 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-06-01udev-builtin-keyboard: do tell on which device EVIOCSKEYCODE failed.Cristian Rodríguez
I am getting "Error calling EVIOCSKEYCODE (scan code 0xc022d, key code 418): Invalid argument", the error message does not tell on which specific device the problem is, add that info. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-05-23udevadm-settle: fixed return code for empty queueHarald Hoyer
If the udev queue is empty and "/run/udev/queue" does not exist, "udevadm settle" would return with EXIT_FAILURE, because the inotify on "/run/udev/queue" would fail with ENOENT. This patch lets "udevadm settle" exit with EXIT_SUCCESS in this case. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-05-17udev: avoid use of uninitialized errThomas Hindoe Paaboel Andersen
After 1ea972174baba40dbc80c51cbfc4edc49764b59b err is no longer set unless we hit a special case. Initialize it to 0 and remove a check that will never fail. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-05-15Remove unnecessary casts in printfsZbigniew Jedrzejewski-Szmek
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-05-15udev: do not skip the execution of RUN when renaming a network device failsKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-04-24udev: increase the size of RESULT bufferRobert Milasan
Under some conditions, in udev_rules_apply_to_event the fact that result is 1024 bytes, creates problems if the output of the running command/app is bigger then 1024 bytes. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-04-24udev: serialize/synchronize block device event handling with file locksKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-04-24src/udev: code cleanupAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-04-24udev: remove seqnum API and all assumptions about seqnumsKay Sievers
The way the kernel namespaces have been implemented breaks assumptions udev made regarding uevent sequence numbers. Creating devices in a namespace "steals" uevents and its sequence numbers from the host. It confuses the "udevadmin settle" logic, which might block until util a timeout is reached, even when no uevent is pending. Remove any assumptions about sequence numbers and deprecate libudev's API exposing these numbers; none of that can reliably be used anymore when namespaces are involved. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-04-07udev: net_id - use constants rather than magic numbersTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-04-03udev: do not export "static node" tags for non-existing devicesKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-03-28udev: persistent naming - we cannot use virtio numbers as they are not stableTom Gundersen
This reverts commit 8741f2defaf26aafe5ee0fd29954cfdf84ee519c: 'Add virtio-blk support to path_id' and commit e3d563346c4237af23335cc6904e0662efdf62ad: 'udev: net_id - handle virtio buses'. Distros may want to take note of this, as it changes behavior. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-03-28udev: update net_id commentsKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-03-22Merge pull request #91 from lhb-jr/fix_discardconst_warnblueness
src/udev/udev-builtin-kmod.c: fix discardconst warn Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-03-21completed fix to 'discard const' warninglhb-jr
modified: src/udev/udev-builtin-kmod.c
2014-03-21workaround 'discards const' warning during compilelhb-jr
modified: src/udev/udev-builtin-kmod.c Temporary copies of the arguments to the 'execv' call are made so that gcc doesn't give, possibly confusing warning about 'discarding const' during compilation.
2014-03-21fixed gcc warnings that call returns not checkedlhb-jr
modified: src/collect/collect.c modified: src/udev/udev-node.c modified: src/udev/udevadm-settle.c modified: src/udev/udevd.c
2014-03-17input_id: Recognize buttonless joystick typesMartin Pitt
Input devices like rudders or pedals are joystick-like; they don't have buttons, but axes like RX, THROTTLE, or RUDDER. These don't interfere with other device types with absolute axes (touch screens, touchpads, and accelerometers), so it's fairly safe to mark them as ID_INPUT_JOYSTICK and thus hand out dynamic ACLs to the user. https://bugs.freedesktop.org/show_bug.cgi?id=70734
2014-03-17udev: properly detect reference to unexisting part of PROGRAM's resultLukas Nykryn
2014-03-17Use strlen even for constant stringsJosh Triplett
GCC optimizes strlen("string constant") to a constant, even with -O0. Thus, replace patterns like sizeof("string constant")-1 with strlen("string constant") where possible, for clarity. In particular, for expressions intended to add up the lengths of components going into a string, this often makes it clearer that the expression counts the trailing '\0' exactly once, by putting the +1 for the '\0' at the end of the expression, rather than hidden in a sizeof in the middle of the expression.
2014-03-17udev: spelling fixesMiklos Vajna
2014-03-09udev-builtin-blkid: modernizations and minor fixesLennart Poettering
2014-02-28Remove dead lines in various placesZbigniew Jędrzejewski-Szmek
As pointed-out by clang -Wunreachable-code. No behaviour changes. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-02-21macro: introduce a nice macro for disabling -Wformat-nonliteral temporarilyAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-02-21udev: make sure we always return a valid error code in trie_store()Lennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>