Skip to content

Conversation

champtar
Copy link
Collaborator

@champtar champtar commented Oct 8, 2025

Ignition stopped using it in 2019 (coreos/ignition@852008f), and it has been broken for 2 years (64afbcd) (mkdirat(/run/ostree) fails if /run/ostree already exists)

@champtar champtar requested a review from cgwalters October 8, 2025 00:35
@github-actions github-actions bot added the area/prepare-root Issue relates to ostree-prepare-root label Oct 8, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes obsolete support for /run/ostree/initramfs-mount-var. This feature was used to force mounting /var from ostree-prepare-root in the initramfs, even when systemd is expected to handle it. As noted in the description, this has been unused by Ignition for a long time and has been broken. The changes are straightforward and correct, improving maintainability by removing dead code. I have one minor suggestion to improve a comment's clarity.

if (lstat (INITRAMFS_MOUNT_VAR, &stbuf) == 0)
mount_var = true;
#ifndef HAVE_SYSTEMD_AND_LIBMOUNT
/* When running under systemd, /var will be handled by a 'var.mount' unit outside of initramfs.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The first line of this comment is a bit confusing as it describes the systemd case, but this code block is executed when HAVE_SYSTEMD_AND_LIBMOUNT is not defined. To improve clarity, consider rephrasing this line to describe the case this code block handles.

  /* When not using systemd to mount /var, we do it here from the initramfs.

Ignition stopped using it in 2019 (coreos/ignition@852008f),
and it has been broken for 2 years (ostreedev@64afbcd)
(mkdirat(/run/ostree) fails if /run/ostree already exists)
@champtar champtar force-pushed the rm-initramfs-mount-var branch from f531a82 to 53c4df6 Compare October 8, 2025 13:00
@champtar
Copy link
Collaborator Author

champtar commented Oct 8, 2025

@cgwalters CI is green now for this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/prepare-root Issue relates to ostree-prepare-root

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant