admin-deploy: Add --stateroot as alias for --os

To further help deprecate the confusing "osname" terminology.
This commit is contained in:
Colin Walters 2023-08-17 16:48:05 -04:00
parent 9d5ccfefff
commit f4e56b910f
3 changed files with 12 additions and 2 deletions

View File

@ -65,11 +65,19 @@ License along with this library. If not, see <https://www.gnu.org/licenses/>.
<title>Options</title>
<variablelist>
<varlistentry>
<term><option>--stateroot</option>="STATEROOT"</term>
<listitem><para>
Use a different operating system stateroot than the current one.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--os</option>="STATEROOT"</term>
<listitem><para>
Use a different operating system root than the current one.
Alias for <literal>--stateroot</literal>.
</para></listitem>
</varlistentry>

View File

@ -51,6 +51,8 @@ static char **opt_overlay_initrds;
static GOptionEntry options[] = {
{ "os", 0, 0, G_OPTION_ARG_STRING, &opt_osname,
"Use a different operating system root than the current one", "OSNAME" },
{ "stateroot", 0, 0, G_OPTION_ARG_STRING, &opt_osname, "Target the provided stateroot",
"STATEROOT" },
{ "origin-file", 0, 0, G_OPTION_ARG_FILENAME, &opt_origin_path, "Specify origin file",
"FILENAME" },
{ "no-prune", 0, 0, G_OPTION_ARG_NONE, &opt_no_prune, "Don't prune the repo when done", NULL },

View File

@ -97,7 +97,7 @@ assert_file_has_content_literal err.txt "Cannot stage deployment: Not currently
echo "ok staging does not work when not booted"
orig_mtime=$(stat -c '%.Y' sysroot/ostree/deploy)
${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin deploy --stateroot=testos testos:testos/buildmain/x86_64-runtime
new_mtime=$(stat -c '%.Y' sysroot/ostree/deploy)
assert_not_streq "${orig_mtime}" "${new_mtime}"
# Need a new bootversion, sine we now have two deployments