1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00
Commit Graph

19948 Commits

Author SHA1 Message Date
David Herrmann
cfe561a456 hashmap: return NULL from destructor
We _always_ return NULL from destructors to allow direct assignments to
the variable holding the object. Especially on hashmaps, which treat NULL
as empty hashmap, this is pretty neat.
2015-04-11 13:14:41 +02:00
Daniel Drake
07ba8037bf udevd: fix synchronization with settle when handling inotify events
udev uses inotify to implement a scheme where when the user closes
a writable device node, a change uevent is forcefully generated.
In the case of block devices, it actually requests a partition rescan.

This currently can't be synchronized with "udevadm settle", i.e. this
is not reliable in a script:

 sfdisk --change-id /dev/sda 1 81
 udevadm settle
 mount /dev/sda1 /foo

The settle call doesn't synchronize there, so at the same time we try
to mount the device, udevd is busy removing the partition device nodes and
readding them again. The mount call often happens in that moment where the
partition node has been removed but not readded yet.

This exact issue was fixed long ago:
http://git.kernel.org/cgit/linux/hotplug/udev.git/commit/?id=bb38678e3ccc02bcd970ccde3d8166a40edf92d3

but that fix is no longer valid now that sequence numbers are no longer
used.

Fix this by forcing another mainloop iteration after handling inotify events
before unblocking settle. If the inotify event caused us to generate a
"change" event, we'll pick that up in the following loop iteration, before
we reach the end of the loop where we respond to settle's control message,
unblocking it.
2015-04-11 13:10:52 +02:00
Gavin Li
af97ebf2dd hwdb: add Samsung ATIV Book 6 / 8
This adds support for the keyboard illumination keys and fixes
Fn+F1.
2015-04-11 12:54:08 +02:00
Marc-Antoine Perennou
c4a77bcb9a build: allow setting OBJCOPY 2015-04-11 12:48:18 +02:00
Marc-Antoine Perennou
63e69fb4a0 configure: allow setting EFI_CC 2015-04-11 12:43:47 +02:00
Marc-Antoine Perennou
531ddb915b efi: use EFI_CC 2015-04-11 12:41:43 +02:00
Marc-Antoine Perennou
0a5d1ed9b5 factory: install to datadir 2015-04-11 12:39:53 +02:00
Nir Soffer
0736455b11 udev: restore udevadm settle timeout
Commit 9ea28c55a2 (udev: remove seqnum API and all assumptions about
seqnums) introduced a regresion, ignoring the timeout option when
waiting until the event queue is empty.

Previously, if the udev event queue was not empty when the timeout was
expired, udevadm settle was returning with exit code 1.  To check if the
queue is empty, you could invoke udevadm settle with timeout=0. This
patch restores the previous behavior.

(David: fixed timeout==0 handling and dropped redundant assignment)
2015-04-11 12:35:07 +02:00
Matthew Garrett
64713f9252 rules: fix tests for removable state
We only care about whether our direct parent is removable, not whether any
further points up the tree are - the kernel will take care of policy for
those itself. This enables autosuspend on devices where the root hub reports
that its removable state is unknown.
2015-04-11 12:22:17 +02:00
Łukasz Stelmach
3dd26f3e3a README: glibc version 2.16 is required for IP_UNICAST_IF
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=be08eda5
https://bugs.gentoo.org/show_bug.cgi?id=546194
2015-04-11 12:19:10 +02:00
David Herrmann
d4b47aa30b TODO: add 13790add4 as blocker for v220 2015-04-11 12:13:24 +02:00
Koen Kooi
684edf2e19 build: add support for AARCH64 EFI
Aarch64 and ARM32 lack an EFI capable objcopy, so use the ldflags + -O
binary trick gnu-efi and the Red Hat shimloader are using.

(David: rebase to systemd-git and added EFI_ prefixes)
2015-04-11 12:09:56 +02:00
Koen Kooi
0d8d368907 boot/util: add ticks_read() stub 2015-04-11 11:54:45 +02:00
Koen Kooi
4c6abc93c7 build: add AARCH64 efi support
This is just plumbing to add ARCH_AARCH64 EFI support for makefile tests
and defining the machine name.
2015-04-11 11:48:56 +02:00
Koen Kooi
8403daa284 boot/util: use x86 ASM only on x86 platforms. 2015-04-11 11:48:39 +02:00
Koen Kooi
32ef61b888 build: support non-x86 EFI builds
Move the no-mmx/no-sse CFLAGS to X86-64 and IA32 defines in preparation
for ARM32 and Aarch64 support.
2015-04-11 11:39:29 +02:00
Peter Hutterer
3ebc2dc498 hwdb: set the resolution for a couple of bcm5974 touchpads
Verified for the 5,1 Macbook, the others are guesses based on the list of
supported devices of the moshi trackpad protector.
http://www.moshi.com/trackpad-protector-trackguard-macbook-pro#silver

Resolution calculated based on the min/max settings set in the kernel driver,
divided by the physical size. This is probably slightly off, but still better
than no resolution at all.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-04-11 08:44:33 +10:00
Peter Hutterer
51c0c28698 udev: builtin-keyboard: add support for EVDEV_ABS_*
Parse properties in the form
EVDEV_ABS_00="<min>:<max>:<res>:<fuzz>:<flat>"

and apply them to the kernel device. Future processes that open that device
will see the updated EV_ABS range.

This is particularly useful for touchpads that don't provide a resolution in
the kernel driver but can be fixed up through hwdb entries (e.g. bcm5974).

All values in the property are optional, e.g. a string of "::45" is valid to
set the resolution to 45.

The order intentionally orders resolution before fuzz and flat despite it
being the last element in the absinfo struct. The use-case for setting
fuzz/flat is almost non-existent, resolution is probably the most common case
we'll need.

To avoid multiple hwdb invocations for the same device, replace the
hwdb "keyboard:" prefix with "evdev:" and drop the separate 60-keyboard.rules
file. The new 60-evdev.rules is called for all event nodes
anyway, we don't need a separate rules file and second callout to the hwdb
builtin.
2015-04-11 08:44:33 +10:00
Peter Hutterer
8a0fd83cf0 udev: builtin-keyboard: invert a condition
No functional changes, just to make the next patch easier to review
2015-04-11 08:44:33 +10:00
Peter Hutterer
c9a8e34094 udev: builtin-keyboard: move actual key mapping to a helper function
No changes in the mapping, but previously we opened the device only on
successful parsing. Now we open the mapping as soon as we have a value that
looks interesting. Since errors are supposed to be the exception, not the
rule, this is probably fine.
2015-04-11 08:44:33 +10:00
Peter Hutterer
cfba2656e3 udev: builtin-keyboard: immediately EVIOCSKEYCODE when we have a pair
Rather than building a map and looping through the map, immediately call the
ioctl when we have a successfully parsed property.

This has a side-effect: before the maximum number of ioctls was limited to the
size of the map (1024), now it is unlimited.
2015-04-11 08:44:33 +10:00
Peter Hutterer
753bd5c7ed udev: builtin-keyboard: move fetching the device node up
No point parsing the properties if we can't get the devnode to apply them
later. Plus, this makes future additions easier to slot in.
2015-04-11 08:44:33 +10:00
Ronny Chevalier
3c8000956a shared: move replace_env* from util to env-util 2015-04-11 00:34:03 +02:00
Ronny Chevalier
288a74cce5 shared: add terminal-util.[ch] 2015-04-11 00:34:02 +02:00
Ronny Chevalier
3df3e884ae shared: add random-util.[ch] 2015-04-11 00:11:13 +02:00
Ronny Chevalier
0b452006de shared: add process-util.[ch] 2015-04-10 23:54:49 +02:00
Ronny Chevalier
6482f6269c shared: add formats-util.h 2015-04-10 23:54:48 +02:00
Thomas Hindoe Paaboel Andersen
05a08cb60f dbus: typo fix in log 2015-04-10 23:39:40 +02:00
Thomas Hindoe Paaboel Andersen
75c2a9fd13 tmpfiles: fix build with clang
Clang is not happy about using the cleanup attribute in switches
2015-04-10 23:28:08 +02:00
Thomas Hindoe Paaboel Andersen
733dbdc534 efivars: fix build for non-efi 2015-04-10 23:00:07 +02:00
Tom Gundersen
2e036c4eae shared: boot-timestamps - remove ifdef
No need to ifdef out efi code as the functions are always defined.
2015-04-10 19:55:49 +02:00
Tom Gundersen
b28ce7c6db shared: efivars - fix compile on non-EFI systems
systemctl and logind were unconditionally using functions that were not compiled
on non-EFI systems. Add stubs returning -EOPNOTSUPP to fix compile again.
2015-04-10 19:55:49 +02:00
Tom Gundersen
9df49b3358 shared: efivars - is_efi_*() returns bool instead of int
There was a bug where is_efi_*() could return a negative error value, which would be treated as 'true',
just make this a bool in the helper library to avoid the problem.
2015-04-10 19:55:49 +02:00
Lennart Poettering
3dc055541c Revert "sd-dhcp-client: fix strict aliasing issue"
This reverts commit 6ec8e7c763.

This doesn't fix any issues, just makes the code harder to read.
2015-04-10 19:04:43 +02:00
Lennart Poettering
53bac4e0e3 sd-event: simplify sd_event_run() 2015-04-10 18:45:39 +02:00
Lennart Poettering
5c5ccf12b6 tmpfiles: add specifier expansion for L and C lines, too 2015-04-10 18:07:04 +02:00
Lennart Poettering
b1b5922e2f update TODO 2015-04-10 17:36:07 +02:00
Michal Sekletar
d5cad22109 bus-util: be more verbose if dbus job fails
Users might have hard time figuring out why exactly their systemctl request
failed. If dbus job fails try to figure out more details about failure by
examining Result property of the service.

https://bugzilla.redhat.com/show_bug.cgi?id=1016680
2015-04-10 17:36:07 +02:00
Ronny Chevalier
756c09e672 core: set_put never returns -EEXIST
When the value is already there it returns 0.

Also add a test to ensure this
2015-04-10 17:13:15 +02:00
Lennart Poettering
17493fa5d1 tmpfiles: enforce ordering when executing lines
Always create files first, and then adjust their ACLs, xattrs, file
attributes, never the opposite. Previously the order was not
deterministic, thus possibly first adjusting ACLs/xattrs/file
attributes before actually creating the items.
2015-04-10 16:23:47 +02:00
Lennart Poettering
90937fe3d3 tmpfiles: eat up empty columns 2015-04-10 16:23:46 +02:00
Lennart Poettering
bd550f78eb tmpfiles: substitute % specifiers in arguments for writing files and xattrs 2015-04-10 16:23:46 +02:00
Lennart Poettering
c82500c6fb tmpfiles: warn if we get an argument on lines that don't take any 2015-04-10 16:23:46 +02:00
Lennart Poettering
3ea40b7810 tmpfiles: mostly revert 71044f609b
Add a comment why returning a positive error is OK and intended in this
case.

(It's still a nasty hack to do this though!)
2015-04-10 16:23:46 +02:00
Lennart Poettering
f0bc504794 device-nodes: minor simplifications 2015-04-10 16:23:46 +02:00
Lennart Poettering
2ff7b0a542 util: unify how we parse mode_t strings 2015-04-10 16:23:46 +02:00
Lennart Poettering
6dd67163b8 util: remove normalize_env_assignment(), it's unused 2015-04-10 16:23:46 +02:00
Ronny Chevalier
0d67448869 shared: fix memleak
path was used for 2 purposes but it was not freed before being reused.
2015-04-10 15:44:02 +02:00
Lennart Poettering
e1eaca26cb util: mark unquote() static, so that new code doesn't use this anymore 2015-04-10 12:16:54 +02:00
Lennart Poettering
8ebac1f9a6 util: fix unicode decoding in unquote_first_word() 2015-04-10 11:56:04 +02:00