summaryrefslogtreecommitdiff
path: root/src/udev
AgeCommit message (Collapse)Author
2014-07-31Always prefer our headers to system headersZbigniew Jędrzejewski-Szmek
In practice this shouldn't make much difference, but sometimes our headers might be newer, and we want to test them.
2014-07-31man: 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.
2014-07-31Reject 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
2014-07-30udev: fixup commit dd5eddd28a74a49607a8fffcaf960040dba98479Hannes Reinecke
Commit dd5eddd28a74a49607a8fffcaf960040dba98479 accidentally removed one line too many.
2014-07-29udev: place opening { at the same line as the function declarationKay Sievers
2014-07-29udev: unify event timeout handlingKay Sievers
2014-07-29udevd: 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.
2014-07-24udev: 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.
2014-07-16Be 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.
2014-07-16Let config_parse open file where applicableZbigniew Jędrzejewski-Szmek
Special care is needed so that we get an error message if the file failed to parse, but not when it is missing. To avoid duplicating the same error check in every caller, add an additional 'warn' boolean to tell config_parse whether a message should be issued. This makes things both shorter and more robust wrt. to error reporting.
2014-07-15Constify ConfigTableItem tablesZbigniew Jędrzejewski-Szmek
2014-07-08accelerometer: Don't wait for new data from the sensorBastien Nocera
Instead of waiting for new data from the sensor, which might be a long time coming, depending on the sensor device, ask the kernel for the last state for that particular input device.
2014-07-07udev: link_config - ignore errors due to missing MAC addressTom Gundersen
Otherwis, we get misleading error messages on links with MACs. Reported by Leonid Isaev.
2014-07-03udev: net_setup_link - add a bit more loggingTom Gundersen
2014-07-02udev: net_setup_link builtin should print the reason why something failsLennart Poettering
Let's tell users what is going wrong.
2014-07-01Use dev_port for the ID of a network device.Thadeu Lima de Souza Cascardo
For network devices on the same PCI function, dev_id should not be used, since its purpose is for IPv6 support on interfaces with the same MAC address. The new dev_port sysfs attribute should be used instead of dev_id.
2014-06-27libudev: queue - watch entire directory to allow the re-use of the watch ↵Kay Sievers
descriptor
2014-06-27libudev: queue provide file descriptor to watch busy event queueKay Sievers
2014-06-13udev: fix invalid free() in enable_name_policy()Andreas Henriksson
static bool enable_name_policy(...) in ./src/udev/net/link-config.c calls proc_cmdline(...) to get "line" initialized, but proc_cmdline(...) does not guarantee that atleast when both conditions (detect_container(NULL) > 0) and read_full_file(...) returned < 0.
2014-06-10udev: 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.
2014-06-10udev: really exclude device-mapper from block device ownership event lockingChristian Hesse
Arguments were wrong order, no? This fixes commits: e918a1b5a94f270186dca59156354acd2a596494 3d06f4183470d42361303086ed9dedd29c0ffc1b
2014-06-04udev: guard REREADPT by exclusive lock instead of O_EXCLKay Sievers
2014-06-04udev: 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.
2014-06-04udev: guard REREADP logic with open(O_ECXL)Kay Sievers
2014-06-04udev: try first re-reading the partition tableKay Sievers
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)
2014-06-04udev: link-config - fix mem leakTom Gundersen
Reported by Kay.
2014-06-04udev: 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.
2014-06-04udevd: inotify - modernizationsKay Sievers
2014-06-03udev: exclude device-mapper from block device ownership event lockingKay Sievers
2014-06-03udev: always close lock file descriptorKay Sievers
https://bugs.freedesktop.org/show_bug.cgi?id=79576
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.
2014-05-20udevadm-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.
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.
2014-05-15Remove unnecessary casts in printfsZbigniew Jędrzejewski-Szmek
No functional change expected :)
2014-05-15udev: do not skip the execution of RUN when renaming a network device failsKay Sievers
2014-05-13udev: rename netif - properly break lines in kmsgTom Gundersen
Before: 30,997,4553484,-;systemd-udevd[439]: renamed network interface wwan0 to wwp0s20u4i6systemd-udevd[439]: renamed network interface wlan0 to wlp3s0 30,998,1175077801,c;systemd-udevd[2345]: renamed network interface wwan0 to wwp0s20u4i6 After: 30,834,4553484,-;systemd-udevd[439]: renamed network interface wwan0 to wwp0s20u4i6 30,835,4732949,-;systemd-udevd[439]: renamed network interface wlan0 to wlp3s0 30,988,1175077801,-;systemd-udevd[2345]: renamed network interface wwan0 to wwp0s20u4i6
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.
2014-04-21silence warningsThomas Hindoe Paaboel Andersen
2014-04-20udev: link-config - treat any non-random mac address as persistentTom Gundersen
The address may be already changed by other processes, or set when creating the netdev from userspace.
2014-04-19network: implement masking of .link, .network and .netdev filesTom Gundersen
2014-04-19networkd: tie links to rtnl rather than udevTom Gundersen
This essentially swaps the roles of rtnl and udev in networkd. After this change libudev is only used for waiting for udev to initialize devices and to get udev-specific information needed for some [Match] attributes. This in particular simplifies the code in containers where udev is not really useful, but also simplifies things and reduces round-trips in the non-container case.
2014-04-13udev: serialize/synchronize block device event handling with file locksKay Sievers
2014-04-13udev: 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.
2014-04-06udev: net_id - use constants rather than magic numbersTom Gundersen
2014-04-05Fix a few return codes in error pathsZbigniew Jędrzejewski-Szmek
2014-04-02udev: do not export "static node" tags for non-existing devicesKay Sievers
2014-03-27udev: 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.
2014-03-27udev: update net_id commentsKay Sievers
2014-03-21libsystemd-network: move network-utils from src/sharedTom Gundersen
This does not belong in shared as it is mostly a detail of our networking subsystem. Moreover, now we can use libudev here, which will simplify things.
2014-03-21sd-ipv4ll/networkd: generate predictable addressesUmut Tezduyar Lindskog
Increase the chance of using the same link local address between reboots. The pseudo random sequence of addresses we attempt is now seeded with data that is very likely to stay the same between reboots, but at the same time be unique to the specific machine/nic. First we try to use the ID_NET_NAME_* data from the udev db combined with the machin-id, which is guaranteed to be unique and persistent, if available. If that is not possible (e.g., in containers where we don't have access to the udev db) we fallback to using the MAC address of the interface, which is guaranteed to be unique, and likely to be persistent. [tomegun: three minor changes: - don't expose HASH_KEY in the siphash24 header - get rid of some compile-warnings (and some casts at the same time), by using uint8_t[8] rather than uint64_t in the api - added commit message]