Lines Matching refs:arg_directory
114 static char *arg_directory = NULL;
420 r = parse_path_argument_and_warn(optarg, false, &arg_directory);
905 if (arg_directory && arg_image) {
915 if (arg_template && !(arg_directory || arg_machine)) {
2206 r = mount_device(root_device, arg_directory, NULL, root_device_rw);
2212 r = mount_device(home_device, arg_directory, "/home", home_device_rw);
2218 r = mount_device(srv_device, arg_directory, "/srv", srv_device_rw);
2335 if (arg_template && !arg_directory && arg_machine) {
2341 arg_directory = strjoin("/var/lib/machines/", arg_machine, NULL);
2342 if (!arg_directory)
2346 if (!arg_image && !arg_directory) {
2361 r = free_and_strdup(&arg_directory, i->path);
2368 arg_directory = get_current_dir_name();
2370 if (!arg_directory && !arg_machine) {
2377 if (arg_directory && path_equal(arg_directory, "/"))
2380 arg_machine = strdup(basename(arg_image ?: arg_directory));
2913 } else if (arg_directory) {
2914 p = file_in_same_dir(arg_directory, fn);
3133 if (arg_directory) {
3136 if (path_equal(arg_directory, "/") && !arg_ephemeral) {
3151 r = path_is_mount_point(arg_directory, 0);
3153 log_error_errno(r, "Failed to determine whether directory %s is mount point: %m", arg_directory);
3157 r = tempfn_random_child(arg_directory, "machine.", &np);
3159 r = tempfn_random(arg_directory, "machine.", &np);
3171 r = btrfs_subvol_snapshot(arg_directory, np, (arg_read_only ? BTRFS_SNAPSHOT_READ_ONLY : 0) | BTRFS_SNAPSHOT_FALLBACK_COPY | BTRFS_SNAPSHOT_RECURSIVE | BTRFS_SNAPSHOT_QUOTA);
3173 log_error_errno(r, "Failed to create snapshot %s from %s: %m", np, arg_directory);
3177 free(arg_directory);
3178 arg_directory = np;
3184 r = image_path_lock(arg_directory, (arg_read_only ? LOCK_SH : LOCK_EX) | LOCK_NB, &tree_global_lock, &tree_local_lock);
3186 log_error_errno(r, "Directory tree %s is currently busy.", arg_directory);
3190 log_error_errno(r, "Failed to lock %s: %m", arg_directory);
3195 r = btrfs_subvol_snapshot(arg_template, arg_directory, (arg_read_only ? BTRFS_SNAPSHOT_READ_ONLY : 0) | BTRFS_SNAPSHOT_FALLBACK_COPY | BTRFS_SNAPSHOT_RECURSIVE | BTRFS_SNAPSHOT_QUOTA);
3198 log_info("Directory %s already exists, not populating from template %s.", arg_directory, arg_template);
3200 log_error_errno(r, "Couldn't create snapshot %s from %s: %m", arg_directory, arg_template);
3204 log_info("Populated %s from template %s.", arg_directory, arg_template);
3210 if (path_is_os_tree(arg_directory) <= 0) {
3211 log_error("Directory %s doesn't look like an OS root directory (os-release file is missing). Refusing.", arg_directory);
3218 p = strjoina(arg_directory, "/usr/");
3220 log_error("Directory %s doesn't look like it has an OS tree. Refusing.", arg_directory);
3248 arg_directory = strdup(template);
3249 if (!arg_directory) {
3296 arg_machine, arg_image ?: arg_directory);
3390 arg_directory,
3505 arg_directory,
3666 if (remove_subvol && arg_directory) {
3669 k = btrfs_subvol_remove(arg_directory, BTRFS_REMOVE_RECURSIVE|BTRFS_REMOVE_QUOTA);
3671 log_warning_errno(k, "Cannot remove subvolume '%s', ignoring: %m", arg_directory);
3683 free(arg_directory);