Commit Graph

10196 Commits

Author SHA1 Message Date
Mantas Mikulėnas
e950313484 rules: net-setup-link - remove stray linebreak
If not backslash-escaped, it splits the rule in two.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-10 21:06:17 -04:00
Tom Gundersen
30a0c571a9 rules: net-setup-link - preserve ID_NET_LINK_FILE and ID_NET_NAME after MOVE
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-10 21:05:42 -04:00
Marcel Holtmann
c0bd83237e hwdb: update
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-10 21:01:57 -04:00
Marcel Holtmann
8da8c2123c hwdb: Update database of Bluetooth company identifiers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-08 07:16:19 -04:00
Amadeusz Sławiński
1e0ad7de19 src/libudev/Makefile.am: link libudev against selinux
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-03 06:28:16 -04:00
Amadeusz Sławiński
390e0c7ba0 src/shared/label.c: include selinux headers
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-09-02 17:31:39 -04:00
Kay Sievers
d8876913e8 udev: bump event timeout to 60 seconds
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-01 09:08:47 -04:00
David Herrmann
820c792432 shared: make container_of() use unique variable names
If you stack container_of() macros, you will get warnings due to shadowing
variables of the parent context. To avoid this, use unique names for
variables.

Two new helpers are added:
  UNIQ: This evaluates to a truly unique value never returned by any
        evaluation of this macro. It's a shortcut for __COUNTER__.
  UNIQ_T: Takes two arguments and concatenates them. It is a shortcut for
          CONCATENATE, but meant to defined typed local variables.

As you usually want to use variables that you just defined, you need to
reference the same unique value at least two times. However, UNIQ returns
a new value on each evaluation, therefore, you have to pass the unique
values into the macro like this:

    #define my_macro(a, b) __max_macro(UNIQ, UNIQ, (a), (b))
    #define __my_macro(uniqa, uniqb, a, b) ({
                typeof(a) UNIQ_T(A, uniqa) = (a);
                typeof(b) UNIQ_T(B, uniqb) = (b);
                MY_UNSAFE_MACRO(UNIQ_T(A, uniqa), UNIQ_T(B, uniqb));
        })

This way, MY_UNSAFE_MACRO() can safely evaluate it's arguments multiple
times as they are local variables. But you can also stack invocations to
the macro my_macro() without clashing names.

This is the same as if you did:

    #define my_macro(a, b) __max_macro(__COUNTER__, __COUNTER__, (a), (b))
    #define __my_macro(prefixa, prefixb, a, b) ({
                typeof(a) CONCATENATE(A, prefixa) = (a);
                typeof(b) CONCATENATE(B, prefixb) = (b);
                MY_UNSAFE_MACRO(CONCATENATE(A, prefixa), CONCATENATE(B, prefixb));
        })

...but in my opinion, the first macro is easier to write and read.

This patch starts by converting container_of() to use this new helper.
Other macros may follow (like MIN, MAX, CLAMP, ...).

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-27 22:13:34 -04:00
David Herrmann
1911ef72db udev: add missing new-line in udevadm error
fprintf() does not add new-lines automatically like log_*() does. Add the
missing \n specified so "udevadm" invoked without arguments adds a newline
to:
    udevadm: missing or unknown command

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-27 21:45:11 -04:00
Kay Sievers
7a2f160498 udev: hwdb - do not look at "usb_device" parents
Based on a patch from Simon McVittie <simon.mcvittie@collabora.co.uk>.

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758050

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-27 21:44:02 -04:00
Martin Pitt
e7adcb6331 keymap: Adjust for more Samsung 900X4 series
Reportedly also applies to NP900X4B, so relax the match to apply to all models
of this series.

https://launchpad.net/bugs/902332

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-27 21:42:26 -04:00
Andrei Borzenkov
534b690568 Document "...|..." udev match syntax
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-27 21:41:14 -04:00
Lennart Poettering
c1402fc744 util: change return value of startswith() to non-const
This way we can use it on non-const strings, and don't end up with a
const'ified result.

This is similar to libc's strstr() which also takes a const string but
returns a non-const one.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-22 08:04:30 -04:00
Lennart Poettering
e8011305b2 util: change return value of startswith() to non-const
This way we can use it on non-const strings, and don't end up with a
const'ified result.

This is similar to libc's strstr() which also takes a const string but
returns a non-const one.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-22 08:04:30 -04:00
Anthony G. Basile
0f90b52d51 configure.ac and src/libudev/Makefile.am: bump to 1.10 = upstream 216
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-22 08:03:24 -04:00
Lennart Poettering
bec26f61fb update hwdb
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-21 06:44:11 -04:00
Anthony G. Basile
bdba4ea0e6 src/scsi_id/Makefile.am,test/Makefile.am: fix build on debian jessie, issue #97
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-18 16:05:43 -04:00
Anthony G. Basile
60753094b3 src/shared/mkdir.h: add missing func prototype
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-17 14:50:46 -04:00
Anthony G. Basile
9ca55798cd src/shared/path-util.c: revert change from realpath to canonicalize_file_name
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-14 18:36:22 -04:00
Anthony G. Basile
6328540098 src/shared: some stylistic changes
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-14 18:36:15 -04:00
Anthony G. Basile
03070edd5c src/shared: import more code cleanups from upstream
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-14 18:12:43 -04:00
Anthony G. Basile
28744043fb src/shared: import many code cleanups from upstream
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-14 11:28:47 -04:00
Anthony G. Basile
819fb6029d src/shared/cgroup-util.c: code cleanup following upstream
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-13 10:46:50 -04:00
Lennart Poettering
37de898653 udev: modernize net_id builtin a bit
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-12 14:14:28 -04:00
Lennart Poettering
c597413eb3 udev: never bypass our own logging framework and call vsyslog() directly from udev tools
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-12 14:14:22 -04:00
Zbigniew Jędrzejewski-Szmek
ba33e83c5a hwdb: update format description and document reloading
https://bugs.freedesktop.org/show_bug.cgi?id=82311

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-11 07:39:29 -04:00
Anthony G. Basile
d97aec9c40 src/libudev/libudev.sym: mark most symbols as hidden
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-06 09:18:11 -04:00
blueness
cb2823bc02 Merge pull request #96 from gentoo/refactor-shared
src/shared: refactor shared code
2014-08-06 06:36:03 -04:00
Anthony G. Basile
b1ac60946d src/shared: refactor shared code
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 19:22:24 -04:00
Anthony G. Basile
4b8733ffe9 src/{libudev,udev}: minor renamings from upstream 2014-08-05 17:03:25 -04:00
Anthony G. Basile
e35ef44ebe test: use _cleanup_ attribute
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 10:46:11 -04:00
Anthony G. Basile
32ac962335 m4/gtk-doc.m4: update to serial 2
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 10:23:10 -04:00
Anthony G. Basile
d527e17812 docs/gudev/gudev-sections.txt: add two missing functions
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 10:14:50 -04:00
Anthony G. Basile
602fd80cd6 rules: bring up to date
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 10:14:50 -04:00
Anthony G. Basile
dc54fb8a24 src/libudev/missing.h: clean up unused BTRFS_* decls
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 10:14:45 -04:00
Anthony G. Basile
96f70f054e src/collect/collect.c: remove excessive error reporting
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 09:27:15 -04:00
Martin Pitt
60728b7c12 keymap: Fix HP Pavillon DV7
Properly disable scan code 94 instead of producing KEY_0.

https://launchpad.net/bugs/1322770

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 08:50:07 -04:00
Martin Pitt
4d541b2608 udev-builtin-keyboard: Allow numeric key codes
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-05 08:48:39 -04:00
Kay Sievers
d9a9899974 udev: path_id - suppress ID_PATH for devices with an unknown parent device type
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1321816

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 08:48:05 -04:00
Zbigniew Jędrzejewski-Szmek
d8808bc082 Unify parse_argv style
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-05 08:38:32 -04:00
Anthony G. Basile
ba3e123a22 Include missing.h in udev-builtin-btrfs.c, and move BTRFS_IOC_DEVICES_READY 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-05 08:32:35 -04:00
Zbigniew Jędrzejewski-Szmek
93bc913f14 man: add udev.conf(5)
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-04 11:54:48 -04:00
Zbigniew Jędrzejewski-Szmek
5f63fcb010 Reject invalid quoted strings
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-08-04 11:52:34 -04:00
Zbigniew Jędrzejewski-Szmek
837a0df028 Fix misuse of uint64_t as size_t
They have different size on 32 bit, so they are really not interchangable.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-04 10:11:12 -04:00
Tom Gundersen
00dbb96b4a libudev: set errno when udev_device_new_from_* or udev_device_get_parent_* fail
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-04 10:09:07 -04:00
Kay Sievers
d97bc57bad hwdb/ids-update.pl: bring up to date with upstream.
This includes pieces of the following commits:

    d060b62fcb4746d3758c567e9379c6728a035b66
    bd63a88fb0478da2e93c363849b73aed8be36ae7

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-04 10:06:05 -04:00
Kay Sievers
9ef02bd6f4 hwdb: update
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-04 10:01:31 -04:00
Martin Pitt
daab6c9ae9 keymap: Annotate all micmute workarounds
Add a comment to all assignments to f20 that this actually should be "micmute"
in a future when we aren't limited by X.org's key code limiations any more.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-04 09:59:46 -04:00
Hui Wang
5a3a66d76c keymap: Add microphone mute keymap for Dell Latitude
On the Dell Latitude, the mic mute key event is generated by wmi
driver, the keycode assigned to this hotkey from kernel is
KEY_MICMUTE (248), this keycode is too big for xorg to handle,
in the xorg, the XF86AudioMicMute is assigned to F20.

Please refer to 4e648ea0 of xkeyboard-config.

BugLink: https://bugs.launchpad.net/bugs/1326684
BugLink: https://bugs.launchpad.net/bugs/1339998
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-04 09:59:02 -04:00
Hannes Reinecke
de02265b5a udev: fixup commit dd5eddd28a74a49607a8fffcaf960040dba98479
Commit dd5eddd28a74a49607a8fffcaf960040dba98479 accidentally
removed one line too many.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-07-30 09:47:41 -04:00