-
Notifications
You must be signed in to change notification settings - Fork 307
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
status: Introduce tool to quickly check if we are booted as default #3134
Conversation
debcd8d
to
6b50dfb
Compare
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.
Overall LGTM, one bug and some nits. Thanks for this!
Generally in ostree based systems you would expect to boot into deployment 0, in rollback conditions triggered by greenboot-related rollbacks this might not be the case. This is a tool to detect this. Signed-off-by: Eric Curtin <[email protected]>
6b50dfb
to
1f1a405
Compare
Document the various CLI options. Signed-off-by: Eric Curtin <[email protected]>
It was a copy-paste of another description, rather than it's own. Signed-off-by: Eric Curtin <[email protected]>
1f1a405
to
46bae54
Compare
This one is ready for re-review @cgwalters I believe everything is addressed |
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 think an integration test for the default case would be easy to add, but we can also do that after. Thanks for the work here!
</varlistentry> | ||
|
||
<varlistentry> | ||
<term><option>--version</option>--version</term> |
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.
Is the syntax correct here?
NULL }, | ||
{ "skip-signatures", 'S', 0, G_OPTION_ARG_NONE, &opt_skip_signatures, "Skip signatures in output", | ||
NULL }, | ||
{ "query-booted", 'Q', 0, G_OPTION_ARG_NONE, &opt_query_booted, |
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 is pure bikeshed, but I think this would be better named e.g. --is-default
. Somewhat precedence are the systemctl is-*
commands that also print strings. --query-booted
is a bit ambiguous.
"Output the string \"default\" if the default deployment is the booted one, \"not-default\" if " | ||
"we are booted in a non-default deployment (e.g. the user interactively chose a different " | ||
"entry in the bootloader menu, or the bootloader rolled back automatically, etc.). If we are " | ||
"not in a booted OSTree system, an error is returned.", |
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.
Minor: this is duplicating the manpage. These docstrings are usually more brief. Maybe e.g.
Output "default" if booted into the default deployment, otherwise "not-default"
?
Generally in ostree based systems you would expect to boot into deployment 0, in rollback conditions triggered by greenboot-related rollbacks this might not be the case. This is a tool to detect this.