Zbigniew Jędrzejewski-Szmek [Sun, 28 Sep 2014 02:02:04 +0000 (22:02 -0400)]
fstab-generator: properly deal with discard as non-last option
Previous code would only return correct results when discard
was the last option.
While at it, avoid incorrect behaviour for (invalid) 'pri' option
not followed by '=...', and also do not return -1 as the error code.
Jan Synacek [Wed, 24 Sep 2014 12:29:05 +0000 (14:29 +0200)]
swap: introduce Discard property
Process possible "discard" values from /etc/fstab.
Zbigniew Jędrzejewski-Szmek [Sun, 28 Sep 2014 00:00:00 +0000 (20:00 -0400)]
journal-remote: fix handling of non-blocking sources
In the conversion to sd-event loop, handling of normal files got
broken. We do not want to perform non-blocking reads on them, but
simply do read() in a loop. Install a statically-enabled "source"
to do that.
Zbigniew Jędrzejewski-Szmek [Fri, 26 Sep 2014 14:49:55 +0000 (10:49 -0400)]
journalctl: do not output --reboot-- markers when running non-interactively
They are not legal in the export format.
David Herrmann [Mon, 29 Sep 2014 13:44:44 +0000 (15:44 +0200)]
bus: use 2M as maximum message size in benchmark
The kdbus limit is 2M and we removed the bus-owner override. Therefore,
use at most 2M as message size.
David Herrmann [Mon, 29 Sep 2014 13:36:20 +0000 (15:36 +0200)]
terminal: add helper to retrieve the seat of a session
Allow sysview users to retrieve the seat that a session is assigned to.
David Herrmann [Mon, 29 Sep 2014 13:35:51 +0000 (15:35 +0200)]
bus: sync kdbus.h (ABI break!)
David Herrmann [Mon, 29 Sep 2014 12:59:01 +0000 (14:59 +0200)]
terminal: add sysview_seat_switch_to()
Add helper to perform session switches on a specific seat whenever we
retrieve a VT-switch keyboard event.
Daniel Mack [Sun, 28 Sep 2014 19:19:22 +0000 (21:19 +0200)]
sd-bus: clean up string length calculation
Move the +1 calculus onto the definition of the variable, just to make
the code a little easier to read. No functional change.
Philippe De Swert [Sun, 28 Sep 2014 15:12:51 +0000 (18:12 +0300)]
bootchart: Do not try to access data for non-existing CPU's
Cpu's are assigned normally, so starting at 0, so the MAX_CPU index will
always be one smaller than the actual number.
Found with Coverity.
Thomas Hindoe Paaboel Andersen [Sun, 28 Sep 2014 16:46:15 +0000 (18:46 +0200)]
test-bus-policy: silence coverity
Check if strjoin worked and also use _cleanup_free_ since we are
here.
Found with Coverity. Fixes CID#
1241962
Thomas Hindoe Paaboel Andersen [Sat, 27 Sep 2014 20:25:07 +0000 (22:25 +0200)]
bootchart: check return of strftime
Found by coverity. Fixes: CID#996314 and #996312
Thomas Hindoe Paaboel Andersen [Fri, 26 Sep 2014 19:41:02 +0000 (21:41 +0200)]
bootchart: parse userinput with safe_atoi
Found by coverity. Fixes: CID#996409
Koen Kooi [Sat, 27 Sep 2014 07:55:44 +0000 (09:55 +0200)]
logind: add support for TPS65217 Power Button
This PMIC is found on TI AM335x based boards like the beaglebone and
beaglebone black.
root@beaglebone-white:~# udevadm info -a /dev/input/event0
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device
'/devices/ocp.3/
44e0b000.i2c/i2c-0/0-0024/input/input0/event0':
KERNEL=="event0"
SUBSYSTEM=="input"
DRIVER==""
looking at parent device
'/devices/ocp.3/
44e0b000.i2c/i2c-0/0-0024/input/input0':
KERNELS=="input0"
SUBSYSTEMS=="input"
DRIVERS==""
ATTRS{name}=="tps65217_pwr_but"
ATTRS{phys}==""
ATTRS{uniq}==""
ATTRS{properties}=="0"
looking at parent device '/devices/ocp.3/
44e0b000.i2c/i2c-0/0-0024':
KERNELS=="0-0024"
SUBSYSTEMS=="i2c"
DRIVERS=="tps65217"
ATTRS{name}=="tps65217"
looking at parent device '/devices/ocp.3/
44e0b000.i2c/i2c-0':
KERNELS=="i2c-0"
SUBSYSTEMS=="i2c"
DRIVERS==""
ATTRS{name}=="OMAP I2C adapter"
looking at parent device '/devices/ocp.3/
44e0b000.i2c':
KERNELS=="
44e0b000.i2c"
SUBSYSTEMS=="platform"
DRIVERS=="omap_i2c"
looking at parent device '/devices/ocp.3':
KERNELS=="ocp.3"
SUBSYSTEMS=="platform"
DRIVERS==""
Piotr Drąg [Sat, 27 Sep 2014 21:30:15 +0000 (23:30 +0200)]
catalog: add Polish translation
Eric Cook [Sat, 27 Sep 2014 12:48:09 +0000 (08:48 -0400)]
shell-completion(zsh): journalctl's -b changes
removed pointless index sort of bootids.
use `compadd -a' to add each array, instead of expanding possibly hundreds of words needlessly.
optional completion of -b
Thomas Hindoe Paaboel Andersen [Fri, 26 Sep 2014 22:25:09 +0000 (00:25 +0200)]
shutdownd: clean up initialization of struct
No functional change. We just don't assign the value twice.
Found by coverity. Fixes: CID#
1237616 and #
1237617
Daniel Mack [Fri, 26 Sep 2014 15:50:24 +0000 (17:50 +0200)]
test-bus-policy: load policy files from TEST_DIR
'make distcheck' calls test-bus-policy outside of the source tree, so it
must consider the TEST_DIR variable to access its files.
Richard Weinberger [Tue, 9 Sep 2014 09:09:37 +0000 (11:09 +0200)]
systemd-tmpfiles: Fix IGNORE_DIRECTORY_PATH age handling
If one has a config like:
d /tmp 1777 root root -
X /tmp/important_mount
All files below /tmp/important_mount will be deleted as the
/tmp/important_mount item will spuriously inherit a max age of 0
from /tmp.
/tmp has a max age of 0 but age_set is (of course) false.
This affects also the PrivateTmp feature of systemd.
All tmp files of such services will be deleted unconditionally
and can cause service failures and data loss.
Fix this by checking ->age_set in the IGNORE_DIRECTORY_PATH logic.
Emil Renner Berthing [Wed, 24 Sep 2014 15:25:00 +0000 (17:25 +0200)]
make utmp/wtmp support configurable
This adds --disable-utmp option to configure. If it is used, all
utmp-related functionality, including querying runlevel support,
is removed.
Zbigniew Jędrzejewski-Szmek [Thu, 25 Sep 2014 23:02:42 +0000 (19:02 -0400)]
Revert "only build and install systemd-bus-proxyd if --enable-kdbus"
This reverts commit
ef99aec4d25087dec995b3f00b6957dcee6b13e9.
systemd-stdio-bridge is used on non-kdbus systems.
Gustavo Sverzut Barbieri [Thu, 25 Sep 2014 21:12:03 +0000 (18:12 -0300)]
do not install factory/etc/pam.d if --disable-pam
Zbigniew Jędrzejewski-Szmek [Thu, 25 Sep 2014 21:39:56 +0000 (17:39 -0400)]
build-sys: do not distribute make-man-rules.py
It was added to EXTRA_DIST in
3c3e5f4276a893791110b03984735654372aa33a,
but this script only makes sense for developers.
Gustavo Sverzut Barbieri [Thu, 25 Sep 2014 21:13:19 +0000 (18:13 -0300)]
only build and install systemd-bus-proxyd if --enable-kdbus
Zbigniew Jędrzejewski-Szmek [Thu, 25 Sep 2014 21:27:46 +0000 (17:27 -0400)]
man: use <constant> markup for errno value
We were inconsistent, but marking them up as constants makes more
sense then as variables.
Zbigniew Jędrzejewski-Szmek [Thu, 25 Sep 2014 21:27:40 +0000 (17:27 -0400)]
man: document sd_event_add_{defer,post,exit}
Zbigniew Jędrzejewski-Szmek [Thu, 25 Sep 2014 21:27:33 +0000 (17:27 -0400)]
man: add sd_event_add_child(3)
Zbigniew Jędrzejewski-Szmek [Thu, 25 Sep 2014 21:27:27 +0000 (17:27 -0400)]
man: add sd_event_add_signal(3)
Zbigniew Jędrzejewski-Szmek [Thu, 25 Sep 2014 21:27:21 +0000 (17:27 -0400)]
build-sys: add sd_session_get_desktop to Makefile-man.am
Fixup for
c72d5456e2d.
Zbigniew Jędrzejewski-Szmek [Thu, 25 Sep 2014 21:27:17 +0000 (17:27 -0400)]
man/sd_event_new: tweaks
Gustavo Sverzut Barbieri [Thu, 25 Sep 2014 21:08:02 +0000 (18:08 -0300)]
journal: build fix when LZ4 is enabled but XZ is not
Zbigniew Jędrzejewski-Szmek [Thu, 25 Sep 2014 21:26:40 +0000 (17:26 -0400)]
journal-remote: fix counting of events written
After recent changes the number was always reported as 0, because
the accounting was done server_destroy(), called after the message was
already printed. But even before this change, the counts were wrong
because seqnum start at 0 only for newly created journal files, so when
appending to existing files, the calculated count was wrong anyway.
Also do some variable renaming for consistency and disable some low-level
debug messages.
Jonathan Liu [Wed, 24 Sep 2014 13:59:06 +0000 (23:59 +1000)]
journal-remote: initialize writer hashmap before use
https://bugs.freedesktop.org/show_bug.cgi?id=83682
[zj: move the initalization even earlier, before any sockets are
looked at.]
Tom Gundersen [Thu, 25 Sep 2014 16:49:56 +0000 (18:49 +0200)]
nspawn: check some more return values
Most of these failures would anyway get caught later on, but now the error messages are a bit more
specific.
Tom Gundersen [Thu, 25 Sep 2014 16:16:04 +0000 (18:16 +0200)]
delta: warn if diff failed
Found by Coverity. Fixes CID #
1237541.
Daniel Buch [Tue, 26 Aug 2014 19:17:22 +0000 (21:17 +0200)]
readahead: wipe out readahead
Tom Gundersen [Thu, 25 Sep 2014 14:21:36 +0000 (16:21 +0200)]
bus-proxy: drop one wrong assert()
Tom Gundersen [Thu, 25 Sep 2014 14:12:41 +0000 (16:12 +0200)]
shared: path-util - try to make PATH_FORECH_PREFIX look less wrong
We replace the idiom "X && !(*foo = 0)" with "X && ((*foo = 0), true)".
This is not a functional change, but should hopefully make it less
likely that people and static analyzers believe there is a typo here
(i.e., to make it clear that the intention was not "X && *foo != 0").
Thanks to David Herrmann for the suggestion.
Tom Gundersen [Thu, 25 Sep 2014 13:49:43 +0000 (15:49 +0200)]
bus-proxyd: add some asserts
Both as documentation, and to make Coverity happy.
Fixes CID #
1241495 and #
1241496.
Michal Sekletar [Wed, 24 Sep 2014 11:17:43 +0000 (13:17 +0200)]
localectl: print warning when there are options given on kernel cmdline
Michal Sekletar [Mon, 22 Sep 2014 07:38:38 +0000 (09:38 +0200)]
fileio: make parse_env_file() return number of parsed items
This commit introduces possibility to call parse_env_file_internal() and hand
over extra argument where we will accumulate how many items were successfully
parsed and pushed by callback. We make use of this in parse_env_file() and
return number of parsed items on success instead of always returning zero.
As a side-effect this commit should fix bug that locale settings in
/etc/locale.conf are not overriden by options passed via kernel command line.
Daniel Mack [Wed, 24 Sep 2014 15:02:08 +0000 (17:02 +0200)]
bus-policy: split API for bus-proxyd
Instead of operating on an sd_bus_message object, expose an API that has 4
functions:
policy_check_own()
policy_check_hello()
policy_check_recv()
policy_check_send()
This also allows dropping extra code to parse message contents - the bus
proxy already has dedicated code paths for that, and we can hook into
those later.
Tests amended accordingly.
Thomas Hindoe Paaboel Andersen [Tue, 23 Sep 2014 19:34:21 +0000 (21:34 +0200)]
bus: remove unused check
strerror_r does not return null here and even if it did we would have
problems already at the preceding strlen call.
Found by coverity. Fixes: CID#
1237770
David Herrmann [Tue, 23 Sep 2014 11:52:50 +0000 (13:52 +0200)]
terminal: provide display dimensions to API users
Allow users to query the display dimensions of a grdev_display. This is
required to properly resize the objects to be rendered.
David Herrmann [Tue, 23 Sep 2014 11:51:42 +0000 (13:51 +0200)]
terminal: verify kernel-returned DRM events are not truncated
Make sure the kernel always returns events properly. This is guaranteed
right now, otherwise, we do something really wrong. But lets be sure and
verify the received values properly. This also silences some coverity
warnings.
David Herrmann [Tue, 23 Sep 2014 11:40:18 +0000 (13:40 +0200)]
terminal: verify grdev tiles are correctly linked
We used to set "pipe->tile = tile" inside of the leaf allocation. We no
longer do that. Verify that "out" is non-NULL, otherwise we'd leak memory.
This is currently always given, but make sure to add an assert(), so
coverity does not complain.
David Herrmann [Tue, 23 Sep 2014 11:38:09 +0000 (13:38 +0200)]
terminal: fix tile-offset calculation
Binary operators with two pointers as arguments always operate on
object-size, not bytes. That is, "int *a, *b", (a - b) calculates the
number of integers between b and a, not the number of bytes.
Fix our cache-offset calculation to not use sizeof() with full-ptr
arithmetic.
David Herrmann [Tue, 23 Sep 2014 11:33:53 +0000 (13:33 +0200)]
Silence some "unchecked return-value" warnings
This adds some log-messages to ioctl() calls where we don't really care
for the return value. It isn't strictly necessary to look for those, but
lets be sure and print warnings. This silences gcc and coverity, and also
makes sure we get reports in case something goes wrong and we didn't
expect it to fail that way.
Daniel Mack [Tue, 23 Sep 2014 15:37:44 +0000 (17:37 +0200)]
sd-bus: sync kdbus.h
Daniel Mack [Tue, 23 Sep 2014 14:13:54 +0000 (16:13 +0200)]
sd-bus: sync kdbus.h (API break)
Just a rename of two struct members to make the header file c++ compatible.
Zbigniew Jędrzejewski-Szmek [Thu, 4 Sep 2014 16:30:46 +0000 (12:30 -0400)]
localed: rename write_data_x11 to x11_write_data
Other functions in this file follow this pattern,
we have vconsole_write_data and locale_write_data.
Zbigniew Jędrzejewski-Szmek [Tue, 23 Sep 2014 13:22:40 +0000 (09:22 -0400)]
Fix warning about unused variable with !SELINUX
src/shared/label.c:255:15: warning: unused variable 'l' [-Wunused-variable]
char *l = NULL;
^
Zbigniew Jędrzejewski-Szmek [Tue, 23 Sep 2014 13:22:33 +0000 (09:22 -0400)]
terminal: fix spelling mistake
Zbigniew Jędrzejewski-Szmek [Tue, 23 Sep 2014 02:14:39 +0000 (22:14 -0400)]
logind: add support for Triton2 Power Button
https://bugs.freedesktop.org/show_bug.cgi?id=84201
Daniel Mack [Mon, 22 Sep 2014 16:20:14 +0000 (18:20 +0200)]
sd-bus: sync kdbus.h (API+ABI break)
The kdbus logic name registry logic was changed to transport the actual
name to acquire, release or report in a kdbus item.
This brings the name API a little more in line with other calls, and allows
for later augmentation.
Follow that change on the systemd side.
Emil Renner Berthing [Fri, 19 Sep 2014 18:26:53 +0000 (20:26 +0200)]
util: avoid non-portable __WORDSIZE
Lets not unnecessarily rely on __WORDSIZE, which is not clearly specified
by any spec. Use explicit size comparisons if we're not interested in the
WORDSIZE, anyway.
(David: adjust commit message to explain why we do this)
David Herrmann [Mon, 22 Sep 2014 16:05:19 +0000 (18:05 +0200)]
terminal: signal object removal during sysview_context_stop()
Now that we no longer propagate callback return values, we can safely call
into user-callbacks during sysview_context_stop(). This way, users can
rely on all objects to be removed via callbacks (except if they failed
during object creation). This avoids duplicating any object hashtables on
the users' side and reduces memory consumption.
David Herrmann [Mon, 22 Sep 2014 15:55:31 +0000 (17:55 +0200)]
terminal: handle callback errors in sysview instead of propagating them
We cannot sanely propagate error codes if we call into user-callbacks
multiple times for multiple objects. There is no way to merge those errors
or somehow propagate them.
However, we can just act similar to sd-event and print a log-message while
discarding the values. This way, we allow error-returns, but can properly
continue working on our objects.
David Herrmann [Mon, 22 Sep 2014 15:37:21 +0000 (17:37 +0200)]
terminal: allow user-context to be retrieved/stored
Add "userdata" storage to a bunch of external objects, namely displays and
sessions. Furthermore, add some property retrieval helpers.
This is required if we want external API users to not duplicate our own
object hashtables, but retrieve context from the objects themselves.
David Herrmann [Mon, 22 Sep 2014 15:34:13 +0000 (17:34 +0200)]
terminal: make evdev logind-matches per session
Instead of adding matches per device, we now add logind matches per
session. This reduces the number of matches considerably and saves
resources.
Zbigniew Jędrzejewski-Szmek [Mon, 22 Sep 2014 13:15:49 +0000 (09:15 -0400)]
exit-status.c: bring EXIT_BUS_ENDPOINT label in line with others
Zbigniew Jędrzejewski-Szmek [Mon, 22 Sep 2014 13:13:38 +0000 (09:13 -0400)]
man: fix typo and add link
David Herrmann [Sat, 20 Sep 2014 16:42:29 +0000 (18:42 +0200)]
login: add public sd_session_get_desktop() API
The desktop brand is stored as DESKTOP variable for sessions. It can be
set arbitrarily by the session owner and identifies the desktop
environment that is running on that session.
David Herrmann [Mon, 22 Sep 2014 10:49:47 +0000 (12:49 +0200)]
bus: align kdbus ioctl parameters to 8byte
All kdbus ioctl arguments must be 8byte aligned. Make sure we use
alloca_align() and _alignas_(8) in all situations where gcc doesn't
guarantee 8-byte alignment.
Note that objects on the stack are always 8byte aligned as we put
_alignas_(8) into the structure definition in kdbus.h.
David Herrmann [Mon, 22 Sep 2014 10:05:16 +0000 (12:05 +0200)]
util: add alloca_align()
The alloca_align() helper is the alloca() equivalent of posix_memalign().
As there is no such function provided by glibc, we simply account for
additional memory and return a pointer offset into the allocated memory to
grant the alignment.
Furthermore, alloca0_align() is added, which simply clears the allocated
memory.
David Herrmann [Mon, 22 Sep 2014 09:27:22 +0000 (11:27 +0200)]
test-util: make valgrind happy
Properly free all temporary resources to make valgrind not complain about
lost records.
David Herrmann [Sat, 20 Sep 2014 15:47:56 +0000 (17:47 +0200)]
terminal: raise sysview DEVICE_CHANGE events per attachment
Instead of raising DEVICE_CHANGE only per device, we now raise it per
device-session attachment. This is what we want for all sysview users,
anyway, as sessions are meant to be independent of each other. Lets avoid
any external session iterators and just do that in sysview itself.
David Herrmann [Sat, 20 Sep 2014 10:39:59 +0000 (12:39 +0200)]
terminal: forward evdev RESYNC events to linked devices
Whenever we resync an evdev device (or disable it), we should send RESYNC
events to the linked upper layers. This allows to disable key-repeat and
assume some events got dropped.
David Herrmann [Sat, 20 Sep 2014 10:34:43 +0000 (12:34 +0200)]
terminal: always call _enable/_disable on evdev devices
The current pause/resume logic kinda intertwines the resume/pause and
enable/disable functions. Lets avoid that non-obvious behavior and always
make resume call into enable, and pause call into disable, if appropriate.
David Herrmann [Sat, 20 Sep 2014 10:33:18 +0000 (12:33 +0200)]
terminal: print RESYNC state in evcat
Whenever a key-event is part of a RESYNC, we should print that verbosely
as those events are out-of-order.
Daniel Mack [Fri, 19 Sep 2014 12:50:53 +0000 (14:50 +0200)]
bus-policy: add test utility
Add some test files and routines for dbus policy checking.
Daniel Mack [Fri, 19 Sep 2014 12:38:52 +0000 (14:38 +0200)]
bus-policy: add policy check function
Add policy_check() to actually check whether an incoming message is allowed
by the policy. The code is not yet used from the proxy daemon, though.
Daniel Mack [Sat, 20 Sep 2014 16:09:00 +0000 (18:09 +0200)]
bus-policy: print numeric [gu]id in dump_items()
Daniel Mack [Sat, 20 Sep 2014 13:59:40 +0000 (15:59 +0200)]
bus-policy: do not exit() from policy_dump()
This function is quite useful for debugging. Exiting from it seems
unnecessary.
Daniel Mack [Fri, 19 Sep 2014 12:05:18 +0000 (14:05 +0200)]
bus-policy: implement dump_items() with LIST_FOREACH
Instead of making the function call itself recursively.
Daniel Mack [Sat, 20 Sep 2014 02:34:30 +0000 (04:34 +0200)]
bus-policy: resolve [ug]id of POLICY_ITEM_{USER,GROUP}
Do the lookup during parsing already, and set i->uid, or i->gid to the
numerical values.
Daniel Mack [Sat, 20 Sep 2014 14:34:31 +0000 (16:34 +0200)]
bus_policy: set i->[ug]id_valid
Daniel Mack [Fri, 19 Sep 2014 20:05:01 +0000 (22:05 +0200)]
bus-policy: append items rather than prepending them
In the D-Bus policy, the order of items matters, so make sure to store them
in the same order as they are parsed by the sax parser.
Daniel Mack [Fri, 19 Sep 2014 15:50:41 +0000 (17:50 +0200)]
bus-policy: story mandatory items in right list
Tom Gundersen [Sat, 20 Sep 2014 16:12:53 +0000 (18:12 +0200)]
test: udev - restrict nemuric uid's to existing ones
We now verify the existence of uid's before applying them to devicenodes, so change the
test accordingly. We assume that both uid/gid 1 and 2 exist on the test system.
David Herrmann [Sat, 20 Sep 2014 09:43:32 +0000 (11:43 +0200)]
terminal: fix mode sync for connectors
The GETXY ioctls of DRM are usually called twice by libdrm: Once to
retrieve the number of objects, a second time with suitably sized buffers
to actually retrieve all objects. In grdrm, we avoid these excessive calls
and instead just call ioctls with cached buffers and resize them if they
were too small.
However, connectors need to read the mode list via EDID, which is horribly
slow. As the kernel still cannot do that asynchronously (seriously, we
need to fix this!), it has a hack to only do it if count_modes==0. This is
fine with libdrm, as it calls every ioctl twice, anyway. However, we fail
horribly with this as we usually never pass 0.
Fix this by calling into GETCONNECTOR ioctls twice in case we received an
hotplug event. Only in those cases, we need to re-read modes, so this
should be totally fine.
David Herrmann [Sat, 20 Sep 2014 09:41:34 +0000 (11:41 +0200)]
terminal: restructure some logging calls in grdrm
Multiple issues here:
1) Don't print excessive card dumps on each resync. Disable it and make
developers add it themselves.
2) Ignore EINVAL on page-flips. Some cards don't support page-flips, so
we'd print it on each frame. Maybe, at some point, the kernel will add
support to retrieve capabilities for that. Until then, simply ignore
it.
3) Replace the now dropped card-dump with a short message about resyncing
the card.
David Herrmann [Sat, 20 Sep 2014 09:12:44 +0000 (11:12 +0200)]
terminal: grdev: schedule virtual frame events if hw doesn't support it
Whenever we cannot use hardware frame events, we now schedule a virtual
frame event to make sure applications don't have to do this. Usually,
applications render only on data changes, but we can further reduce
render-time by also limiting rendering to vsyncs.
David Herrmann [Sat, 20 Sep 2014 09:11:07 +0000 (11:11 +0200)]
terminal: grdev: raise frame event after DISPLAY_ADD/CHANGE
Whenever a display is added or changed, we suppressed any frame events.
Make sure to raise them manually so we can avoid rendering when handling
anything but FRAME events.
David Herrmann [Sat, 20 Sep 2014 09:10:04 +0000 (11:10 +0200)]
terminal: split grdrm_crtc_commit() apart
This helper is quite huge, split it apart to make it easier to follow.
David Herrmann [Sat, 20 Sep 2014 07:50:10 +0000 (09:50 +0200)]
terminal: grdev: refresh device state on hotplug events
Whenever we get udev hotplug events, re-read the device state so we
properly detect any changed in the display setups.
David Herrmann [Sat, 20 Sep 2014 07:48:22 +0000 (09:48 +0200)]
terminal: grdev: treat udev-devices without devnum as hotplug
If we get udev-device events via sysview, but they lack devnum
annotations, we know it cannot be a DRM card. Look through it's parents
and treat it as hotplug event in case we find such a card.
This will treat any new/removed connectors as sub-devices of the real
card, instead of as devices on its own.
David Herrmann [Sat, 20 Sep 2014 07:46:13 +0000 (09:46 +0200)]
terminal: modeset: forward DEVICE_CHANGE events into grdev
Properly forward DEVICE_CHANGE events into grdev so we can react to
changing display setups.
David Herrmann [Sat, 20 Sep 2014 07:45:26 +0000 (09:45 +0200)]
terminal: reduce speed of morphing colors in modeset test
The high frequency of the color-morphing is kinda irritating. Reduce it
to a much lower frequency so you can actually look at it longer than few
seconds.
David Herrmann [Sat, 20 Sep 2014 07:44:14 +0000 (09:44 +0200)]
terminal: make drm-connectors first-level devices
So far, we only forward DRM cards via sysview APIs. However, with MST,
connectors can be hotplugged, too. Forward the connectors as first-level
devices via sysview so API users can react to changing DRM connectors.
David Herrmann [Sat, 20 Sep 2014 07:43:16 +0000 (09:43 +0200)]
terminal: forward DEVICE_CHANGE events via sysview
Whe need to react to "change" events on devices, but we want to avoid
duplicating udev-monitors everywhere. Therefore, make sysview forward
change events to the sysview controllers, which can then properly react
to it.
David Herrmann [Sat, 20 Sep 2014 07:29:11 +0000 (09:29 +0200)]
terminal: parse ID_SEAT not only for parents but the device itself
When deciding what seat a device is on, we have to traverse all parents
to find one with an ID_SEAT tag, otherwise, input devices plugged on a
seated USB-hub are not automatically attached to the right seat. But any
tags on the main device still overwrite the tags of the childs, so fix our
logic to check the device itself first, before traversing the parents.
Tom Gundersen [Fri, 19 Sep 2014 21:02:00 +0000 (23:02 +0200)]
nspawn: don't try to create veth link with too long ifname
Reported by: James Lott <james@lottspot.com>
David Herrmann [Fri, 19 Sep 2014 12:48:54 +0000 (14:48 +0200)]
terminal: add systemd-modeset debugging tool
The systemd-modeset tool is meant to debug grdev issues. It simply
displays morphing colors on any found display. This is pretty handy to
look for tearing in the backends and debug hotplug issues.
Note that this tool requires systemd-logind to be compiled from git
(there're important fixes that haven't been released, yet).
David Herrmann [Fri, 19 Sep 2014 12:13:06 +0000 (14:13 +0200)]
terminal: add grdev DRM backend
The grdev-drm backend manages DRM cards for grdev. Any DRM card with
DUMB_BUFFER support can be used. So far, our policy is to configure all
available connectors, but keep pipes inactive as long as users don't
enable the displays on top.
We hard-code double-buffering so far, but can easily support
single-buffering or n-buffering. We also require XRGB8888 as format as
this is required to be supported by all DRM drivers and it is what VTs
use. This allows us to switch from VTs to grdev via page-flips instead of
deep modesets.
There is still a lot room for improvements in this backend, but it works
smoothly so far so more enhanced features can be added later.
David Herrmann [Fri, 19 Sep 2014 12:05:52 +0000 (14:05 +0200)]
terminal: add graphics interface
The grdev layer provides graphics-device access via the
libsystemd-terminal library. It will be used by all terminal helpers to
actually access display hardware.
Like idev, the grdev layer is built around session objects. On each
session object you add/remove graphics devices as they appear and vanish.
Any device type can be supported via specific card-backends. The exported
grdev API hides any device details.
Graphics devices are represented by "cards". Those are hidden in the
session and any pipe-configuration is automatically applied. Out of those,
we configure displays which are then exported to the API user. Displays
are meant as lowest hardware entity available outside of grdev. The
underlying pipe configuration is fully hidden and not accessible from the
outside. The grdev tiling layer allows almost arbitrary setups out of
multiple pipes, but so far we only use a small subset of this. More will
follow.
A grdev-display is meant to represent real connected displays/monitors.
The upper level screen arrangements are user policy and not controlled by
grdev. Applications are free to apply any policy they want.
Real card-backends will follow in later patches.
David Herrmann [Fri, 19 Sep 2014 11:26:39 +0000 (13:26 +0200)]
login: pause devices before acknowledging VT switches
If a session controller does not need synchronous VT switches, we allow
them to pass VT control to logind, which acknowledges all VT switches
unconditionally. This works fine with all sessions using the dbus API,
but causes out-of-sync device use if we switch to legacy sessions that
are notified via VT signals. Those are processed before logind notices
the session-switch via sysfs. Therefore, leaving the old session still
active for a short amount of time.
This, in fact, may cause the legacy session to prepare graphics devices
before the old session was deactivated, and thus, maybe causing the old
session to interfer with graphics device usage.
Fix this by releasing devices immediately before acknowledging VT
switches. This way, sessions without VT handlers are required to support
async session switching (which they do in that case, anyway).
Michal Sekletar [Thu, 24 Jul 2014 08:40:28 +0000 (10:40 +0200)]
socket: introduce SELinuxContextFromNet option
This makes possible to spawn service instances triggered by socket with
MLS/MCS SELinux labels which are created based on information provided by
connected peer.
Implementation of label_get_child_mls_label derived from xinetd.
Reviewed-by: Paul Moore <pmoore@redhat.com>
Tom Gundersen [Fri, 19 Sep 2014 06:03:31 +0000 (08:03 +0200)]
shared: wtmp-utmp - don't clear store_wtmp in utmp_put_dead_process()
Also modernize a few other things and add comments to explain CID #
1237503
and CID #
1237504.
Thomas Hindoe Paaboel Andersen [Thu, 18 Sep 2014 23:43:04 +0000 (01:43 +0200)]
test: warn if we could not parse the loop count argument
Found by coverity. Fixes: CID#
1237512