summaryrefslogtreecommitdiffstats
path: root/src/tmpfiles/tmpfiles.c
diff options
context:
space:
mode:
authorMichael Biebl <mbiebl@gmail.com>2020-10-20 23:07:16 +0200
committerGitHub <noreply@github.com>2020-10-20 23:07:16 +0200
commit427103f7a627af9a89b5eb470b13c8ff50ca43ae (patch)
treedb47a2bed0ee77da33bae1231286f2e074ec7a93 /src/tmpfiles/tmpfiles.c
parentbootctl: add @current/@oneshot/@default targets to set-default/set-oneshot (diff)
parenttmpfiles,sysusers: disable --image= support in standalone versions (diff)
downloadsystemd-427103f7a627af9a89b5eb470b13c8ff50ca43ae.tar.xz
systemd-427103f7a627af9a89b5eb470b13c8ff50ca43ae.zip
Merge pull request #17297 from keszybz/tmpfiles-sysusers-disable-standalone-image
tmpfiles,sysusers: disable --image= support in standalone versions
Diffstat (limited to 'src/tmpfiles/tmpfiles.c')
-rw-r--r--src/tmpfiles/tmpfiles.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 2a8e89b783..b6596fd0c7 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -3105,11 +3105,15 @@ static int parse_argv(int argc, char *argv[]) {
break;
case ARG_IMAGE:
+#ifdef STANDALONE
+ return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),
+ "This systemd-tmpfiles version is compiled without support for --image=.");
+#else
r = parse_path_argument_and_warn(optarg, /* suppress_root= */ false, &arg_image);
if (r < 0)
return r;
-
- /* Imply -E here since it makes little sense to create files persistently in the /run mointpoint of a disk image */
+#endif
+ /* Imply -E here since it makes little sense to create files persistently in the /run mountpoint of a disk image */
_fallthrough_;
case 'E':
@@ -3331,9 +3335,11 @@ DEFINE_PRIVATE_HASH_OPS_WITH_VALUE_DESTRUCTOR(item_array_hash_ops, char, string_
ItemArray, item_array_free);
static int run(int argc, char *argv[]) {
+#ifndef STANDALONE
_cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL;
_cleanup_(decrypted_image_unrefp) DecryptedImage *decrypted_image = NULL;
_cleanup_(umount_and_rmdir_and_freep) char *unlink_dir = NULL;
+#endif
_cleanup_strv_free_ char **config_dirs = NULL;
bool invalid_config = false;
ItemArray *a;
@@ -3393,6 +3399,7 @@ static int run(int argc, char *argv[]) {
if (r < 0)
return r;
+#ifndef STANDALONE
if (arg_image) {
assert(!arg_root);
@@ -3409,6 +3416,9 @@ static int run(int argc, char *argv[]) {
if (!arg_root)
return log_oom();
}
+#else
+ assert(!arg_image);
+#endif
items = ordered_hashmap_new(&item_array_hash_ops);
globs = ordered_hashmap_new(&item_array_hash_ops);