Skip to content

setup-root: Tolerate pre-existing /run/systemd/volatile-root symlink#354

Merged
cgwalters merged 1 commit into
composefs:mainfrom
ricardosalveti:volatile-root-eexist
Jul 8, 2026
Merged

setup-root: Tolerate pre-existing /run/systemd/volatile-root symlink#354
cgwalters merged 1 commit into
composefs:mainfrom
ricardosalveti:volatile-root-eexist

Conversation

@ricardosalveti

Copy link
Copy Markdown
Contributor

ostree-prepare-root is growing the same gpt-auto workaround for composefs roots (creating the /run/systemd/volatile-root symlink so systemd's blockdev_get_root() can resolve the backing device, see systemd/systemd#35017), proposed in ostreedev/ostree#3608. When it runs before composefs-setup-root, the symlink already exists by the time gpt_workaround() runs and the unconditional symlink() call fails with EEXIST. The call site discards the error ("best effort"), but an already existing symlink means the desired end state is in place, so treat it as success rather than an error.

This matches the equivalent change to bootc's vendored copy of this code in bootc-dev/bootc#2276.

ostree-prepare-root is growing the same gpt-auto workaround for
composefs roots (creating the /run/systemd/volatile-root symlink so
systemd's blockdev_get_root() can resolve the backing device, see
systemd/systemd#35017), proposed in
ostreedev/ostree#3608. When it runs before
composefs-setup-root, the symlink already exists by the time
gpt_workaround() runs and the unconditional symlink() call fails with
EEXIST. The call site discards the error ("best effort"), but an
already existing symlink means the desired end state is in place, so
treat it as success rather than an error.

This matches the equivalent change to bootc's vendored copy of this
code in bootc-dev/bootc#2276.

Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
@Johan-Liebert1 Johan-Liebert1 enabled auto-merge July 8, 2026 04:01
@cgwalters cgwalters disabled auto-merge July 8, 2026 14:09
@cgwalters cgwalters closed this Jul 8, 2026
@cgwalters cgwalters reopened this Jul 8, 2026
@cgwalters cgwalters enabled auto-merge July 8, 2026 14:10
@cgwalters cgwalters added this pull request to the merge queue Jul 8, 2026
Merged via the queue into composefs:main with commit b54d72e Jul 8, 2026
60 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants