From: Colin Walters Date: Thu, 17 Aug 2023 20:48:05 +0000 (-0400) Subject: admin-deploy: Add `--stateroot` as alias for `--os` X-Git-Tag: archive/raspbian/2023.7-3+rpi1~1^2~9^2^2~15^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f4e56b910ffe33389f2671d7ce9a3ced07bf61a1;p=ostree.git admin-deploy: Add `--stateroot` as alias for `--os` To further help deprecate the confusing "osname" terminology. --- diff --git a/man/ostree-admin-deploy.xml b/man/ostree-admin-deploy.xml index 0d73b8e1..8915ad2c 100644 --- a/man/ostree-admin-deploy.xml +++ b/man/ostree-admin-deploy.xml @@ -65,11 +65,19 @@ License along with this library. If not, see . Options + + ="STATEROOT" + + + Use a different operating system stateroot than the current one. + + + ="STATEROOT" - Use a different operating system root than the current one. + Alias for --stateroot. diff --git a/src/ostree/ot-admin-builtin-deploy.c b/src/ostree/ot-admin-builtin-deploy.c index 00204ffd..bfeb81d9 100644 --- a/src/ostree/ot-admin-builtin-deploy.c +++ b/src/ostree/ot-admin-builtin-deploy.c @@ -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 }, diff --git a/tests/admin-test.sh b/tests/admin-test.sh index 9962e2ed..e362162c 100644 --- a/tests/admin-test.sh +++ b/tests/admin-test.sh @@ -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