1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

570 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
8c62ecf1a9 udevadm: do not free node on success
A fix for ff03aed06a.
2013-04-05 17:39:13 -04:00
Zbigniew Jędrzejewski-Szmek
bad490b051 udev-builtin-usb_id: avoid comparison of unsigned and ssize_t
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-04-05 17:39:02 -04:00
Martin Pitt
79d860fe78 PAM, uaccess: check for logind, not for systemd
It is possible to build systemd without logind or run logind without systemd
init. Commit 66e41181 fixed sd_booted() to only succeed for systemd init; with
that, testing for systemd init is wrong in the parts that talk to logind.

In particular, this affects the PAM module and the "uaccess" udev builtin.
Change sd_booted() to a new logind_running() which tests for
/run/systemd/seats/.

For details, see:
<https://mail.gnome.org/archives/desktop-devel-list/2013-March/msg00092.html>

https://bugs.freedesktop.org/show_bug.cgi?id=62754
2013-04-05 18:16:58 +02:00
Zbigniew Jędrzejewski-Szmek
ff03aed06a udevadm-hwdb: avoid leak in error path 2013-04-04 22:46:19 -04:00
Lennart Poettering
574d5f2dfc util: rename write_one_line_file() to write_string_file()
You can write much more than just one line with this call (and we
frequently do), so let's correct the naming.
2013-04-03 20:12:56 +02:00
Zbigniew Jędrzejewski-Szmek
7a22620612 accelerometer: remove dead if and modernize
Based on a coverity warning.
2013-03-31 14:32:17 -04:00
Zbigniew Jędrzejewski-Szmek
4dd1de72e8 Remove some dead code
Based on coverity report.
2013-03-31 14:28:36 -04:00
Lennart Poettering
bcadcb64ee udev: extern on functions is pointless 2013-03-30 15:21:54 +01:00
Zbigniew Jędrzejewski-Szmek
844ec79b3c catalog: open up catalog internals
In order to write tests for the catalog functions, they
are made non-static and start taking a 'database' parameter,
which is the name of a file with the preprocessed catalog
entries.

This makes it possible to make test-catalog part of the
normal test suite, since it now only operates on files
in /tmp.

Some more tests are added.
2013-03-28 23:45:59 -04:00
Václav Pavlín
f459285212 udev: check return value of uname. 2013-03-28 23:45:58 -04:00
Kay Sievers
d8d4bee76c build-sys: fix HAVE/ENABLE_FIRMWARE
https://bugs.freedesktop.org/show_bug.cgi?id=62864
2013-03-28 15:28:10 +01:00
Martin Pitt
590888a0d0 keymap: Fix Touchpad Toggle on MSI Wind U90/U100
This key is handled by the hardware already, so handling it again in software
nullifies the effect. Newer kernels read the real state and send out a separate
KEY_TOUCHPAD_ON or KEY_TOUCHPAD_OFF event, so in both cases we need to ignore
that key.

https://bugs.freedesktop.org/show_bug.cgi?id=62404
2013-03-27 08:15:12 +01:00
Harald Hoyer
8cc3f8c0bc udevd.c: set udev children_max according to CPU count
Setting children_max according to RAM leads to too much concurrent I/O.
2013-03-25 13:11:18 +01:00
Zbigniew Jędrzejewski-Szmek
46512cd959 udevadm: place const in the right place
Otherwise clang at least thinks that both consts apply to char.
2013-03-22 23:08:17 -04:00
Lennart Poettering
2852ae2134 udev: no need to output OOM, if we call log_oom() anyway 2013-03-22 21:05:42 +01:00
Zbigniew Jędrzejewski-Szmek
7d56679902 udev/collect: avoid initalizing memory twice 2013-03-22 15:40:37 -04:00
Kay Sievers
9a8ae49d91 udev: always set selinux label at "add" events
https://bugs.freedesktop.org/show_bug.cgi?id=62615
2013-03-21 23:13:17 +01:00
Zbigniew Jędrzejewski-Szmek
131c01dbe9 Make two functions static 2013-03-20 19:16:01 -04:00
Ozan Çağlayan
278e73d6b7 keymap: Remap microphone mute and touchpad toggle for Lenovo U300s
Separate out Ideapad U300s to its own line and add Microphone mute key.

Signed-off-by: Martin Pitt <martinpitt@gnome.org>
2013-03-19 14:55:32 +01:00
Ozan Çağlayan
785af213b6 keymap: Fix touchpad toggling on Lenovo IdeaPad U300s
IdeaPad U300s needs mapping 0xf1 to f21 just like Lenovo V480.

Signed-off-by: Martin Pitt <martinpitt@gnome.org>
2013-03-19 11:28:09 +01:00
Kay Sievers
61e536e1b7 udev: ifdef all firmware special handling 2013-03-18 15:22:32 +01:00
Tom Gundersen
a3bd8447be udev: make firmware loading optional and disable by default
Distros that whish to support old kernels should set
  --with-firmware-dirs="/usr/lib/firmware/updates:/usr/lib/firmware"
