chiark / gitweb /
elogind.git
9 years agoimport: add a couple of additional suffixes to remove from raw images
Lennart Poettering [Tue, 20 Jan 2015 15:37:27 +0000 (16:37 +0100)]
import: add a couple of additional suffixes to remove from raw images

9 years agoimport: make image verification optional
Lennart Poettering [Tue, 20 Jan 2015 15:36:40 +0000 (16:36 +0100)]
import: make image verification optional

9 years agosd-dhcp6-client: Remove unnecessary debug printout
Patrik Flykt [Mon, 5 Jan 2015 14:25:49 +0000 (16:25 +0200)]
sd-dhcp6-client: Remove unnecessary debug printout

9 years agoimport: add a simple scheme for validating the SHA256 sums of downloaded raw files
Lennart Poettering [Tue, 20 Jan 2015 14:06:34 +0000 (15:06 +0100)]
import: add a simple scheme for validating the SHA256 sums of downloaded raw files

9 years agoimport: be less aggressive when allocating memory for downloaded payload
Lennart Poettering [Tue, 20 Jan 2015 14:06:01 +0000 (15:06 +0100)]
import: be less aggressive when allocating memory for downloaded payload

9 years agoimport: improve logging a bit
Lennart Poettering [Tue, 20 Jan 2015 14:05:25 +0000 (15:05 +0100)]
import: improve logging a bit

9 years agoimport: port pull-raw to helper tools implemented for pull-tar
Lennart Poettering [Tue, 20 Jan 2015 02:00:07 +0000 (03:00 +0100)]
import: port pull-raw to helper tools implemented for pull-tar

This allows us to reuse a lot more code, and simplify pull-raw
drastically.

9 years agoimport: add support for pulling raw tar balls as containers
Lennart Poettering [Tue, 20 Jan 2015 00:36:11 +0000 (01:36 +0100)]
import: add support for pulling raw tar balls as containers

Ubuntu provides their cloud images optionally as tarball, hence also
support downloading those.

9 years agoutil: make http url validity checks more generic, and move them to util.c
Lennart Poettering [Mon, 19 Jan 2015 19:45:27 +0000 (20:45 +0100)]
util: make http url validity checks more generic, and move them to util.c

9 years agotest: Use configured Python
Martin Pitt [Tue, 20 Jan 2015 11:46:28 +0000 (12:46 +0100)]
test: Use configured Python

Don't hardcode "python" or /usr/bin/python, but use the configured $(PYTHON).

9 years agotest/rule-syntax-check.py: Fix for Python 3
Martin Pitt [Tue, 20 Jan 2015 11:18:40 +0000 (12:18 +0100)]
test/rule-syntax-check.py: Fix for Python 3

Make this work with both Python 2 and 3.

9 years agonetworkd: fix a typo in networkd-wait-online-manager.
Rami Rosen [Tue, 20 Jan 2015 11:56:14 +0000 (13:56 +0200)]
networkd: fix a typo in networkd-wait-online-manager.

subscibe->subscribe

9 years agoman: add networkctl(1)
Zbigniew Jędrzejewski-Szmek [Tue, 20 Jan 2015 02:44:16 +0000 (21:44 -0500)]
man: add networkctl(1)

9 years agoman: use one description of --no-legend
Zbigniew Jędrzejewski-Szmek [Tue, 20 Jan 2015 02:43:35 +0000 (21:43 -0500)]
man: use one description of --no-legend

9 years agonspawn: add ipvlan support
Tom Gundersen [Mon, 19 Jan 2015 23:18:28 +0000 (00:18 +0100)]
nspawn: add ipvlan support

9 years agonetworkd: netdev - add ipvlan support
Tom Gundersen [Mon, 19 Jan 2015 21:24:32 +0000 (22:24 +0100)]
networkd: netdev - add ipvlan support

9 years agosystemctl: do not show dots with --plain
Zbigniew Jędrzejewski-Szmek [Mon, 19 Jan 2015 20:41:03 +0000 (15:41 -0500)]
systemctl: do not show dots with --plain

