summaryrefslogtreecommitdiffstats
path: root/src/udev (follow)
Commit message (Collapse)AuthorAgeFilesLines
* udev: guard REREADPT by exclusive lock instead of O_EXCLKay Sievers2014-06-041-2/+5
|
* udev: make sure we always get "change" for the diskKay Sievers2014-06-041-14/+39
| | | | | The kernel will return 0 for REREADPT when no partition table is found, we have to send out "change" ourselves.
* udev: guard REREADP logic with open(O_ECXL)Kay Sievers2014-06-041-1/+1
|
* udev: try first re-reading the partition tableKay Sievers2014-06-041-6/+33
| | | | | | | | | | | | | | | 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)
* udev: link-config - fix mem leakTom Gundersen2014-06-041-1/+3
| | | | Reported by Kay.
* udev: synthesize "change' events for partitions when tools change the diskKay Sievers2014-06-041-2/+42
| | | | | | 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.
* udevd: inotify - modernizationsKay Sievers2014-06-041-23/+22
|
* udev: exclude device-mapper from block device ownership event lockingKay Sievers2014-06-031-1/+13
|
* udev: always close lock file descriptorKay Sievers2014-06-031-6/+4
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=79576
* udev-builtin-keyboard: do tell on which device EVIOCSKEYCODE failed.Cristian Rodríguez2014-06-011-1/+1
| | | | | | | | 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.
* udevadm-settle: fixed return code for empty queueHarald Hoyer2014-05-201-1/+5
| | | | | | | | 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.
* udev: avoid use of uninitialized errThomas Hindoe Paaboel Andersen2014-05-171-2/+2
| | | | | | 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.
* Remove unnecessary casts in printfsZbigniew Jędrzejewski-Szmek2014-05-152-4/+4
| | | | No functional change expected :)
* udev: do not skip the execution of RUN when renaming a network device failsKay Sievers2014-05-154-18/+13
|
* udev: rename netif - properly break lines in kmsgTom Gundersen2014-05-131-1/+1
| | | | | | | | | | | | | 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
* udev: increase the size of RESULT bufferRobert Milasan2014-04-241-1/+1
| | | | | | 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.
* silence warningsThomas Hindoe Paaboel Andersen2014-04-211-1/+1
|
* udev: link-config - treat any non-random mac address as persistentTom Gundersen2014-04-201-17/+1
| | | | | The address may be already changed by other processes, or set when creating the netdev from userspace.
* network: implement masking of .link, .network and .netdev filesTom Gundersen2014-04-191-0/+5
|
* networkd: tie links to rtnl rather than udevTom Gundersen2014-04-191-1/+1
| | | | | | | | | | 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.
* udev: serialize/synchronize block device event handling with file locksKay Sievers2014-04-141-2/+31
|
* udev: remove seqnum API and all assumptions about seqnumsKay Sievers2014-04-143-141/+51
| | | | | | | | | | | | 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.
* udev: net_id - use constants rather than magic numbersTom Gundersen2014-04-061-2/+3
|
* Fix a few return codes in error pathsZbigniew Jędrzejewski-Szmek2014-04-051-11/+6
|
* udev: do not export "static node" tags for non-existing devicesKay Sievers2014-04-021-5/+5
|
* udev: persistent naming - we cannot use virtio numbers as they are not stableTom Gundersen2014-03-272-39/+0
| | | | | | | 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.
* udev: update net_id commentsKay Sievers2014-03-271-16/+15
|
* libsystemd-network: move network-utils from src/sharedTom Gundersen2014-03-212-2/+2
| | | | | | 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.
* sd-ipv4ll/networkd: generate predictable addressesUmut Tezduyar Lindskog2014-03-211-28/+1
| | | | | | | | | | | | | | | | | | | | 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]
* util: replace close_nointr_nofail() by a more useful safe_close()Lennart Poettering2014-03-181-2/+1
| | | | | | | | | | | | | | | safe_close() automatically becomes a NOP when a negative fd is passed, and returns -1 unconditionally. This makes it easy to write lines like this: fd = safe_close(fd); Which will close an fd if it is open, and reset the fd variable correctly. By making use of this new scheme we can drop a > 200 lines of code that was required to test for non-negative fds or to reset the closed fd variable afterwards.
* core, libsystemd, systemd, timedate, udev: spelling fixesMiklos Vajna2014-03-171-1/+1
|
* Use strlen even for constant stringsJosh Triplett2014-03-161-7/+7
| | | | | | | | | | | 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.
* udev: properly detect reference to unexisting part of PROGRAM's resultLukas Nykryn2014-03-111-0/+2
|
* input_id: Recognize buttonless joystick typesMartin Pitt2014-03-101-4/+15
| | | | | | | | | | 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
* Make tables for DEFINE_STRING_TABLE_LOOKUP consistentDaniel Mack2014-03-072-4/+4
| | | | | | | | Bring some arrays that are used for DEFINE_STRING_TABLE_LOOKUP() in the same order than the enums they reference. Also, pass the corresponding _MAX value to the array initalizer where appropriate.
* udev-builtin-blkid: remove dead codeKay Sievers2014-03-071-4/+2
|
* udev: automatically create a symlink /dev/disk/by-id/gpt-auto-root if ↵Lennart Poettering2014-03-071-2/+13
| | | | there's a suitable root partition
* udev-builtin-blkid: when we find a GPT partition marked as root disk on the ↵Lennart Poettering2014-03-071-0/+90
| | | | | | | | | | | | | | | same disk as the ESP, expose a property on the udev device This is preparation for a logic to automatically discover the root partition to boot from if no partition has been configured explicitly. This makes use of our newly defined GPT type GUIDs for our root disks: #define GPT_ROOT_X86 SD_ID128_MAKE(44,47,95,40,f2,97,41,b2,9a,f7,d1,31,d5,f0,45,8a) #define GPT_ROOT_X86_64 SD_ID128_MAKE(4f,68,bc,e3,e8,cd,4d,b1,96,e7,fb,ca,f9,84,b7,09) We define differen GUIDs for different architectures to allow images which finde the right root partition for the appropriate arch.
* udev-builtin-blkid: modernizations and minor fixesLennart Poettering2014-03-071-6/+6
|
* cdrom_id: use the old MMC fallbackLukas Nykryn2014-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1038015 The problem seems to be that the your virtual DVD is emulating a really old DVD device, and doing it kind of strangely. > dracut:# /lib/udev/cdrom_id --debug /dev/sr0 > probing: '/dev/sr0' > INQUIRY: [IMM ][Virtual CD/DVD ][0316] > GET CONFIGURATION failed with SK=5h/ASC=24h/ACQ=00h So your virtual drive rejects the GET CONFIGURATION command as illegal. Other pre-MMC2 drives that don't accept this command usually return the error SK=5h,ASC=20h (invalid/unsupported command code), in which case cdrom_id tries an older method, and then ID_CDROM_MEDIA_TRACK_COUNT_DATA gets set and all the /dev/disk/by-label (etc) links get set up. The virtual drive returns the error SK=5h,ASC=24h (invalid field in Command Descriptor Block), which cdrom_id doesn't handle, so it gives up and the links never get made. The ideal solution would be to make the IMM to emulate a device that's less than 15 years old, but I'm not going to hold my breath waiting for that. So probably cdrom_id should also use the old MMC fallback when the error is SK=5h,ASC=24h, and then all of this would work as expected. Suggested-by:Luca Miccini <lmiccini@redhat.com>
* Remove dead lines in various placesZbigniew Jędrzejewski-Szmek2014-02-252-3/+1
| | | | | | As pointed-out by clang -Wunreachable-code. No behaviour changes.
* core: clean up some confusing regarding SI decimal and IEC binary suffixes ↵Lennart Poettering2014-02-231-2/+2
| | | | | | | | | | | for sizes According to Wikipedia it is customary to specify hardware metrics and transfer speeds to the basis 1000 (SI decimal), while software metrics and physical volatile memory (RAM) sizes to the basis 1024 (IEC binary). So far we specified everything in IEC, let's fix that and be more true to what's otherwise customary. Since we don't want to parse "Mi" instead of "M" we document each time what the context used is.
* udev: net - allow MTU and Speed to be specified with unitsTom Gundersen2014-02-222-5/+6
| | | | | This also changes the names to MTUBytes and BitsPerSecond, respectively. Notice that the speed was mistakenly documented to be in bytes before this change.
* net-util: match on the driver as exposed by ethtool if DRIVER not setTom Gundersen2014-02-211-0/+1
| | | | Also fix a copy-paste error that broke matching on interface name.
* net: initialize structs when declaringTom Gundersen2014-02-211-14/+12
|
* net: initialize structs when declaring them/do not clobber caller variablesLennart Poettering2014-02-211-9/+10
| | | | Just two minor style fixes...
* udev - link-setup - expose ID_NET_DRIVERTom Gundersen2014-02-215-9/+62
| | | | | This is the same as shown by 'ethtool -i <ifname>', and is sometimes set even though DRIVER is not.
* .network/.netdev/.link: allow to match on architectureTom Gundersen2014-02-213-3/+5
|
* network/link: Match - filter on kernel cmdline, host and virtTom Gundersen2014-02-203-14/+22
|
* macro: introduce a nice macro for disabling -Wformat-nonliteral temporarilyLennart Poettering2014-02-201-4/+4
|