to retain the old behaviour.
2013-03-18 15:19:51 +01:00
Zbigniew Jędrzejewski-Szmek
24be982274 Remove or indent #define GNU_SOURCE
It is only needed in files designed to be usable in standalone
compilation. In those files the #ifdefinery is indented. When
compiling in-tree, GNU_SOURCE is always defined, so remove one
definition.
2013-03-11 18:03:13 -04:00
Rob Clark
bb26309dd0 udev: fix segfault with android rndis
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.
2013-03-03 19:02:36 +01:00
Kay Sievers
1d600df55b udev: remove database conversion code 2013-03-03 18:35:22 +01:00
Kay Sievers
3f60bcb5e6 udev: firmware - do not created /run/udev/firmware-missing/
The userspace firmware loader is deprecated now, and will be entirely
removed when we depend on a kernel version with the built-in firmware
loader available.
2013-03-03 18:31:52 +01:00
Kay Sievers
7962afbba9 udev: usb_id: parse only 'size' bytes of the 'descriptors' buffer 2013-02-17 21:16:56 +01:00
Kay Sievers
a2cbfd5916 udev: usb_id - ignore non-ASCII serial numbers
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
2013-02-17 21:16:08 +01:00
Zeeshan Ali (Khattak)
ddb5bee15a udev: expose new ISO9660 properties from libblkid 2013-02-17 02:47:17 +01:00
Harald Hoyer
a5c32cff1f honor SELinux labels, when creating and writing config files
Also split out some fileio functions to fileio.c and provide a SELinux
aware pendant in fileio-label.c

see https://bugzilla.redhat.com/show_bug.cgi?id=881577
2013-02-14 16:19:38 +01:00
Thomas Hindoe Paaboel Andersen
090be86534 use streq instead of strcmp 2013-02-13 18:14:20 +01:00
Thomas Hindoe Paaboel Andersen
b43d1d01ea util: introduce strcaseeq/strncaseeq 2013-02-13 00:56:13 +01:00
Thomas Hindoe Paaboel Andersen
641906e936 use strneq instead of strncmp 2013-02-13 00:56:13 +01:00
Kay Sievers
38d70045d1 udev: use unique names for temporary files created in /dev
On Tue, Feb 12, 2013 at 2:18 PM, Robert Milasan <rmilasan@suse.com> wrote:
> Under some circumstances udev mixed with multipath fails:
>
> udevd-work[1376]:
> symlink(../../sdk, /dev/disk/by-id/scsi-36005076305ffc0670000000000002842.udev-tmp)
> failed: File exists udevd-work[1432]:
> rename(/dev/disk/by-id/scsi-36005076305ffc0850000000000000a88.udev-tmp, /dev/disk/by-id/scsi-36005076305ffc0850000000000000a88)
> failed: No such file or directory
>
> This is non-fatal, but there is no point of created the symlink or
> renaming the symlink if it already exists.
>
> Reference: https://bugzilla.novell.com/show_bug.cgi?id=791503