Plain implies a ... "plain" output.

Also do not say "No jobs" with --no-legend. We skip
reporting the number of jobs with --no-legend if there
are any, and 0 is also a number, and should be skipped.

9 years agonspawn: support dissecting GPT images that contain only a single generic linux partition
Lennart Poettering [Mon, 19 Jan 2015 19:22:58 +0000 (20:22 +0100)]
nspawn: support dissecting GPT images that contain only a single generic linux partition

This should allow running Ubuntu UEFI GPT Images with nspawn,
unmodified.

9 years agoimport: clarify when we are unpacking the qcow2 device
Lennart Poettering [Mon, 19 Jan 2015 19:22:50 +0000 (20:22 +0100)]
import: clarify when we are unpacking the qcow2 device

9 years agoinspawn: wait until udev has probed a loopback device before making us of it
Lennart Poettering [Mon, 19 Jan 2015 19:21:57 +0000 (20:21 +0100)]
inspawn: wait until udev has probed a loopback device before making us of it

9 years agoimport: make sure don't leak the LZMA context
Lennart Poettering [Mon, 19 Jan 2015 16:02:37 +0000 (17:02 +0100)]
import: make sure don't leak the LZMA context

9 years agomachined: refer to the disk space allocated for an image to "usage" rather than ...
Lennart Poettering [Mon, 19 Jan 2015 16:01:15 +0000 (17:01 +0100)]
machined: refer to the disk space allocated for an image to "usage" rather than "size"

After all, it's closer to the "du"-reported value than to the file
sizes...

9 years agoqcow2: when dissecting qcow2, use btrfs clone ioctls for reflinking blocks to target
Lennart Poettering [Sat, 17 Jan 2015 17:11:45 +0000 (18:11 +0100)]
qcow2: when dissecting qcow2, use btrfs clone ioctls for reflinking blocks to target

9 years agoimport: when downloading raw files, show simple progress reports
Lennart Poettering [Sat, 17 Jan 2015 02:22:06 +0000 (03:22 +0100)]
import: when downloading raw files, show simple progress reports

9 years agoimport: simplify the code a bit
Lennart Poettering [Sat, 17 Jan 2015 01:45:42 +0000 (02:45 +0100)]
import: simplify the code a bit

9 years agoimport-raw: when downloading raw images, generate sparse files if we can
Lennart Poettering [Sat, 17 Jan 2015 01:36:23 +0000 (02:36 +0100)]
import-raw: when downloading raw images, generate sparse files if we can

9 years agoimport-raw: set NOCOW flag on all raw images we create
Lennart Poettering [Sat, 17 Jan 2015 01:34:33 +0000 (02:34 +0100)]
import-raw: set NOCOW flag on all raw images we create

9 years agosystemctl: fix import-environment description, trim help to 80 cols
Zbigniew Jędrzejewski-Szmek [Mon, 19 Jan 2015 18:55:44 +0000 (13:55 -0500)]
systemctl: fix import-environment description, trim help to 80 cols

9 years agojournalctl: trim --help to fit in 80 columns
Zbigniew Jędrzejewski-Szmek [Mon, 19 Jan 2015 18:42:34 +0000 (13:42 -0500)]
journalctl: trim --help to fit in 80 columns

Terminals tend to be 80 columns wide by default, and the help
text is only supposed to be a terse reminder anyway.

https://bugzilla.redhat.com/show_bug.cgi?id=1183771

9 years agocgroup: fix typo
Daniel Mack [Fri, 16 Jan 2015 12:44:32 +0000 (13:44 +0100)]
cgroup: fix typo

9 years agoMove DEFINE_TRIVIAL_CLEANUP_FUNC to macro.h
Zbigniew Jędrzejewski-Szmek [Sun, 18 Jan 2015 04:20:00 +0000 (23:20 -0500)]
Move DEFINE_TRIVIAL_CLEANUP_FUNC to macro.h

This remove the need for various header files to include the
(relatively heavyweight) util.h.

