Commit Graph

36942 Commits

Author SHA1 Message Date
Lennart Poettering fe1bff158e update TODO 2018-11-26 18:09:01 +01:00
Lennart Poettering f5095a6af0 test: add simple test for importd
It tests importing and exporting, and a few other machinectl commands.

It currently does not test pulling (i.e. http downloads), but we might
want to add that later on.
2018-11-26 18:09:01 +01:00
Lennart Poettering d02bfa50f6 import: properly fail if tar exited non-zero, not just when it segfaulted or such 2018-11-26 18:09:01 +01:00
Lennart Poettering 82f299e74e export-tar: check tar result as well
Let's make sure we properly notice when tar doesn't actually work: let's
propagate the error.
2018-11-26 18:09:01 +01:00
Lennart Poettering e288e0599e machinectl: be more careful when generating machine name from path name
Let's use our new path_extract_filename() for extracting the basename
from a path in a safe fashion.

Let's do this for all our three local import calls.
2018-11-26 18:09:01 +01:00
Lennart Poettering 176a05c24b importd: immediately validate whether fd is of right type when receiving it
Just some paranoia.
2018-11-26 18:09:01 +01:00
Lennart Poettering 844416b64c stat-util: add fd_verify_directory(), similar to fd_verify_regular() 2018-11-26 18:09:01 +01:00
Lennart Poettering 0c9448fa82 copy: remove reflinking debug message
It pretty much ends up in an inner loop most of the time, hence let's
just remove it. This is pretty easily debuggable with strace anyway...
2018-11-26 18:09:01 +01:00
Lennart Poettering a60c8eee10 path-util: add helper for extracting last filename from path 2018-11-26 18:09:01 +01:00
Lennart Poettering 77e0a1b5e0 path-util: handle NULL inputs in last_path_component() 2018-11-26 18:09:01 +01:00
Lennart Poettering 5f7ecd610c import: drop logic of setting up /var/lib/machines as btrfs loopback mount
Let's simplify things and drop the logic that /var/lib/machines is setup
as auto-growing btrfs loopback file /var/lib/machines.raw.

THis was done in order to make quota available for machine management,
but quite frankly never really worked properly, as we couldn't grow the
file system in sync with its use properly. Moreover philosophically it's
problematic overriding the admin's choice of file system like this.

Let's hence drop this, and simplify things. Deleting code is a good
feeling.

Now that regular file systems provide project quota we could probably
add per-machine quota support based on that, hence the btrfs quota
argument is not that interesting anymore (though btrfs quota is a bit
more powerful as it allows recursive quota, i.e. that the machine pool
gets an overall quota in addition to per-machine quota).
2018-11-26 18:09:01 +01:00
Lennart Poettering e21b7229ff import: rerrange tarball/fs imports that have a single top-level directory containing the OS tree
Let's handle tarball imports nicer that have a single top-level
directory containing the OS tree: let's move everything down during
import, so that the OS tree is ready to use automatically.

Fixes: #2116
2018-11-26 18:09:01 +01:00
Lennart Poettering 1d7579c473 machine: add support for importing containers from plain directories
Fixes: #2728

This is also supposed to be preparation for doing #10234 eventually,
where a very similar operation is requested: instead of importing a tree
to /var/lib/machines it would need to be imported into
/var/lib/portables/.
2018-11-26 18:09:01 +01:00
Lennart Poettering b3cade0c27 copy: support getting progress feedback from the various copy functions
This adds two optional functions that may be passed to the various copy
functions. One is invoked whenever we start copying a new file object,
the other while we copy file payload in each loop iteration.

When the caller passes one or both they can get notifications about copy
progress, for example to log where things are.
2018-11-26 18:09:01 +01:00
Lennart Poettering 576cf244a4 man: document that machinectl is also happy with block devices these days 2018-11-26 18:09:01 +01:00
Lennart Poettering 9cb0509c5f polkit: add missing method calls
These were missing, hence the polkit hook-up for them never worked...
2018-11-26 18:09:01 +01:00
Lennart Poettering 5a8582fbff import: use parse_percent() where appropriate 2018-11-26 18:09:01 +01:00
Lennart Poettering b11591af27 import-util: downgrade log message about quota to LOG_DEBUG
We invoke this usually on a temporary path before renaming it into
place. This means the log message is quite suprising as it mentions a
weird path with random characters in it. Hence, let's downgrade the
message in order not to confuse the user.
2018-11-26 18:09:01 +01:00
Lennart Poettering 1295c9066a import: prefer fd_get_path() over readlink_malloc() where applicable 2018-11-26 18:09:01 +01:00
Lennart Poettering fd67de0152 tree-wide: fix a few missing includes 2018-11-26 18:09:01 +01:00
Lennart Poettering b0325c991e import: tiny modernization/simplification
Less indentation and fewer {} are always a good thing.
2018-11-26 18:09:01 +01:00
Lennart Poettering 4b71c27b42 import: use generic word 'transfer' instead of 'import'
After all, these lines are also printed for exports/pulls...
2018-11-26 18:09:01 +01:00
Lennart Poettering 5b6299ee8b import: downgrade log message to LOG_WARNING, because we ignore the failure 2018-11-26 18:09:01 +01:00
Lennart Poettering a0ee3d93bb
Merge pull request #10919 from yuwata/sd-device-monitor-fixes
sd-device-monitor: several fixes
2018-11-26 18:08:41 +01:00
Harald Hoyer 4e9322048b generator.c: systemd-fsck-root.service conflict with shutdown.target
Otherwise a "reboot" or "poweroff" in the initramfs will have to wait
until systemd-fsck-root.service has completed, which might never happen
if the root device never shows up.
2018-11-26 16:51:22 +01:00
Yu Watanabe 938dbb292a
Merge pull request #10901 from poettering/startswith-list
add new STARTSWITH_SET() macro
2018-11-26 22:40:51 +09:00
Lennart Poettering a7f71a01b8
Merge pull request #10927 from yuwata/udev-ctrl-cleanup
udev: update log messages and fix coding style issues
2018-11-26 14:23:28 +01:00
Lennart Poettering 91419787f0
Merge pull request #10925 from yuwata/sd-boot-fixes
sd-boot: fixes trailing whitespace trimming and updates document
2018-11-26 14:20:36 +01:00
Lennart Poettering a666d07eac
Merge pull request #10910 from yuwata/list-cleanups
basic/list: tiny fixes
2018-11-26 14:19:03 +01:00
Lennart Poettering 50891a20ea
Merge pull request #10909 from yuwata/import-cleanups
Import: cleanups
2018-11-26 14:18:23 +01:00
Lennart Poettering 9630d4dd68
Merge pull request #10894 from poettering/root-cgroup-fix
A multitude of cgroup fixes
2018-11-26 14:13:01 +01:00
Lennart Poettering 3ebc048b6b terminal-util: use PATH_STARTSWITH_SET() instead of plain startswith() where appropriate
After all, we deal with paths here.
2018-11-26 14:08:46 +01:00
Lennart Poettering b48a0e0956 journal-upload: use static initialization 2018-11-26 14:08:46 +01:00
Lennart Poettering 15d121b0e2 journal-remote: shorten code a bit by using strcspn() 2018-11-26 14:08:46 +01:00
Lennart Poettering da9fc98ded tree-wide: port more code over to PATH_STARTSWITH_SET() 2018-11-26 14:08:46 +01:00
Lennart Poettering d898ed65ab path-util: beef up PATH_STARTSWITH_SET() macro a bit
Let's remove duplicate evaluation, and let's return the result of the
succesful path_startswith() call, i.e. the suffix to the matching
prefix.
2018-11-26 14:08:46 +01:00
Lennart Poettering 0cbd293e12 tree-wide: port over more cases to STR_IN_SET() 2018-11-26 14:08:46 +01:00
Lennart Poettering 49fe5c0996 tree-wide: port various places over to STARTSWITH_SET() 2018-11-26 14:08:46 +01:00
Lennart Poettering 52f1552073 strv: add new macro STARTSWITH_SET()
This is to startswith() what PATH_STARTSWITH_SET() is to
path_startswith().

Or in other words, checks if the specified string has any of the listed
prefixes, and if so, returns the remainder of the string.
2018-11-26 14:06:01 +01:00
Lennart Poettering d7b659ef01 update TODO 2018-11-26 13:41:07 +01:00
Evgeny Vereshchagin 2e646cbed8 tests: add a fuzzer for the udev rules parser (#10929) 2018-11-26 18:14:30 +09:00
Yu Watanabe 6acf1ccba5 udevd: do not call udev_ctrl_enable_receiving() if the socket is passed from pid1
Before c4b69e990f, if the socket fd is
passed from pid1, `udev_ctrl_enable_receiving()` was not called.
Let's preserve the original logic.
2018-11-26 11:57:48 +09:00
Yu Watanabe 49c603bd5e udev: drop duplicate whitespaces 2018-11-26 11:53:21 +09:00
Yu Watanabe 572909a38a udev-ctrl: update log messages 2018-11-26 11:52:40 +09:00
Yu Watanabe b4ba2fe3f1 udev-rules: include device sysname in log messages 2018-11-26 11:37:29 +09:00
Yu Watanabe 9315f853c4 udev-ctrl: fix coding style isuues 2018-11-26 11:10:46 +09:00
Yu Watanabe 87da558f2b
Merge pull request #10926 from AsciiWolf/copyright
Drop my copyright
2018-11-26 09:33:32 +09:00
AsciiWolf 333ee1d104 mkosi: drop my copyright 2018-11-26 00:30:28 +01:00
AsciiWolf 6d9906d90c po: drop my copyright (cs.po) 2018-11-26 00:26:03 +01:00
Yu Watanabe cbae79b8d0 man: systemd-boot does not read loader.conf.d/*.conf
Fixes #10923.
2018-11-26 06:58:31 +09:00