It looke like this now:
  stat("/dev/disk/by-id", {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
  symlink("../../sda", "/dev/disk/by-id/ata-INTEL...N.tmp-b8:0") = 0
  rename("/dev/disk/by-id/ata-INTEL...N.tmp-b8:0", "/dev/disk/by-id/ata-INTEL...N") = 0
2013-02-12 16:08:14 +01:00
Harald Hoyer
a0ec302b93 cdrom_id: add data track count for bad virtual drive implementations
/# /lib/udev/cdrom_id --debug /dev/sr0
probing: '/dev/sr0'
INQUIRY: [AMI     ][Virtual CDROM   ][1.00]
GET CONFIGURATION failed with SK=5h/ASC=20h/ACQ=00h
drive is pre-MMC2 and does not support 46h get configuration command
trying to work around the problem
READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h
no current profile, but disc is present; assuming CD-ROM
READ TOC: len: 12, start track: 1, end track: 1
last track 1 starts at block 0
READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h
ID_CDROM=1
ID_CDROM_MEDIA=1
ID_CDROM_MEDIA_CD=1

What is missing here is ID_CDROM_MEDIA_TRACK_COUNT_DATA to trigger
blkid in /lib/udev/rules.d/60-persistent-storage.rules

KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*",
	ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*",
	ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \
		  IMPORT{builtin}="blkid --noraid"
2013-02-12 15:27:30 +01:00
Kay Sievers
3e49f2ecb5 udev: udevadm hwdb - add --root=
https://bugs.freedesktop.org/show_bug.cgi?id=60398
2013-02-08 12:00:05 +01:00
Kay Sievers
7850b3b837 shared: conf-files - add root parameter 2013-02-08 10:23:04 +01:00
Kay Sievers
beb23689e3 udev: remove HWDB_BIN 2013-02-07 21:54:49 +01:00
Martin Pitt
4dbcb1b3ba keymap: Add HP HDX 9494NR
Add touchpad and www keys.

https://bugzilla.redhat.com/show_bug.cgi?id=757928
2013-01-28 07:41:36 +01:00
Ayan George
c437b20d6e keymap: Add support for the brower hotkey on the HP ProBook
https://bugs.launchpad.net/bugs/1105191
2013-01-28 07:30:01 +01:00
Kay Sievers
22582bb2cb udev: set default rules permissions only at "add" events 2013-01-27 21:46:36 +01:00
Kay Sievers
25da63b9da udev: net_id - add link to the wiki page 2013-01-19 16:01:26 +01:00
Kay Sievers
f4ddacbd4d udev: net_id - suppress bcma core == 0 2013-01-17 03:30:07 +01:00
Kay Sievers
984c4348ff udev: net_id - handle "bcma" buses 2013-01-17 02:10:58 +01:00
Kay Sievers
59d86149b0 udev: path_id - clarify comment about the kernel ATA naming problem 2013-01-17 00:00:02 +01:00
Bastien Nocera
1d010426c0 udev: Fix device matching in the accelerometer
As we were searching by ID_PATH, it would have been possible
for us to find a sibling device instead of the device we were
looking for.

This fixes device matching on the WeTab with the upstream kernel,
as it was trying to use the "Asus Laptop extra buttons" device
instead of the accelerometer.
2013-01-10 14:28:48 +01:00
Thomas Hindoe Paaboel Andersen
b929bf049d tabs to spaces
Skipped bootchart and various files that looked like they should be
kept in sync with external sources.
2013-01-09 21:20:43 +01:00
Kay Sievers
d5a89d7dc1 udev: move string copy functions to shared/ 2013-01-09 19:06:46 +01:00
Lukas Nykryn
3c123e0899 udev: don't call fclose on NULL in is_pci_multifunction 2013-01-09 17:14:40 +01:00
Kay Sievers
72bc96f078 udev: net_id - skip stacked network devices 2013-01-08 14:54:12 +01:00
Kay Sievers
1328f66ad1 udev: net_id - append "dev_id" value if needed 2013-01-04 19:08:08 +01:00
Kay Sievers
48a849ee17 udev: set device node permissions only at "add" events 2013-01-04 16:15:46 +01:00
Kay Sievers
1edefa4f1d udev: in addition to DEVMODE, honor DEVUID, DEVGID from the uevent 2012-12-31 04:48:44 +01:00
Lukas Nykryn
5bbbe461fd udevd: add missing ':' to getopt_long 'e'
Parameter -e is set without additional argument in getopt
and this leads to segfault when calling 'systemd-udevd -e'.
2012-12-22 15:19:15 +01:00
Sami Kerola
23757887f7 licence: remove references to old FSF address
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57206
2012-12-17 11:41:31 +01:00
Kay Sievers
decd634e80 udev: net_id: update comments 2012-12-09 14:49:28 +01:00
Kay Sievers
971e7fb625 udev: net_id - fix OUI handling 2012-12-06 21:37:10 +01:00
Kay Sievers
0d6ce9236f udev: net_id - fix typos 2012-12-06 21:27:42 +01:00
Kay Sievers
ad37f393fa udev: net_id - update examples 2012-12-06 21:25:39 +01:00
Kay Sievers
f610d6de38 udev: net_id - update examples 2012-12-06 21:09:30 +01:00
Kay Sievers
0260944060 udev: net_id - provide path names for USB devices 2012-12-06 20:44:28 +01:00
Tom Gundersen
5fe25affc0 hwdb: add IAB to the OUI database
The individual address block is a poor man's organizationally unique
identifier.

Perhaps we should change the udev key from ID_OUI_FROM_DATABASE to
something like ID_IEEE_VENDOR_FROM_DATABASE?

Suggested-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-12-04 02:11:37 +01:00
Kay Sievers
137661d875 udev: net_id - clarify comments 2012-12-03 15:47:18 +01:00
Kay Sievers
472780d8b1 udev: hwdb - fix OUI lookup 2012-12-02 02:00:57 +01:00
Kay Sievers
de892aea1c udev: net_id - suppress function number for single-function devices 2012-11-30 19:27:42 +01:00
Martin Pitt
a5dea3d43b keymap: Add Samsung 700T
https://bugzilla.redhat.com/show_bug.cgi?id=879691
2012-11-28 21:33:26 +01:00
Alessandro Crismani
68c77c2f61 keymap: Update the list of Samsung Series 9 models
Currently, keymaps are provided only for the NP90X3A laptop. Samsung
introduced updated models, codenamed 900X3B, 900X3C, 900X4B, 900X4C,
which are currently not matched by udev rules. This patch includes the
newer modules in udev rules and move the samsung-n90x3a file defining
keys to a more generic samsung-series-9 file.

The patch was tested on a 900X4C laptop, and other people reported
that the rules also work for 900X3B and 900X3C ones.
2012-11-28 21:27:03 +01:00
Kay Sievers
5b8180d3f6 udev: net_id - merge properties into the correct device 2012-11-26 15:03:06 +01:00
Kay Sievers
0035597a30 udev: net_id - export PCI hotplug slot names 2012-11-26 14:07:16 +01:00
Kay Sievers
01d183ddae udev: net_id - read ACPI _SUN -- slot user number 2012-11-23 15:02:46 +01:00
Hannes Reinecke
a24d03b8ee udev: path_id - handle Hyper-V devices
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.
2012-11-23 14:12:39 +01:00
Tom Gundersen
e32a4e1ef4 hwdb: fix usage
--create is not a valid option.
2012-11-21 02:49:24 +01:00
Tom Gundersen
e30431623a build-sys: make loadable module support optional
kmod is unecessary if loadable module support is disabled in the kernel,
so make the dependency optional.
2012-11-20 19:35:27 +01:00
Kay Sievers
d23965a64e udev: net - add device naming properties 2012-11-20 18:10:45 +01:00
Kay Sievers
3fd0c4c66d udev: fix whitespace 2012-11-20 18:07:14 +01:00
Zbigniew Jędrzejewski-Szmek
ee623f0d0c hwdb: use $(localstatedir)/lib/udev/hwdb.bin for the binary database
It's not configuration, so it doesn't belong in udev.

Also, remove the catalog when uninstalling udev.
2012-11-16 23:29:56 +01:00
Umut Tezduyar
5bb633f13a udev: firmware - disable firmware loading when firmware file is 0 byte
If firmware file is not found in the file system, udev
terminates firmware loading. This is not the case if
firmware file exists in the file system but doesn't have
any data in it.
2012-11-16 17:07:19 +01:00
Anders Olofsson
f553b3b107 udev: make blkid optional
I'm building systemd for an embedded system and we would prefer not having
to include the entire util-linux package just to get a libblkid whose
functionality we don't need.
2012-11-16 01:17:18 +01:00
Kay Sievers
33c770b174 udev: hwdb - properly handle a missing database
On Thu, Nov 15, 2012 at 5:05 PM, Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> wrote:
> Something like this appeared with latest git:
>
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [364] terminated by signal 11 (Segmentation fault)
> Nov 15 16:55:46 fedora-15 [387]: Process 364 (systemd-udevd) dumped core.
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [364] failed while handling '/devices/virtual/net/lo'
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [360] terminated by signal 11 (Segmentation fault)
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [360] failed while handling '/devices/pci0000:00/0000:00:03.0/virtio0/net
> Nov 15 16:55:46 fedora-15 [389]: Process 360 (systemd-udevd) dumped core.
>
> Core was generated by usr/lib/systemd/systemd-udevd'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x0000000000423c87 in udev_hwdb_get_properties_list_entry (hwdb=0x0, modalias=0x7fffbcd155f0
2012-11-15 17:30:03 +01:00
Kay Sievers
bf9d233f78 udev: properly handle symlink removal by 'change' event
If a 'change' event is supposed to remove created symlinks, we create
a new device structure from the sysfs device and fill it with the list
of links, to compute the delta of the old and new list of links to apply.
If the device is already 'remove'd by the kernel though, udev fails to
create the device structure, so the links are not removed properly.

> From: Neil Brown <nfbrown@suse.com>
> Date: Thu, 8 Nov 2012 10:39:06 +0100
> Subject: [PATCH] If a 'change' event does not get handled by udev until
> after the device has subsequently disappeared, udev mis-handles
> it. This can happen with 'md' devices which emit a change
> event and then a remove event when they are stopped. It is
> normally only noticed if udev is very busy (lots of arrays
> being stopped at once) or the machine is otherwise loaded
> and reponding slowly.
>
> There are two problems.
>
> 1/ udev_device_new_from_syspath() will refuse to create the device
>    structure if the device does not exist in /sys, and particularly if
>    the uevent file does not exist.
>    If a 'db' file does exist, that is sufficient evidence that the device
>    is genuine and should be created.  Equally if we have just received an
>    event from the kernel about the device, it must be real.
>
>    This patch just disabled the test for the 'uevent' file, it doesn't
>    try imposing any other tests - it isn't clear that they are really
>    needed.
>
> 2/ udev_event_execute_rules() calls udev_device_read_db() on a 'device'
>    structure that is largely uninitialised and in particular does not
>    have the 'subsystem' set.  udev_device_read_db() needs the subsystem
>    so it tries to read the 'subsystem' symlink out of sysfs.  If the
>    device is already deleted, this naturally fails.
>    udev_event_execute_rules() knows the subsystem (as it was in the
>    event message) so this patch simply sets the subsystem for the device
>    structure to be loaded to match the subsystem of the device structure
>    that is handling the event.
>
> With these two changes, deleted handling of change events will still
> correctly remove any symlinks that are not needed any more.

Use udev_device_new() instead of allowing udev_device_new_from_syspath()
to proceed without a sysfs device.
2012-11-13 02:14:17 +01:00
Thomas Hindoe Paaboel Andersen
33b4055123 remove duplicate semicolons 2012-11-12 22:38:44 +01:00
Kay Sievers
1298001ec5 use the same email address everywhere 2012-11-12 19:47:43 +01:00
Kay Sievers
40fe8b11be udev: use usec_t and now() 2012-11-12 01:03:14 +01:00
Kay Sievers
a660c63c55 udev: net_id - add builtin to retrieve data for network devices 2012-11-09 13:05:19 +01:00
Kay Sievers
59803c380d udev: hwdb - search parents for 'modalias' and data 2012-11-09 13:05:11 +01:00
Kay Sievers
c3cfed0d6c udev: update file headers 2012-11-09 12:39:27 +01:00
Kay Sievers
3a4431ef72 udev: break over-long lines 2012-11-02 00:32:10 +01:00
Kay Sievers
23b7245397 udev: add "udevadm hwdb --test=<modalias>" 2012-10-28 04:41:15 +01:00
Kay Sievers
ff944daa01 udev: get rid of SYSCONFDIR 2012-10-28 04:04:22 +01:00
Kay Sievers
2001208c2a libudev: import hwdb and export lookup interface 2012-10-27 23:39:41 +02:00
Martin Pitt
221a6c2a26 keymap: Add HP EliteBook 8440p
Thanks to Glen Ditchfield <gjditchfield@acm.org>!

https://launchpad.net/bugs/1071579
2012-10-26 06:31:14 +02:00
Kay Sievers
4af113f997 udev: builtin - do not fail builtin initialization if one of them returns an error 2012-10-26 03:45:25 +02:00
Kay Sievers
a9f4815da5 udev: kmod - fix typo 2012-10-26 00:36:32 +02:00
Kay Sievers
5b4d50efe8 udev: kmod, hwdb - do not fail if databases are not available 2012-10-25 22:58:02 +02:00
Kay Sievers
3b0a5f2023 udev: hwdb - exit if no database is available 2012-10-25 22:22:29 +02:00
Kay Sievers
7ee40fc3e9 udev: hwdb validate() return when the database is not opened 2012-10-25 22:08:33 +02:00
Kay Sievers
1c574591db udev: hwdb - remove run_once 2012-10-25 21:44:33 +02:00
Kay Sievers
c225f2ffc8 udev: hwdb - properly initialize search structure 2012-10-25 21:44:33 +02:00
Kay Sievers
e5f2783e73 udev: set optind = 0, not the usual 1, to reset getopt_long()s internal state 2012-10-25 21:31:38 +02:00
Kay Sievers
796b06c21b udev: add hardware database support 2012-10-23 16:43:32 +02:00
Kay Sievers
915bf0f60f udev: use strbuf to store rules strings 2012-10-22 16:28:04 +02:00
Martin Pitt
accfdb7abf keymap: Tolerate invalid entries in keymaps
Some keymaps apply to a large range of computer models, not all of which have
all of the scan codes in the maps. If a single scan code is invalid, do not
abort but continue with the next entry in the map. Instead just show the error
message for that particular scan code, to help with debugging.
2012-10-19 08:05:58 +02:00
Martin Pitt
3bb9434b69 keymap: Fix parsing of hex scan codes in tables
Commit b1f87c76b1 changed sscanf from %i to %u, as scan codes are unsigned
numbers which can be > 0x7FFFFFFF. However, sscanf doesn't accept hexadecimal
numbers for %u. It works fine with %i, so revert this back.
2012-10-19 08:01:47 +02:00
Martin Pitt
6e303b233b README.keymap.txt: Drop fdi2rules.py documentation
This was removed ages ago.
2012-10-19 07:41:09 +02:00
Sebastian Ott
4ecc131848 udev: path_id - add scm support
Add support for scm block devices. Introduced here:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=f30664e2

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
2012-10-11 22:26:54 +02:00
Martin Pitt
b1f87c76b1 keymap: Fix scan codes > 0x7FFFFFFF
According to Linux drivers/input/evdev.c, scan codes are unsigned, not int nor
uint32_t.

Thanks to Dejan Tosovic <dejan@post.com> for reporting this!
2012-10-10 18:56:01 +02:00
Kay Sievers
07845c142b udev: support multiple entries for ENV{SYSTEMD_ALIAS} and ENV{SYSTEM_WANTS} 2012-10-09 00:16:50 +02:00
Kay Sievers
8a1733871f udev: remove SYMLINK "unique" option 2012-10-08 21:54:39 +02:00
Kay Sievers
ea6039a309 udev: allow firmware requests to bypass the dependency tracking
The removal of the TIMEOUT= handling in udevd put firmware requests into the
devpath parent/child dependency tracking. Drivers which block in module_init()
asking userspace for firmware ran into a 30 sec device timeout.

The whole firmware loading willl hopefully move into the kernel and
the fragile-since-day-one fake async driver-core device dance involving
udev can be retired:
  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=abb139e75c2cdbb955e840d6331cb5863e409d0e
2012-10-07 18:22:14 +02:00
Robert Milasan
2cf598fe02 udev: collect - use snprintf() 2012-09-27 15:51:58 +02:00
Lukas Nykryn
9c513fe009 udev: free fd before return in accelerometer.c 2012-09-23 14:24:44 +02:00
Lukas Nykryn
ab261e1226 udev: free fd before return in scsi_serial.c 2012-09-23 14:24:43 +02:00
Václav Pavlín
0820a4f0f6 udev: free rule structure on error 2012-09-23 14:24:43 +02:00
Václav Pavlín
cb32f0141e udev: check return value of write 2012-09-23 14:24:43 +02:00
Václav Pavlín
6bb2f0a08a udev: check return value of symlink 2012-09-23 14:24:43 +02:00
Václav Pavlín
8dc8ef598d udev: check malloc return in collect/collect.c
Returns from no memory checks updated with log_oom call
2012-09-23 14:24:43 +02:00
Kay Sievers
0bb91b5010 udev: add btrfs support
All "btrfs" file systems will be registered with the kernel when they
show up.

Incomplete multi-device volumes will set SYSTEMD_READY=0, to prevent
access until the volume is complete and fully registered.
2012-09-17 13:54:03 +02:00
Thomas Hindoe Paaboel Andersen
c53158818d man: fix a bunch of typos in docs
https://bugs.freedesktop.org/show_bug.cgi?id=54501
2012-09-13 19:34:24 +02:00
Lennart Poettering
01ed0e2307 dev-setup: make NULL as parameter for dev_setup() equivalent to "" 2012-08-21 17:23:03 +02:00
Dave Reisner
8f0e73f250 dev-setup: allow a path prefix for use in chroots
With this adjustment, we can reuse this code elsewhere, such as in
nspawn.
2012-08-21 17:19:35 +02:00
Kay Sievers
45b51b6b71 keymap: fix map name reference 2012-08-16 21:00:06 +02:00
Martin Pitt
405053fafa keymap: Add Sony VGN
https://launchpad.net/bugs/939868
2012-08-15 08:46:03 +02:00
Kay Sievers
dbf61afb29 udev: export udev_device_new_from_device_id() 2012-08-10 19:56:57 +02:00
Kay Sievers
238b53a024 udev: fix typo in copyright 2012-08-08 18:24:50 +02:00
Kay Sievers
7781e063e8 udev: re-initialize builtins in the daemon process, not in the worker 2012-08-08 16:27:11 +02:00
Kay Sievers
3b8c1cb01f udev: initialize rules dir timestamps when reading rules
On Wed, Aug 8, 2012 at 11:48 AM, Michael Schroeder <mls@suse.de> wrote:
> if rules are installed in the first 3 seconds after the udev start,
> the stamps will all be zero, so the [first] call to check_rules_timestamp()
> will just copy the current mtime [and not cause a rules re-load].
2012-08-08 14:45:16 +02:00
Martin Pitt
c672070ca9 keyboard-force-release: Fix previous commit
Was missing a * for the globbing.
2012-08-03 13:52:48 +02:00
Martin Pitt
d4c44191b7 keyboard-force-release: Apply to all Fujitso AMILO models
https://launchpad.net/bugs/1011323 reports more AMILO models which need this
quirk; enough to assume that all of them need it, and applying it on working
models does not really hurt.
2012-08-03 13:50:46 +02:00
Kay Sievers
1c7dfbf249 udev: path_id - add comment about the unrteliable rebase logic 2012-08-03 10:52:24 +02:00
Kay Sievers
023b9d33e9 udev: set log.c's log level from udev's kernel command line option 2012-07-30 22:34:07 +02:00
Kay Sievers
02aee10881 udev: add missing newline when writing to /dev/kmsg 2012-07-30 17:21:22 +02:00
Kay Sievers
e239cd8de0 udev: cdrom_id, accelerometer - enable debug output for --debug 2012-07-26 12:03:25 +02:00
Shawn Landden
0d0f0c50d3 log.h: new log_oom() -> int -ENOMEM, use it
also a number of minor fixups and bug fixes: spelling, oom errors
that didn't print errors, not properly forwarding error codes,
few more consistency issues, et cetera
2012-07-26 11:48:26 +02:00
Shawn Landden
669241a076 use "Out of memory." consistantly (or with "\n")
glibc/glib both use "out of memory" consistantly so maybe we should
consider that instead of this.

Eliminates one string out of a number of binaries. Also fixes extra newline
in udev/scsi_id
2012-07-25 11:23:57 +02:00
Terence Honles
f84b1a8c3a keymap: Broaden ThinkPad X2.. tablet match to also apply to X230
https://bugs.freedesktop.org/show_bug.cgi?id=52371
2012-07-23 06:32:46 +02:00
Zbigniew Jędrzejewski-Szmek
d91b8841d7 collect, keymap, systemctl: use _noreturn_ 2012-07-22 23:53:48 +02:00
Kay Sievers
2a3fe9a759 udev: path_id - export path for platform block devices
Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
>
> E.g. I have a platform with two sdhci controllers with different purposes.
> First slot is an external slot while second one is internal with a
> non-removable card.
>
> When there is a card in the external slot at boot, the non-removable card is
> named 'mmcblk1'; without the external card it is 'mmcblk0'.  Vice versa for the
> external card.

https://bugs.freedesktop.org/show_bug.cgi?id=52309
2012-07-20 16:01:13 +02:00
Kay Sievers
39177382a4 udev: firmware - do not cancel requests in the initrd 2012-07-19 12:33:30 +02:00
Rex Tsai
94469041d9 keymap: Add Dell Latitude force-release quirk
Signed-off-by: Martin Pitt <martinpitt@gnome.org>
2012-07-18 11:47:13 +02:00
Kay Sievers
fdc0d8468a Revert "keymap: add --version option"
This reverts commit d8f173fd2e.
2012-07-17 16:39:14 +02:00
Zbigniew Jędrzejewski-Szmek
d8f173fd2e keymap: add --version option 2012-07-17 16:34:30 +02:00
Kay Sievers
4cb72937d3 udev: get rid of TEST_PREFIX and use unshare() to fake /sys, /dev, /run 2012-07-15 22:10:46 +02:00
Kay Sievers
c6eefe3664 udev: avoid creating /dev/kmsg with fopen() to support CONFIG_PRINTK=n 2012-07-14 00:33:59 +02:00
Lennart Poettering
4b2615684b log: correct usage of logging API at a few places 2012-07-13 15:45:45 +02:00
Kay Sievers
2be7287b0e udev: never touch device nodes with symlink requests 2012-07-09 18:13:41 +02:00
Kay Sievers
97595710b7 udev: network device renaming - immediately give up if the target name isn't available 2012-07-05 17:40:50 +02:00
Kay Sievers
47ef94ac5f udev: add some O_CLOEXEC 2012-07-05 17:33:24 +02:00
Kay Sievers
daa9cf546c udev: ata_id - fixup all 8 not only 6 bytes of the fw_rev string
The last two digits are in the wrong order:
  $ hdparm -I /dev/sda | grep Revision
  4PC10362

  $ /lib/udev/ata_id -x /dev/sda | grep REVISION
  4PC10326
2012-07-05 16:56:58 +02:00
Lennart Poettering
c9bc076461 mount-setup: don't complain if we try to fix the label of a dir beneath a mount but can't due to EROFS 2012-07-03 16:25:50 +02:00
Kay Sievers
ef8a2bf648 udev: static nodes - fix default permissions if no rules is given
<falconindy> kay: just curious -- it looks like nodes created by udev from
  modules.devname all have 000 perms, and there's nothing in udev that attempts
  to change this. is it intended?
<falconindy> c---------   1 root root     10, 223 Jul  1 23:10 uinput
<kay> falconindy: we might miss the default of 0600
<falconindy> seems like it
<kay> falconindy: stuff that has a rule works i guess
<kay> falconindy: i'll add the 0600 now
2012-07-02 20:45:59 +02:00
Dave Reisner
ddbe6850b2 udevd: fix bogus mkdir invocation
The filename parameter passed to mkdir can't contain anything but a
garbage value at this point. This was meant to be the full pathname to
the new udev DB, as the mkdir_parents() call before it won't create the
trailing child directory.

[replace mkdir_parents() + mkdir() with mkdir_p() -- kay]
2012-07-02 03:09:18 +02:00
Dave Reisner
b80680eda9 udevd: use ROOTPREFIX to create path to modules.devname 2012-07-02 03:04:24 +02:00
Kay Sievers
72a2af7aa9 udev: use the matching binary name "systemd-udevd" in log messages 2012-06-27 15:29:55 +02:00
Kay Sievers
4f5d327a49 udev: support "udevadm info /dev/sda; udevadm info /sys/class/block/sda" 2012-06-10 22:53:07 +02:00
Kay Sievers
3cbd5f6be1 udev: remove remaining selinux labeling for file in /run 2012-06-05 17:31:32 +02:00
Kay Sievers
e6f86cac16 udev: kernel cmdline - accept rd.* parameters 2012-06-04 22:46:32 +02:00
Kay Sievers
145dae7eb3 udev: reset /proc/self/oom_score_adj in worker processes
Only the main daemon process should be excluded from OOM handling,
not the worker processes or their child processes.
2012-06-04 18:10:50 +02:00
Kay Sievers
d315bba6f6 udev: limit minimum worker count to 16 2012-06-04 16:40:31 +02:00
Lauri Kasanen
a52289f7f5 udev: lower the starting children_max -> drop the minimum required RAM from 23mb to 5mb
Udev was the limiting factor for us on low-RAM systems.
Given an average RSS of 180kb, 128 workers would require ~23mb of RAM.

Now, please consider what happens when there is only, say, 15mb free.
Udev protects itself from OOM, and the kernel can do nothing but panic.

28 workers * 0.18mb = ~5mb. This change should not affect more powerful
systems much, given that they still get the addition from the amount of RAM.
2012-06-04 16:02:33 +02:00
Dave Reisner
ae5b21eaba keymaps: keyboard-force-release - fix shebang
This script will still run without the shebang, but we won't get the
intended effect of the errexit flag in the interpreter line.
2012-06-04 12:43:31 +02:00
Dave Reisner
7ff5404be1 keymaps: replace dir tokens in keyboard-force-release
Use the correct udev libexec dir as well, not systemd's.
2012-06-02 21:39:39 +02:00
Kay Sievers
0f9963a8b8 Revert "label: fix systemd-udev labeling of /run directory."
This reverts commit 9b5af248f0.

Udev now explicitely labels only files/directories in /dev. The selinux
array API is not released and will not work on other distros at this moment.
2012-05-31 13:34:41 +02:00
Kay Sievers
667e392408 udev: do not selinux label files in /run/udev 2012-05-31 13:20:06 +02:00
Kay Sievers
d2e54fae5c mkdir: append _label to all mkdir() calls that explicitly set the selinux context 2012-05-31 12:40:20 +02:00
Daniel J Walsh
9b5af248f0 label: fix systemd-udev labeling of /run directory.
systemd-udev is currently incorrectly labeling /run/udev/* content because it is
using selinux prefix labeling of /dev.  This patch will allow systemd-udev to
use prefix labeling of /dev and /run.
2012-05-31 01:43:27 +02:00
Kay Sievers
da5d4bf64f udev: skip timestamp check if rules are already free()d during reload 2012-05-31 01:17:59 +02:00
Tom Gundersen
392f9c8404 udev.pc: install udev files to /lib/udev rather than /lib/systemd 2012-05-27 15:24:20 +02:00
Jean Delvare
9159b90a4f scsi_id: fix truncated model in by-id device links
Do not forget the leading "S" when appending the serial number,
otherwise we chop the last character of the model name.

Addresses: https://bugzilla.novell.com/show_bug.cgi?id=763397
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-27 15:15:47 +02:00
Kay Sievers
ee56538fa7 udev: silent gcc warnings 2012-05-25 14:25:46 +02:00
Maxim A. Mikityanskiy
0b270320da keymap: support for Lenovo IdeaPad Z570 keyboard 2012-05-22 02:11:21 +02:00
Martin Pitt
0e5ba4e782 keymap: Add Mio N890
https://launchpad.net/bugs/998621
2012-05-14 13:06:48 +02:00
Kay Sievers
9e055fb8fc udev: path_id - cciss - set "we have a bus" flag 2012-05-10 21:35:54 +02:00
Hannes Reinecke
68acb21d79 udev: path_id - add cciss support 2012-05-10 14:03:49 +02:00
Kay Sievers
9eb977db5b util: split-out path-util.[ch] 2012-05-08 02:33:10 +02:00
Kay Sievers
2c21044f05 util: split-out conf-file.[ch] 2012-05-07 19:01:24 +02:00
Kay Sievers
7fdd367e6d udev: path_id - skip PCI-only-parents for block devices 2012-05-07 18:47:58 +02:00
Kay Sievers
775f8b3c74 udev: use conf_files_list() to search rules files 2012-05-07 13:21:05 +02:00
Kay Sievers
395ea97815 udev: fix the ENV{} blacklist logic 2012-05-04 02:29:36 +02:00
Lucas De Marchi
b27ee00bf5 udev: use container_of() macro 2012-04-29 19:15:08 +02:00
Kay Sievers
c693ccc0a2 udev: use only oom_score_adj interface 2012-04-26 01:49:15 +02:00
Kay Sievers
5ba2dc259f udev: unify /dev static symlink setup 2012-04-17 22:31:38 +02:00
Kay Sievers
018ef268b1 silence a bunch of gcc warnings 2012-04-17 18:42:09 +02:00
Kay Sievers
e9a5ef7cdd selinux: unify systemd and udev code 2012-04-17 16:05:28 +02:00
Kay Sievers
3b49d09a3d udev: kill udev_selinux_setfscreateconat() 2012-04-17 02:20:32 +02:00
Kay Sievers
9e13dbae50 udev: replace util_create_path() with mkdir_parents() 2012-04-17 01:09:39 +02:00
Kay Sievers
33502ffe2e udev: use startswith() and streq() 2012-04-16 20:54:17 +02:00
Kay Sievers
6ada823a9a udev: remove configuration options for /dev, /sys, /run directories 2012-04-16 19:20:57 +02:00
Kay Sievers
8fef0ff25c udev: replace ARRAY_SIZE() with ELEMENTSOF() 2012-04-16 19:20:57 +02:00
Kay Sievers
194bbe3338 udev: cleanup the udev cgroup when the daemon enters the idle state 2012-04-15 03:11:08 +02:00
Kay Sievers
20d83f2f43 udev: move all unconditionally installed rules to rules/ 2012-04-14 20:10:03 +02:00
Kay Sievers
8ea5c07b1c udev: keymap - move src/udev/force-release-maps/ to keymaps-force-release/ 2012-04-14 19:53:31 +02:00
Kay Sievers
0b87a07761 udev: test - move test/ and src/test/ 2012-04-14 19:36:47 +02:00
Kay Sievers
5f86ae4385 update .gitignore 2012-04-13 21:49:25 +02:00
Lennart Poettering
b562f5a57d build-sys: add stub makefiles to all subdirs to ease development with emacs 2012-04-13 21:37:59 +02:00
Kay Sievers
bb061708d5 udev: move libudev, gudev to src/; move gudev/docs/, udev/docs/ to to docs/ 2012-04-13 19:22:06 +02:00
Martin Pitt
a417efcd33 keymap: Add HP Compaq Presario CQ*
https://launchpad.net/bugs/935804
2012-04-13 17:19:01 +02:00
Martin Pitt
84f4fc4215 keymap: Add Dell XPS force-release quirk
https://launchpad.net/bugs/910911
2012-04-13 17:17:22 +02:00
Kay Sievers
9b80f05fb7 udev: unpack sysfs test tree only on 'make check'; fix test-udev binary location 2012-04-13 15:57:13 +02:00
Kay Sievers
56d35ff9ca udev: keymap - move data files to root directory 2012-04-13 15:38:15 +02:00
Kay Sievers
b49d9b50cf udev: fix a few issues detected by the llvm static analyzer 2012-04-13 15:10:12 +02:00
Kay Sievers
5e6f883dfc udev: keymap - remove weird 'c2 a0' character sequences which break the check
$ hexdump -C  src/udev/keymap/keymaps/samsung-90x3a
00000000  30 78 39 36 20 6b 62 64  69 6c 6c 75 6d 75 70 c2  |0x96 kbdillumup.|
00000010  a0 c2 a0 c2 a0 c2 a0 c2  a0 c2 a0 c2 a0 c2 a0 20  |............... |
00000020  23 20 46 6e 2b 46 38 20  6b 65 79 62 6f 61 72 64  |# Fn+F8 keyboard|
2012-04-12 01:04:30 +02:00
Kay Sievers
e885455641 udev: check-keymaps.sh - fix source directory 2012-04-12 00:09:13 +02:00
Kay Sievers
4590cfe455 udev: fix RUN+= logic regarding builtin vs. program 2012-04-11 22:34:25 +02:00
Kay Sievers
04a9d3a00a udev: fix gcc warnings showing up after adding $(AM_CFLAGS) 2012-04-10 17:27:46 +02:00
Kay Sievers
304b9f3078 udev: set errno = ENOSYS for removed interfaces 2012-04-10 13:33:43 +02:00
Kay Sievers
2d13da8821 udev: remove RUN+="socket:.." and udev_monitor_new_from_netlink() 2012-04-09 21:18:30 +02:00
Kay Sievers
83cd6b754b udev: convert 'uaccess' to a builtin 2012-04-09 19:25:41 +02:00
Kay Sievers
f1ff47be17 udev: keymap: remove rootprefix mangling from script 2012-04-08 17:10:03 +02:00
Kay Sievers
1c0f62e37b udev: fix test-udev binary 2012-04-08 17:03:17 +02:00
Kay Sievers
07cd4fc168 udev: remove support for /lib/udev/devices/; tmpfiles should be used 2012-04-08 16:50:16 +02:00
Tom Gundersen
58db57fedf udev: fix rules sort order
Commit 91418155ae moved around the code,
but did not chang ethe array index.
2012-04-08 16:09:42 +02:00
Kay Sievers
baa30fbc2c udev: switch to systemd logging functions 2012-04-08 16:06:20 +02:00
Kay Sievers
54cf0b7fa6 udev: replace UDEV_EXPORT with _public_ 2012-04-04 13:30:09 +02:00
Kay Sievers
51fc11c10d udev: ata_id - remove assert() until we switch over to systemd logging 2012-04-04 13:29:37 +02:00
Kay Sievers
0c9507fe24 udev: enable logging 2012-04-04 13:14:29 +02:00
Ayan George
a985a8f547 keymap: Add support for Lenovo v480 touchpad toggle hotkey.
Signed-off-by: Martin Pitt <martinpitt@gnome.org>
2012-04-04 08:38:38 +02:00
Kay Sievers
4b0060e68b udev: fix gcc warnings 2012-04-04 05:31:21 +02:00
Kay Sievers
fc863deada udev: fix gcc warnings 2012-04-04 05:21:35 +02:00
Kay Sievers
3e2147858f move imported udev into place 2012-04-04 05:05:07 +02:00
Kay Sievers
19c5f19d69 import udev repository 2012-04-03 21:08:04 +02:00