diff --git a/src/ostree/ot-admin-builtin-status.c b/src/ostree/ot-admin-builtin-status.c index bf94843f26..fa3376d760 100644 --- a/src/ostree/ot-admin-builtin-status.c +++ b/src/ostree/ot-admin-builtin-status.c @@ -30,12 +30,15 @@ static gboolean opt_verify; static gboolean opt_skip_signatures; +static gboolean opt_query_booted; static GOptionEntry options[] = { { "verify", 'V', 0, G_OPTION_ARG_NONE, &opt_verify, "Print the commit verification status", NULL }, { "skip-signatures", 'S', 0, G_OPTION_ARG_NONE, &opt_skip_signatures, "Print the commit verification status", NULL }, + { "query-booted", 'Q', 0, G_OPTION_ARG_NONE, &opt_query_booted, + "Print whether the default deployment is booted or not", NULL }, { NULL } }; static gboolean deployment_print_status (OstreeSysroot *sysroot, OstreeRepo *repo, OstreeDeployment *deployment, @@ -204,6 +207,11 @@ ot_admin_builtin_status (int argc, char **argv, OstreeCommandInvocation *invocat { g_print ("No deployments.\n"); } + else if (opt_query_booted) + { + const gboolean is_default_booted = deployments->pdata[0] == booted_deployment; + g_print ("%s\n", is_default_booted ? "default" : "not-default"); + } else { for (guint i = 0; i < deployments->len; i++)