summaryrefslogtreecommitdiff
path: root/src/machine/image-dbus.c
AgeCommit message (Collapse)Author
2017-02-17copy: change the various copy_xyz() calls to take a unified flags parameterLennart Poettering
This adds a unified "copy_flags" parameter to all copy_xyz() function calls, replacing the various boolean flags so far used. This should make many invocations more readable as it is clear what behaviour is precisely requested. This also prepares ground for adding support for more modes later on.
2017-01-14Merge pull request #4879 from poettering/systemdZbigniew Jędrzejewski-Szmek
2016-12-29machined: remove unused variable (#4993)Thomas H. P. Andersen
2016-12-21dissect: make using a generic partition as root partition optionalLennart Poettering
In preparation for reusing the image dissector in the GPT auto-discovery logic, only optionally fail the dissection when we can't identify a root partition. In the GPT auto-discovery we are completely fine with any kind of root, given that we run when it is already mounted and all we do is find some additional auxiliary partitions on the same disk.
2016-12-20dissect: optionally, only look for GPT partition tables, nothing elseLennart Poettering
This is useful for reusing the dissector logic in the gpt-auto-discovery logic: there we really don't want to use MBR or naked file systems as root device.
2016-12-07nspawn/dissect: automatically discover dm-verity verity partitionsLennart Poettering
This adds support for discovering and making use of properly tagged dm-verity data integrity partitions. This extends both systemd-nspawn and systemd-dissect with a new --root-hash= switch that takes the root hash to use for the root partition, and is otherwise fully automatic. Verity partitions are discovered automatically by GPT table type UUIDs, as listed in https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/ (which I updated prior to this change, to include new UUIDs for this purpose. mkosi with https://github.com/systemd/mkosi/pull/39 applied may generate images that carry the necessary integrity data. With that PR and this commit, the following simply lines suffice to boot up an integrity-protected container image: ``` # mkdir test # cd test # mkosi --verity # systemd-nspawn -i ./image.raw -bn ``` Note that mkosi writes the image file to "image.raw" next to a a file "image.roothash" that contains the root hash. systemd-nspawn will look for that file and use it if it exists, in case --root-hash= is not specified explicitly.
2016-12-07dissect: add support for encrypted imagesLennart Poettering
This adds support to the image dissector to deal with encrypted images (only LUKS). Given that we now have a neatly isolated image dissector codebase, let's add a new feature to it: support for automatically dealing with encrypted images. This is then exposed in systemd-dissect and nspawn. It's pretty basic: only support for passphrase-based encryption. In order to ensure that "systemd-dissect --mount" results in mount points whose backing LUKS DM devices are cleaned up automatically we use the DM_DEV_REMOVE ioctl() directly on the device (in DM_DEFERRED_REMOVE mode). libgcryptsetup at the moment doesn't provide a proper API for this. Thankfully, the ioctl() API is pretty easy to use.
2016-12-07machined: add API for querying the OS release of a machine imageLennart Poettering
This adds a bus call GetImageOSRelease() to the Manager interface that retrieves the /etc/os-release file of a machine image. It matches the existing GetMachineOSRelease() call, however operates on a disk image rather than a running container. The backend for this call on .raw images is implemented via the generalized image dissector, which makes this scheme relatively easy to implement.
2016-06-24machined: "machinectl clean" can take a while, do it asynchronously from a ↵Lennart Poettering
background process This is a follow-up to 5d2036b5f3506bd0ff07042aee8d69c26db32298, and also makes the "machinectl clean" verb asynchronous, after all it's little more than a series of image removals. The changes required to make this happen are a bit more comprehensive as we need to pass information about deleted images back to the client, as well as information about the image we failed on if we failed on one. Hence, create a temporary file in /tmp, serialize that data into, and read it from the parent after the operation is complete.
2016-05-02machined: rework copy-from/copy-to operation to use generic Operation objectLennart Poettering
With this all potentially slow operations are done out-of-process, asynchronously, using the same "Operation" object.
2016-05-02machined: also make image removal operation asynchronousLennart Poettering
If we remove a directory image (i.e. not a btrfs snapshot) then things might get quite expensive, hence run this asynchronous in a forked off process, too.
2016-05-02util: rework sigkill_wait() to not require pid_t pointerLennart Poettering
Let's make sigkill_wait() take a normal pid_t, and add sigkill_waitp() that takes a pointer (which is useful for usage in _cleanup_), following the usual logic we have for this.
2016-05-02machined: run clone operation asynchronously in the backgroundLennart Poettering
Cloning an image can be slow, if the image is not on a btrfs subvolume, hence let's make sure we do this asynchronously in a child process, so that machined isn't blocked as long as we process the client request. This adds a new, generic "Operation" object to machined, that is used to track these kind of background processes. This is inspired by the MachineOperation object that already exists to make copy operations asynchronous. A later patch will rework the MachineOperation logic to use the generic Operation instead.
2016-04-25machined: generate a nicer error when the user tries "machinectl clone" on ↵Lennart Poettering
non-btrfs file systems (#3117) Fixes: #2060 (Of course, in the long run, we should probably add a copy-based fall-back. But given how slow that is, this probably requires some asynchronous forking logic like the CopyFrom() and CopyTo() method calls already implement.)
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2016-01-27machined: add early checks for unrealistically large image/pool sizesLennart Poettering
2015-10-27util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering
2015-10-27user-util: move UID/GID related macros from macro.h to user-util.hLennart Poettering
2015-09-06bus-util: support details in CheckAuthorization callsMichael Chapman
Extra details for an action can be supplied when calling polkit's CheckAuthorization method. Details are a list of key/value string pairs. Custom policy can use these details when making authorization decisions.
2015-04-29sd-bus: drop bus parameter from message callback prototypeLennart Poettering
This should simplify the prototype a bit. The bus parameter is redundant in most cases, and in the few where it matters it can be derived from the message via sd_bus_message_get_bus().
2015-02-25machined,machinectl: add calls for changing container/VM quotasLennart Poettering
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2015-02-18logind: open up most bus calls for unpriviliged processes, using PolicyKitLennart Poettering
Also, allow clients to alter their own objects without any further priviliges. i.e. this allows clients to kill and lock their own sessions without involving PK.
2015-02-18machined: open up most of machined's commands to unprivileged clients via ↵Lennart Poettering
PolicyKit
2015-01-19machined: refer to the disk space allocated for an image to "usage" rather ↵Lennart Poettering
than "size" After all, it's closer to the "du"-reported value than to the file sizes...
2014-12-28machined: Fix MarkReadOnly method's name on busSylvain Plantefève
2014-12-28machined: don't look for images on each property get, but cache the image ↵Lennart Poettering
object inbetween
2014-12-28machined: add support for reporting image size via btrfs quotaLennart Poettering
2014-12-28machinectl/machined: implement "rename", "clone", "read-only" verbs for ↵Lennart Poettering
machine images
2014-12-28machined: add "machinectl remove" for removing imagesLennart Poettering
2014-12-28machined: Move image discovery logic into src/shared, so that we can make ↵Lennart Poettering
use of it from nspawn
2014-12-25machined: beef up machined image listing with creation/modification times of ↵Lennart Poettering
subvolumes We make use of the btrfs subvol crtime for this, and for gpt images of a manually managed xattr, if we can.
2014-12-19machined: add a full bus object for imagesLennart Poettering