Skip to content

Commit 627b4f8

Browse files
committed
prepare-root: Tidy code for root_upperdir and root_workdir
1 parent 01de3ea commit 627b4f8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/switchroot/ostree-prepare-root.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -444,16 +444,16 @@ main (int argc, char *argv[])
444444

445445
g_autofree char *expected_digest = NULL;
446446

447-
// For now we just stick the transient root on the default /run tmpfs;
448-
// however, see
449-
// https://github.com/systemd/systemd/blob/604b2001081adcbd64ee1fbe7de7a6d77c5209fe/src/basic/mountpoint-util.h#L36
450-
// which bumps up these defaults for the rootfs a bit.
451-
const char *root_upperdir = OTCORE_RUN_OSTREE_PRIVATE "/root/upper";
452-
const char *root_workdir = OTCORE_RUN_OSTREE_PRIVATE "/root/work";
453-
454447
// Propagate these options for transient root, if provided
455448
if (root_transient)
456449
{
450+
// For now we just stick the transient root on the default /run tmpfs;
451+
// however, see
452+
// https://github.com/systemd/systemd/blob/604b2001081adcbd64ee1fbe7de7a6d77c5209fe/src/basic/mountpoint-util.h#L36
453+
// which bumps up these defaults for the rootfs a bit.
454+
const char *root_upperdir = OTCORE_RUN_OSTREE_PRIVATE "/root/upper";
455+
const char *root_workdir = OTCORE_RUN_OSTREE_PRIVATE "/root/work";
456+
457457
if (!glnx_shutil_mkdir_p_at (AT_FDCWD, root_upperdir, 0755, NULL, &error))
458458
errx (EXIT_FAILURE, "Failed to create %s: %s", root_upperdir, error->message);
459459
if (!glnx_shutil_mkdir_p_at (AT_FDCWD, root_workdir, 0700, NULL, &error))

0 commit comments

Comments
 (0)