summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-12-10build-sys: define arm as secondary architecture for arm64Zbigniew Jędrzejewski-Szmek
Completely unstested. Fixes #4862.
2016-12-10Merge pull request #4844 from hadess/sensor-quirksLennart Poettering
udev: Add rules for accelerometer orientation quirks
2016-12-10hwdb_parser: make sure that our patterns match the full propertyZbigniew Jędrzejewski-Szmek
We would catch stuff like: ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0.0., 0 but not ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 0.0. because the match would stop at the next-to-last char. Fix that by requiring a line end.
2016-12-10hwdb_parser: add support for ACCEL_MOUNT_MATRIXZbigniew Jędrzejewski-Szmek
We test that we have exactly three rows of three reals separated by two semicolons.
2016-12-10udev: Add rules for accelerometer orientation quirksBastien Nocera
This commit adds a rules file to extract the properties from hwdb to set on i2c IIO devices. This is used to set the ACCEL_MOUNT_MATRIX property on IIO devices, to be consumed by iio-sensor-proxy or equivalent daemon. The hwdb file contains documentation on how to write quirks. Note however that mount information is usually exported in: - the device-tree for ARM devices - the ACPI DSDT for Intel-compatible devices but currently not extracted by the kernel. Also note that some devices have the framebuffer rotation that changes between the bootloader and the main system, which might mean that the accelerometer is then wrongly oriented. This is a missing feature in the i915 kernel driver: https://bugs.freedesktop.org/show_bug.cgi?id=94894 which needs to be fixed, and won't require quirks.
2016-12-10Merge pull request #4835 from poettering/unit-name-printfZbigniew Jędrzejewski-Szmek
Various specifier resolution fixes.
2016-12-10Merge pull request #4795 from poettering/dissectZbigniew Jędrzejewski-Szmek
Generalize image dissection logic of nspawn, and make it useful for other tools.
2016-12-10nspawn: add missing -E to getopt_long (#4860)Wim de With
2016-12-09tree-wide: replace all readdir cycles with FOREACH_DIRENT{,_ALL} (#4853)Reverend Homer
2016-12-08Merge pull request #4686 from poettering/machine-id-app-specificZbigniew Jędrzejewski-Szmek
Add new "khash" API and add new sd_id128_get_machine_app_specific() function
2016-12-07network: fix const qualifier (#4849)David Michael
Follow up for #4809.
2016-12-07nspawn: resolv.conf might not be created initially (#4799)Franck Bui
This might happen that resolv.conf is missing in a minimal rootfs and in this case the following warning is emitted: Failed to mount n/a on /mnt/etc/resolv.conf (MS_BIND ""): No such file or directory This patch fixes this case.
2016-12-07Merge pull request #4843 from joukewitteveen/protocolLennart Poettering
Go through stop_post on failure (#4770)
2016-12-07network: support negation in matching patterns (#4809)David Michael
2016-12-07core: add a note clarifying that we should be careful when adding new specifiersLennart Poettering
2016-12-07core: deprecate %c, %r, %R specifiersLennart Poettering
%c and %r rely on settings made in the unit files themselves and hence resolve to different values depending on whether they are used before or after Slice=. Let's simply deprecate them and drop them from the documentation, as that's not really possible to fix. Moreover they are actually redundant, as the same information may always be queried from /proc/self/cgroup and /proc/1/cgroup. (Accurately speaking, %R is actually not broken like this as it is constant. However, let's remove all cgroup-related specifiers at once, as it is also redundant, and doesn't really make much sense alone.)
2016-12-07update TODOLennart Poettering
2016-12-07tests: let's make function tables static/constLennart Poettering
2016-12-07core: add specifier expansion to ReadOnlyPaths= and friendsLennart Poettering
Expanding specifiers here definitely makes sense. Also simplifies the loop a bit, as there's no reason to keep "prev" around...
2016-12-07core: add specifier expansion to RequiresMountsFor=Lennart Poettering
This might be useful for some people, for example to pull in mounts for paths including the machine ID or hostname.
2016-12-07core: turn on specifier expansion for more unit file settingsLennart Poettering
Let's permit specifier expansion at a numbre of additional fields, where arbitrary strings might be passed where this might be useful one day. (Or at least where there's no clear reason where it wouldn't make sense to have.)
2016-12-07core: use unit_full_printf() at a couple of locations we used ↵Lennart Poettering
unit_name_printf() before For settings that are not taking unit names there's no reason to use unit_name_printf(). Use unit_full_printf() instead, as the names are validated anyway in one form or another after expansion.
2016-12-07core: resolve more specifiers in unit_name_printf()Lennart Poettering
unit_name_printf() is usually what we use when the resulting string shall qualify as unit name, and it hence avoids resolving specifiers that almost certainly won't result in valid unit names. Add a couple of more specifiers that unit_full_printf() resolves also to the list unit_name_printf() resolves, as they are likely to be useful in valid unit names too. (Note that there might be cases where this doesn't hold, but we should still permit this, as more often than not they are safe, and if people want to use them that way, they should be able to.)
2016-12-07man: drop reference to %U being uselessLennart Poettering
This paragraph was a missed left-over from 79413b673b45adc98dfeaec882bbdda2343cb2f9. Drop it now.
2016-12-07core: move specifier expansion out of service.c/socket.cLennart Poettering
This monopolizes unit file specifier expansion in load-fragment.c, and removes it from socket.c + service.c. This way expansion becomes an operation done exclusively at time of loading unit files. Previously specifiers were resolved for all settings during loading of unit files with the exception of ExecStart= and friends which were resolved in socket.c and service.c. With this change the latter is also moved to the loading of unit files. Fixes: #3061
2016-12-07man: update the nspawn man page, and document what kind of dissection ↵Lennart Poettering
features we now support
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-07nspawn: when generating a machine name from an image name, truncate .raw suffixLennart Poettering
Let's prettify the machine name we generate for image-based containers: let's chop off the .raw suffix before using it as machine name.
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-07minor code beautificationsLennart Poettering
2016-12-07dissect: add small "systemd-dissect" tool as wrapper around dissect-image.cLennart Poettering
This adds a small tool that may be used to look into OS images, and mount them to any place. This is mostly a friendlier version of test-dissect-image.c. I am not sure this should really become a proper command of systemd, hence for now do not install it into bindir, but simply libexecdir. This tool is already pretty useful since you can mount image files with it, honouring the various partitions correctly. I figure this is going to become more interesting if the dissctor learns luks and verity support.
2016-12-07util-lib: drop unnecessary NULL checkLennart Poettering
DEFINE_TRIVIAL_CLEANUP_FUNC() already does that check, no need to duplicate it.
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-12-07util-lib: add easy helpers for temporary directories that rmdir()ed via ↵Lennart Poettering
_cleanup_ This adds mkdtemp_malloc() that is a combination of mkdtemp() plus strdup(). It initializes its return paremeter only if the temporary directory could be created successfully, so that the parameter is exactly non-NULL when the directory exists. rmdir_and_free() and rmdir_and_freep() are also added, and the latter may be used inside of _cleanup_ for such a directory string variable, to automatically rmdir() the directory if it is non-NULL when the scope exits. rmdir_and_free() is similar to the existing rm_rf_and_free() however, is only removes a single directory and does not operate recursively.
2016-12-07nspawn: port nspawn to new generalized image dissection codeLennart Poettering
Let's make use of the new internal API. This mostly doesn't change anything for the caller, however, "systemd-nspawn --image=/dev/sda7" works now as the new code can handle disk images with no partition tables, and make any detected images directly the root.
2016-12-07util-lib: split out image dissecting code and loopback code from nspawnLennart Poettering
This adds two new APIs to systemd: - loop-util.h is a simple internal API for allocating, setting up and releasing loopback block devices. - dissect-image.h is an internal API for taking apart disk images and figuring out what the purpose of each partition is. Both APIs are basically refactored versions of similar code in nspawn. This rework should permit us to reuse this in other places than just nspawn in the future. Specifically: to implement RootImage= in the service image, similar to RootDirectory=, but operating on a disk image; to unify the gpt-auto-discovery generator code with the discovery logic in nspawn; to add new API to machined for determining the OS version of a disk image (i.e. not just running containers). This PR does not make any such changes however, it just provides the new reworked API. The reworked code is also slightly more powerful than the nspawn original one. When pointing it to an image or block device with a naked file system (i.e. no partition table) it will simply make it the root device.
2016-12-07libudev: set errno if udev_new() failsLennart Poettering
All other constructors in libudev do that, let's also do this for udev_new().
2016-12-07dhcp: bind udp sockets to interfaces (#4822)27o
2016-12-07Merge pull request #4841 from hadess/oke-barcode-readerPeter Hutterer
hwdb: Add fixed layout for a few devices
2016-12-06calendarspec: always interpret missing seconds as :00 (#4813)Doug Christman
"*:*" should be equivalent to "*-*-* *:*:00" (minutely) rather than running every microsecond. Fixes #4804
2016-12-06service: go through stop_post on failure (#4770)Jouke Witteveen
2016-12-06man: fix $SERVICE_RESULT/$EXIT_CODE/$EXIT_STATUS documentationJouke Witteveen
Note that any exit code is available through $EXIT_STATUS and not through $EXIT_CODE. This mimics siginfo.
2016-12-06networkd: Use dhcp correct type for IP port (#4840)Susant Sahani
Fixes: #4839
2016-12-06core: introduce parse_ip_port (#4825)Susant Sahani
1. Listed in TODO. 2. Tree wide replace safe_atou16 with parse_ip_port incase it's used for ports.
2016-12-06hwdb: Add fixed layout for another YubikeyBastien Nocera
2016-12-06hwdb: Add fixed layout for OKE barcode readerBastien Nocera
2016-12-06time-util: accept "µs" as time unit, in addition to "us" (#4836)Lennart Poettering
Let's accept "µs" as alternative time unit for microseconds. We already accept "us" and "usec" for them, lets extend on this and accept the proper scientific unit specification too. We will never output this as time unit, but it's fine to accept it, after all we are pretty permissive with time units already.
2016-12-06rules: consider MMC device partitions with partition number > 9 (#4831)Kieran Colford
Add entries for extra partitions found on MMC devices (common in Chromebooks).
2016-12-06Merge pull request #4838 from phomes/misc-cleanup2Evgeny Vereshchagin
Misc cleanups
2016-12-06core: remove unused variableThomas Hindoe Paaboel Andersen