-
Notifications
You must be signed in to change notification settings - Fork 162
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
base: testing-devel
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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}" |
There was a problem hiding this comment.
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/
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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
Closes coreos/fedora-coreos-tracker#1954