9 years agoAdd initialization helper for file_handle_union
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jan 2015 15:28:04 +0000 (10:28 -0500)]
Add initialization helper for file_handle_union

9 years agoman: reindent tmpfiles.d(5)
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jan 2015 06:58:31 +0000 (01:58 -0500)]
man: reindent tmpfiles.d(5)

Reindent to 2 spaces, use more markup.

9 years agoman: mention "wheel" and "adm" in journalctl(1)
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jan 2015 06:15:59 +0000 (01:15 -0500)]
man: mention "wheel" and "adm" in journalctl(1)

https://bugs.freedesktop.org/show_bug.cgi?id=70866

9 years agoman: reindent journalctl(1)
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jan 2015 06:09:55 +0000 (01:09 -0500)]
man: reindent journalctl(1)

Reindent with two spaces, use non-breaking spaces, add <literal> tags.

9 years agobus: drop systemd.kdbus_attach_flags_mask= cmdline
David Herrmann [Sun, 18 Jan 2015 22:56:19 +0000 (23:56 +0100)]
bus: drop systemd.kdbus_attach_flags_mask= cmdline

There is no reason to provide our own attach_flags_mask. We can simply
rely on kdbus.attach_flags_mask= which is read by the kernel *and* kmod.
If it's set, we assume the user wants to override our setting, so we
simply skip setting it.

9 years agocore: write kdbus.attach_flags_mask only on real boot
David Herrmann [Sun, 18 Jan 2015 22:54:42 +0000 (23:54 +0100)]
core: write kdbus.attach_flags_mask only on real boot

The kernel module system is not namespaced, so no container should ever
modify global options. Make sure we set the kdbus attach_flags_mask only
on a real boot as PID1.

9 years agolibudev: fix check for too long packet
Topi Miettinen [Sun, 18 Jan 2015 21:57:35 +0000 (23:57 +0200)]
libudev: fix check for too long packet

