Compare commits
2 Commits
c4b843473a
...
427103f7a6
Author | SHA1 | Date |
---|---|---|
Michael Biebl | 427103f7a6 | |
Zbigniew Jędrzejewski-Szmek | 3537577c37 |
|
@ -3094,6 +3094,7 @@ if enable_sysusers
|
||||||
'systemd-sysusers.standalone',
|
'systemd-sysusers.standalone',
|
||||||
'src/sysusers/sysusers.c',
|
'src/sysusers/sysusers.c',
|
||||||
include_directories : includes,
|
include_directories : includes,
|
||||||
|
c_args : '-DSTANDALONE',
|
||||||
link_with : [libshared_static,
|
link_with : [libshared_static,
|
||||||
libbasic,
|
libbasic,
|
||||||
libbasic_gcrypt,
|
libbasic_gcrypt,
|
||||||
|
@ -3136,6 +3137,7 @@ if conf.get('ENABLE_TMPFILES') == 1
|
||||||
'systemd-tmpfiles.standalone',
|
'systemd-tmpfiles.standalone',
|
||||||
systemd_tmpfiles_sources,
|
systemd_tmpfiles_sources,
|
||||||
include_directories : includes,
|
include_directories : includes,
|
||||||
|
c_args : '-DSTANDALONE',
|
||||||
link_with : [libshared_static,
|
link_with : [libshared_static,
|
||||||
libbasic,
|
libbasic,
|
||||||
libbasic_gcrypt,
|
libbasic_gcrypt,
|
||||||
|
|
|
@ -1825,10 +1825,15 @@ static int parse_argv(int argc, char *argv[]) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ARG_IMAGE:
|
case ARG_IMAGE:
|
||||||
|
#ifdef STANDALONE
|
||||||
|
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),
|
||||||
|
"This systemd-sysusers version is compiled without support for --image=.");
|
||||||
|
#else
|
||||||
r = parse_path_argument_and_warn(optarg, /* suppress_root= */ false, &arg_image);
|
r = parse_path_argument_and_warn(optarg, /* suppress_root= */ false, &arg_image);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case ARG_REPLACE:
|
case ARG_REPLACE:
|
||||||
if (!path_is_absolute(optarg) ||
|
if (!path_is_absolute(optarg) ||
|
||||||
|
@ -1916,9 +1921,11 @@ static int read_config_files(char **args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int run(int argc, char *argv[]) {
|
static int run(int argc, char *argv[]) {
|
||||||
|
#ifndef STANDALONE
|
||||||
_cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL;
|
_cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL;
|
||||||
_cleanup_(decrypted_image_unrefp) DecryptedImage *decrypted_image = NULL;
|
_cleanup_(decrypted_image_unrefp) DecryptedImage *decrypted_image = NULL;
|
||||||
_cleanup_(umount_and_rmdir_and_freep) char *unlink_dir = NULL;
|
_cleanup_(umount_and_rmdir_and_freep) char *unlink_dir = NULL;
|
||||||
|
#endif
|
||||||
_cleanup_close_ int lock = -1;
|
_cleanup_close_ int lock = -1;
|
||||||
Item *i;
|
Item *i;
|
||||||
int r;
|
int r;
|
||||||
|
@ -1938,6 +1945,7 @@ static int run(int argc, char *argv[]) {
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
#ifndef STANDALONE
|
||||||
if (arg_image) {
|
if (arg_image) {
|
||||||
assert(!arg_root);
|
assert(!arg_root);
|
||||||
|
|
||||||
|
@ -1954,6 +1962,9 @@ static int run(int argc, char *argv[]) {
|
||||||
if (!arg_root)
|
if (!arg_root)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
assert(!arg_image);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* If command line arguments are specified along with --replace, read all
|
/* If command line arguments are specified along with --replace, read all
|
||||||
* configuration files and insert the positional arguments at the specified
|
* configuration files and insert the positional arguments at the specified
|
||||||
|
|
|
@ -3105,11 +3105,15 @@ static int parse_argv(int argc, char *argv[]) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ARG_IMAGE:
|
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);
|
r = parse_path_argument_and_warn(optarg, /* suppress_root= */ false, &arg_image);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
#endif
|
||||||
/* Imply -E here since it makes little sense to create files persistently in the /run mointpoint of a disk image */
|
/* Imply -E here since it makes little sense to create files persistently in the /run mountpoint of a disk image */
|
||||||
_fallthrough_;
|
_fallthrough_;
|
||||||
|
|
||||||
case 'E':
|
case 'E':
|
||||||
|
@ -3331,9 +3335,11 @@ DEFINE_PRIVATE_HASH_OPS_WITH_VALUE_DESTRUCTOR(item_array_hash_ops, char, string_
|
||||||
ItemArray, item_array_free);
|
ItemArray, item_array_free);
|
||||||
|
|
||||||
static int run(int argc, char *argv[]) {
|
static int run(int argc, char *argv[]) {
|
||||||
|
#ifndef STANDALONE
|
||||||
_cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL;
|
_cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL;
|
||||||
_cleanup_(decrypted_image_unrefp) DecryptedImage *decrypted_image = NULL;
|
_cleanup_(decrypted_image_unrefp) DecryptedImage *decrypted_image = NULL;
|
||||||
_cleanup_(umount_and_rmdir_and_freep) char *unlink_dir = NULL;
|
_cleanup_(umount_and_rmdir_and_freep) char *unlink_dir = NULL;
|
||||||
|
#endif
|
||||||
_cleanup_strv_free_ char **config_dirs = NULL;
|
_cleanup_strv_free_ char **config_dirs = NULL;
|
||||||
bool invalid_config = false;
|
bool invalid_config = false;
|
||||||
ItemArray *a;
|
ItemArray *a;
|
||||||
|
@ -3393,6 +3399,7 @@ static int run(int argc, char *argv[]) {
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
#ifndef STANDALONE
|
||||||
if (arg_image) {
|
if (arg_image) {
|
||||||
assert(!arg_root);
|
assert(!arg_root);
|
||||||
|
|
||||||
|
@ -3409,6 +3416,9 @@ static int run(int argc, char *argv[]) {
|
||||||
if (!arg_root)
|
if (!arg_root)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
assert(!arg_image);
|
||||||
|
#endif
|
||||||
|
|
||||||
items = ordered_hashmap_new(&item_array_hash_ops);
|
items = ordered_hashmap_new(&item_array_hash_ops);
|
||||||
globs = ordered_hashmap_new(&item_array_hash_ops);
|
globs = ordered_hashmap_new(&item_array_hash_ops);
|
||||||
|
|
Loading…
Reference in New Issue