8000 feat: warn user on login if mount points are incorrect by Roshan-R · Pull Request #3514 · coreos/fedora-coreos-config · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: warn user on login if mount points are incorrect #3514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: testing-devel
Choose a base branch
from

Conversation

Roshan-R
Copy link

Copy link
Member
@jbtrystram jbtrystram left a comment

Choose a reason for hiding this comment

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

I made a couple of suggestion, but the overall approach LGTM
Make sure to update the overlay README as well

. /usr/lib/console-login-helper-messages/libutil.sh
. /usr/lib/console-login-helper-messages/issue.defs

OUTDIR="${RUN_SNIPPETS}"
Copy link
Member

Choose a reason for hiding this comment

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

This variable is not set.

OUTDIR=/run/motd.d/

Copy link
Author

Choose a reason for hiding this comment

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

the OUTDIR is populated with the RUN_SNIPPETS that is sourced from the /usr/lib/console-login-helper-messages/issue.defs file having this logic inside it

private_issue_snippets_path="/run/${PKG_NAME}/issue.d"
# Since util-linux 2.35, `agetty` has been able to display files
# from additional locations like `/run/issue` and `/run/issue.d`
# if `/etc/issue` does not exist.
# We are currently dropping issue snippets in `/etc/issue.d` (instead
# of `/run/issue.d`) because of a systemd tmpfile that makes removal of
#  `/etc/issue` virtually impossible.
# https://github.com/systemd/systemd/commit/062666c7c452711f3e38efdec0c2b952ced64d06
# In the future, we would ideally drop into `/run/issue.d`; this would
# require either users configure the `--issue-file` option in `agetty`,
# or not use `/etc/issue`.
public_issue_snippets_path="/etc/issue.d"
if [ "${USE_PUBLIC_RUN_DIR}" == "false" ]; then
    RUN_SNIPPETS="${private_issue_snippets_path}"
else
    RUN_SNIPPETS="${public_issue_snippets_path}"
fi

It's important that / and /sysroot are mounted read-only and that the root filesystem uses ComposeFS to maintain system immutability.
This change adds a warning to notify users if any of these conditions are not met.
fi

# Check if / is mounted read-only
root_options=$(findmnt / --json | jq -r '.filesystems[].options')
Copy link
Member

Choose a reason for hiding this comment

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

use the same jq as above, or better yet, save the output for the whole root object then reuse that

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.

Warn if /sysroot is not read only or if the root mountpoint is not a composefs mount
2 participants
0