Don't use recvmsg(2) return value to check for too long packets
(it doesn't work) but MSG_TRUNC flag.

(David: add parantheses around condition)

9 years agoutil: replace RUN_WITH_LOCALE with extended locale functions
Cristian Rodríguez [Thu, 15 Jan 2015 05:27:34 +0000 (02:27 -0300)]
util: replace RUN_WITH_LOCALE with extended locale functions

There were two callers, one can use strtod_l() and the other strptime_l().

(David: fix up commit-msg and coding-style)

9 years agotimesyncd: consider too long packets as invalid
Topi Miettinen [Sun, 18 Jan 2015 14:01:25 +0000 (16:01 +0200)]
timesyncd: consider too long packets as invalid

If the received NTP message from server didn't fit to our buffer, either
it is doing something nasty or we don't know the protocol. Consider the
packet as invalid.

(David: add parantheses around conditional)

9 years agobus-proxy: don't pretend everyone is root
David Herrmann [Sun, 18 Jan 2015 20:34:33 +0000 (21:34 +0100)]
bus-proxy: don't pretend everyone is root

While it's a lovely scenario, it's probably not really useful. Fix our
GetConnectionUnixUser() to return the actual 'euid' which we asked for,
not the possible uninitialized 'uid'.

9 years agoRevert "test-exec: do not skip all the tests"
David Herrmann [Sun, 18 Jan 2015 19:07:51 +0000 (20:07 +0100)]
Revert "test-exec: do not skip all the tests"

This reverts commit 68e68ca8106e7cd874682ae425843b48579c6539. We *need*
root access to create cgroups. The only exception is if it is run from
within a cgroup with "Delegate=yes". However, this is not always true and
we really shouldn't rely on this.

If your terminal runs from within a systemd --user instance, you're fine.
Everyone else is not (like running from ssh, VTs, and so on..).

9 years agobus: fix SD_BUS_CREDS_AUGMENT on kdbus queries
David Herrmann [Sun, 18 Jan 2015 18:37:34 +0000 (19:37 +0100)]
bus: fix SD_BUS_CREDS_AUGMENT on kdbus queries

If we set SD_BUS_CREDS_AUGMENT, we *need* the PID from the kernel so we
can lookup further information from /proc. However, we *must* set
SD_BUS_CREDS_PIDS in "mask", otherwise, our creds-collector will never
actually copy the pid into "sd_bus_creds". Fix this, so
SD_BUS_CREDS_AUGMENT works even if SD_BUS_CREDS_PID is not specified by
the caller.

9 years agobus: fix typo
David Herrmann [Sun, 18 Jan 2015 18:28:30 +0000 (19:28 +0100)]
bus: fix typo

Fix comment typo and clarify that this is not about privileges but can
have rather arbitrary reasons.

9 years agobus: use EUID over UID and fix unix-creds
David Herrmann [Sun, 18 Jan 2015 12:55:55 +0000 (13:55 +0100)]
bus: use EUID over UID and fix unix-creds

Whenever a process performs an action on an object, the kernel uses the
EUID of the process to do permission checks and to apply on any newly
created objects. The UID of a process is only used if someone *ELSE* acts
on the process. That is, the UID of a process defines who owns the
process, the EUID defines what privileges are used by this process when
performing an action.

Process limits, on the other hand, are always applied to the real UID, not
the effective UID. This is, because a process has a user object linked,
which always corresponds to its UID. A process never has a user object
linked for its EUID. Thus, accounting (and limits) is always done on the
real UID.

This commit fixes all sd-bus users to use the EUID when performing
privilege checks and alike. Furthermore, it fixes unix-creds to be parsed
as EUID, not UID (as the kernel always takes the EUID on UDS). Anyone
using UID (eg., to do user-accounting) has to fall back to the EUID as UDS
does not transmit the UID.

9 years agobus-proxy: fake all UIDs/GIDs, not just the real UID/GID
David Herrmann [Sun, 18 Jan 2015 12:54:46 +0000 (13:54 +0100)]
bus-proxy: fake all UIDs/GIDs, not just the real UID/GID

Make sure we tell the kernel to fake all UIDs/GIDs. Otherwise, the remote
side has no chance of querying our effective UID (which is usually what
they're interested in).

9 years agobus-proxy: fix bus-uid tracking
David Herrmann [Sun, 18 Jan 2015 12:07:21 +0000 (13:07 +0100)]
bus-proxy: fix bus-uid tracking

We need to implicitly allow HELLO from users with the same uid as the bus.
Fix the bus-uid tracking to use the original uid, not the uid after
privilege-dropping.

9 years agologind: hide 'self' links if not available
David Herrmann [Sun, 18 Jan 2015 11:59:39 +0000 (12:59 +0100)]
logind: hide 'self' links if not available

If the caller does not run in a session/seat or has no tracked user, hide
the /org/freedesktop/login1/.../self links in introspection data.
Otherwise, "busctl tree org.freedesktop.login1" tries to query those nodes
even though it cant.

9 years agobus-proxy: don't print error-messages if we check multiple dests
David Herrmann [Sat, 17 Jan 2015 20:18:52 +0000 (21:18 +0100)]
bus-proxy: don't print error-messages if we check multiple dests

If we test the policy against multiple destination names, we really should
not print warnings if one of the names results in DENY. Instead, pass the
whole array of names to the policy and let it deal with it.

9 years agobus-proxy: implement org.freedesktop.DBus.ReloadConfig()
David Herrmann [Sat, 17 Jan 2015 18:06:34 +0000 (19:06 +0100)]
bus-proxy: implement org.freedesktop.DBus.ReloadConfig()

Make sure to reload our xml policy configuration if requested via the bus.

9 years agobus-proxy: fix indentation
David Herrmann [Sat, 17 Jan 2015 17:54:09 +0000 (18:54 +0100)]
bus-proxy: fix indentation

Fix whitespace indentation.

9 years agobus-proxy: drop privileges if run as root
David Herrmann [Sat, 17 Jan 2015 17:23:33 +0000 (18:23 +0100)]
bus-proxy: drop privileges if run as root

We cannot use "User=" in unit-files if we want to retain privileges. So
make bus-proxy.c explicitly drop privileges. However, only do that if
we're root, as there is no need to drop it on the user-bus.

9 years agobus-proxy: share policy between threads
David Herrmann [Sat, 17 Jan 2015 17:07:58 +0000 (18:07 +0100)]
bus-proxy: share policy between threads

This implements a shared policy cache with read-write locks. We no longer
parse the XML policy in each thread.

This will allow us to easily implement ReloadConfig().

9 years agobuild: move stdio-bridge into $PATH
David Herrmann [Sat, 17 Jan 2015 17:01:01 +0000 (18:01 +0100)]
build: move stdio-bridge into $PATH

Make sure stdio-bridge can be found in $PATH. Otherwise, "xyzctl -H"
fails.

9 years agohwdb: restore comments about MSI devices
Maxim Mikityanskiy [Sat, 17 Jan 2015 16:27:12 +0000 (11:27 -0500)]
hwdb: restore comments about MSI devices

Some time ago 95-keymap.rules was replaced by
60-keyboard.hwdb. Original comments for MSI laptops (that were in
95-keymap.rules) were removed, but I think they are important for
understanding what's going on.

https://bugs.freedesktop.org/show_bug.cgi?id=88412

9 years agobus-proxy: set custom thread names
David Herrmann [Sat, 17 Jan 2015 13:32:58 +0000 (14:32 +0100)]
bus-proxy: set custom thread names

Set thread-names to "p$PIDu$UID" and suffix with '*' if truncated. This
helps debugging bus-proxy issues if we want to figure out which
connections are currently open.

9 years agobus-proxy: turn into multi-threaded daemon
David Herrmann [Sat, 17 Jan 2015 12:57:46 +0000 (13:57 +0100)]
bus-proxy: turn into multi-threaded daemon

Instead of using Accept=true and running one proxy for each connection, we
now run one proxy-daemon with a thread per connection. This will enable us
to share resources like policies in the future.

9 years agomissing: add macros for OFD locks
Michael Marineau [Thu, 15 Jan 2015 21:25:00 +0000 (13:25 -0800)]
missing: add macros for OFD locks

9 years agoremove unneeded libgen.h includes
Cristian Rodríguez [Wed, 14 Jan 2015 13:39:53 +0000 (10:39 -0300)]
remove unneeded libgen.h includes

9 years agoGrammar changes to catalog
Chris Atkinson [Tue, 13 Jan 2015 15:06:25 +0000 (10:06 -0500)]
Grammar changes to catalog

9 years agorandom-seed: avoid errors when we cannot write random-seed file
Colin Guthrie [Mon, 12 Jan 2015 20:40:14 +0000 (20:40 +0000)]
random-seed: avoid errors when we cannot write random-seed file

When we call 'systemd-random-seed load' with a read-only /var/lib/systemd,
the cleanup code (which rewrites the random-seed file) will fail and exit.

Arguably, if the filesystem is read-only and the random-seed file exists
then this will be possibly be quite bad for entroy on subsequent reboots
but it should still not make the unit fail.

9 years agobus-proxy: bring back systemd-stdio-bridge
David Herrmann [Fri, 16 Jan 2015 13:45:34 +0000 (14:45 +0100)]
bus-proxy: bring back systemd-stdio-bridge

Now that we want to make bus-proxy multi-threaded, we have to bring back
the systemd-stdio-bridge for our TCP use-cases.

9 years agobus-proxy: extract proxy into Proxy object
David Herrmann [Fri, 16 Jan 2015 13:19:19 +0000 (14:19 +0100)]
bus-proxy: extract proxy into Proxy object

Move all the proxy code into a "struct Proxy" object that can be used
from multiple binaries.

We now dropped SMACK as we have to refactor it to work properly. We can
introduce it later on.

9 years agobus-proxy: refactor bus-creation
David Herrmann [Thu, 15 Jan 2015 16:33:28 +0000 (17:33 +0100)]
bus-proxy: refactor bus-creation

Move local and destination bus creation into a helper function. This
further reduces the line count of main().

9 years agoupdate TODO
Lennart Poettering [Fri, 16 Jan 2015 19:09:23 +0000 (20:09 +0100)]
update TODO

9 years agoimport: support importing qcow2 images
Lennart Poettering [Fri, 16 Jan 2015 19:07:25 +0000 (20:07 +0100)]
import: support importing qcow2 images

With this change the import tool will now unpack qcow2 images into
normal raw disk images, suitable for usage with nspawn.

This allows has the benefit of also allowing importing Ubuntu Cloud
images for usage with nspawn.

9 years agoimport: support downloading .xz compressed images
Lennart Poettering [Fri, 16 Jan 2015 17:42:17 +0000 (18:42 +0100)]
import: support downloading .xz compressed images

That way we can download fedora cloud raw images as-is and decompress
them on-the-fly.

9 years agobuild-sys: add libsystemd-fw where needed
Kay Sievers [Fri, 16 Jan 2015 14:35:42 +0000 (15:35 +0100)]
build-sys: add libsystemd-fw where needed

9 years agobuild-sys: add missing HAVE_LIBIPTC
Kay Sievers [Fri, 16 Jan 2015 14:16:05 +0000 (15:16 +0100)]
build-sys: add missing HAVE_LIBIPTC

9 years agohwbd: add click angle for the Logitech M325
Peter Hutterer [Fri, 16 Jan 2015 01:11:10 +0000 (11:11 +1000)]
hwbd: add click angle for the Logitech M325

This device has 18 stops per rotation == 20 degree angle. Advertised as
"Micro-precise scrolling"

9 years agoos-release: Add PRIVACY_POLICY_URL
Bastien Nocera [Tue, 13 Jan 2015 16:20:24 +0000 (17:20 +0100)]
os-release: Add PRIVACY_POLICY_URL

9 years agoLLDP: Support locally assigned port subtype
Susant Sahani [Thu, 15 Jan 2015 07:11:28 +0000 (12:41 +0530)]
LLDP: Support locally assigned port subtype

The Zyxel switch sends port subtype as Locally assigned (7).
Add LLDP_PORT_SUBTYPE_LOCALLY_ASSIGNED as supported type

reported by Mantas Mikulėnas <grawity@gmail.com>

9 years agoTODO: update
David Herrmann [Thu, 15 Jan 2015 13:09:36 +0000 (14:09 +0100)]
TODO: update

9 years agoudev: merge evdev_id into input_id
David Herrmann [Thu, 15 Jan 2015 11:40:38 +0000 (12:40 +0100)]
udev: merge evdev_id into input_id

There is no reason to keep both separated. We want to avoid API specific
tools and instead keep generic terms like 'input'.

9 years agoudev: fix NULL-ptr deref
David Herrmann [Thu, 15 Jan 2015 11:38:57 +0000 (12:38 +0100)]
udev: fix NULL-ptr deref

Make sure we properly validate the return value of
udev_device_get_sysattr_value(). It might be NULL for several reasons.

9 years agobus-proxyd: move synthesize_name_acquired()
Daniel Mack [Thu, 15 Jan 2015 13:10:28 +0000 (14:10 +0100)]
bus-proxyd: move synthesize_name_acquired()

Move synthesize_name_acquired() to synthesize.c.

9 years agobus-proxy: factor out code for driver handling and message synthesis
Daniel Mack [Thu, 15 Jan 2015 12:56:44 +0000 (13:56 +0100)]
bus-proxy: factor out code for driver handling and message synthesis

Move synthesize_*() into synthesize.c and bus_proxy_process_driver() into
driver.c for better code separation.

9 years agonspawn: fix log typos
Jonathan Boulle [Thu, 15 Jan 2015 07:19:30 +0000 (08:19 +0100)]
nspawn: fix log typos

9 years agohwdb: add MOUSE_WHEEL_CLICK_ANGLE as property
Peter Hutterer [Thu, 8 Jan 2015 23:51:40 +0000 (09:51 +1000)]
hwdb: add MOUSE_WHEEL_CLICK_ANGLE as property

Most mice have a wheel click angle of 15 degrees, i.e. 24 clicks per full
wheel rotation. Some mice, like the Logitech M325 have a larger angle. To
allow userspace to make use of that knowledge, add a property to the hwdb.

This allows for better predictive scrolling. e.g. a mouse that has a smaller
click angle will scroll faster, with this value you can accommodate this
where needed. Likewise, using "half turn of the wheel" or "full turn of the
wheel" as a UI element becomes possible.

This addition is mainly driven by libinput 0.8, having the angle enables
libinput to provide an API that distinguishes between a physical distance
(like touchpad scrolling does) and discrete steps (wheel clicks).
Callers can choose what they prefer based on the device.

9 years agoupdate TODO
Lennart Poettering [Thu, 15 Jan 2015 00:44:03 +0000 (01:44 +0100)]
update TODO

9 years agonspawn,machined: change default container image location from /var/lib/container...
Lennart Poettering [Thu, 15 Jan 2015 00:40:02 +0000 (01:40 +0100)]
nspawn,machined: change default container image location from /var/lib/container to /var/lib/machines

Given that this is also the place to store raw disk images which are
very much bootable with qemu/kvm it sounds like a misnomer to call the
directory "container". Hence, let's change this sooner rather than
later, and use the generic name, in particular since we otherwise try to
use the generic "machine" preferably over the more specific "container"
or "vm".

9 years agoimport: rename "gpt" disk image type to "raw"
Lennart Poettering [Thu, 15 Jan 2015 00:03:33 +0000 (01:03 +0100)]
import: rename "gpt" disk image type to "raw"

After all, nspawn can now dissect MBR partition levels, too, hence
".gpt" appears a misnomer. Moreover, the the .raw suffix for these files
is already pretty popular (the Fedora disk images use it for example),
hence sounds like an OK scheme to adopt.

9 years agofix zsh completion typo
Moez Bouhlel [Wed, 14 Jan 2015 14:33:32 +0000 (14:33 +0000)]
fix zsh completion typo

json-see => json-sse

9 years agotest-path: do not skip tests if we are not root
Ronny Chevalier [Wed, 14 Jan 2015 23:07:15 +0000 (00:07 +0100)]
test-path: do not skip tests if we are not root

We can properly run the tests without being root

9 years agotest-exec: do not skip all the tests
Ronny Chevalier [Wed, 14 Jan 2015 23:07:11 +0000 (00:07 +0100)]
test-exec: do not skip all the tests

Only 5 tests cannot be executed if we are not root, so just skip them
but not the whole set.

9 years agospawn: downgrade loopback detach errors to debug
Lennart Poettering [Wed, 14 Jan 2015 23:51:54 +0000 (00:51 +0100)]
spawn: downgrade loopback detach errors to debug

Sometimes udev or some other background daemon might keep the loopback
devices busy while we already want to detach them. Downgrade the warning
about it.

Given that we use autodetach downgrading these messages should be with
little risk.

9 years agonspawn: add support for limited dissecting of MBR disk images with nspawn
Lennart Poettering [Wed, 14 Jan 2015 23:47:10 +0000 (00:47 +0100)]
nspawn: add support for limited dissecting of MBR disk images with nspawn

With this change nspawn's -i switch now can now make sense of MBR disk
images too - however only if there's only a single, bootable partition
of type 0x83 on the image. For all other cases we cannot really make
sense from the partition table alone.

The big benefit of this change is that upstream Fedora Cloud Images can
now be booted unmodified with systemd-nspawn:

 # wget http://download.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.raw.xz
 # unxz Fedora-Cloud-Base-20141203-21.x86_64.raw.xz
 # systemd-nspawn -i Fedora-Cloud-Base-20141203-21.x86_64.raw -b

Next stop: teach the import logic to automatically download these
images, uncompress and verify them.

9 years agonspawn: pass the container's init PID out via sd_notify()
Lennart Poettering [Wed, 14 Jan 2015 22:29:01 +0000 (23:29 +0100)]
nspawn: pass the container's init PID out via sd_notify()

This is useful for nspawn managers that want to learn when nspawn is
finished with initialiuzation, as well what the PID of the init system
in the container is.

9 years agoupdate TODO
Lennart Poettering [Wed, 14 Jan 2015 22:18:24 +0000 (23:18 +0100)]
update TODO

9 years agonspawn: fix an incorrect assert comparison
Lennart Poettering [Wed, 14 Jan 2015 22:17:07 +0000 (23:17 +0100)]
nspawn: fix an incorrect assert comparison

9 years agologinctl: fix misuse compound literals
Lennart Poettering [Wed, 14 Jan 2015 22:16:28 +0000 (23:16 +0100)]
loginctl: fix misuse compound literals

The lifetime of compound literals is bound to the local scope, we hence
cannot refernce them outside of it.

9 years agosd-bus: tell Coverity that it's OK not to care for return values in some cases
Lennart Poettering [Wed, 14 Jan 2015 22:16:11 +0000 (23:16 +0100)]
sd-bus: tell Coverity that it's OK not to care for return values in some cases

9 years agonspawn: add file system locks for controlling access to container images
Lennart Poettering [Wed, 14 Jan 2015 22:09:02 +0000 (23:09 +0100)]
nspawn: add file system locks for controlling access to container images

This adds three kinds of file system locks for container images:

a) a file system lock next to the actual image, in a .lck file in the
   same directory the image is located. This lock has the benefit of
   usually being located on the same NFS share as the image itself, and
   thus allows locking container images across NFS shares.

b) a file system lock in /run, named after st_dev and st_ino of the
   root of the image. This lock has the advantage that it is unique even
   if the same image is bind mounted to two different places at the same
   time, as the ino/dev stays constant for them.

c) a file system lock that is only taken when a new disk image is about
   to be created, that ensures that checking whether the name is already
   used across the search path, and actually placing the image is not
   interrupted by other code taking the name.

a + b are read-write locks. When a container is booted in read-only mode
a read lock is taken, otherwise a write lock.

Lock b is always taken after a, to avoid ABBA problems.

Lock c is mostly relevant when renaming or cloning images.

9 years agosysv-generator: always use fstatat() if we can
Lennart Poettering [Wed, 14 Jan 2015 21:37:56 +0000 (22:37 +0100)]
sysv-generator: always use fstatat() if we can

9 years agosysv-generator: fix memory leak on failure
Lennart Poettering [Wed, 14 Jan 2015 21:31:03 +0000 (22:31 +0100)]
sysv-generator: fix memory leak on failure

This fixes a memory leak introduced by
1ed0c19f81fd13cdf283c6def0168ce122a853a9

9 years agomachinectl: fix minor memory leak
Lennart Poettering [Wed, 14 Jan 2015 21:30:43 +0000 (22:30 +0100)]
machinectl: fix minor memory leak

9 years agopty: minor modernization
Lennart Poettering [Wed, 14 Jan 2015 01:22:27 +0000 (02:22 +0100)]
pty: minor modernization

We initialize structs during declartion if possible

9 years agomachined: use the FS_IMMUTABLE_FL file flag, if available, to implement a "read-only...
Lennart Poettering [Wed, 14 Jan 2015 01:21:51 +0000 (02:21 +0100)]
machined: use the FS_IMMUTABLE_FL file flag, if available, to implement a "read-only" concept for raw disk images, too

9 years agoutil: the chattr flags field is actually unsigned, judging by kernel sources
Lennart Poettering [Wed, 14 Jan 2015 01:04:17 +0000 (02:04 +0100)]
util: the chattr flags field is actually unsigned, judging by kernel sources

Unlike some client code suggests...

9 years agoptyfw: add missing error check
Lennart Poettering [Wed, 14 Jan 2015 01:01:42 +0000 (02:01 +0100)]
ptyfw: add missing error check