osu: Print available board param with --help option 09/317709/1
authorUnsung Lee <unsung.lee@samsung.com>
Thu, 19 Dec 2024 02:51:22 +0000 (11:51 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Tue, 7 Jan 2025 02:40:01 +0000 (11:40 +0900)
Print available board parameters when the user requests osu --help.

The result of osu --help:
Usage:
    osu [--help|--resize|--update]

Possible arguments:
  --help                                       Print this help
  --update                                     Trigger the OS Upgrade (Offline Upgrade)
  --offline-update                             Trigger the OS Offline Upgrade
  --online-update                              Trigger the OS Online Upgrade
  --resize                                     Run resize2fs on the rootfs partition.
                                               After that, performing the OS Upgrade will be impossible.
  --get-board-param <param name>[,<param>...]  Print value of a board param
                                               Use <param name> as 'help' for details.
  --set-board-param <param name>[,<param>...]  Set value of a board param
                                               Use <param name> as 'help' for details.

Available getter board params:
    boot-mode: Get boot mode.
    current-partition: Get current partition (a or b)
    partition-ab-cloned: Get partition is cloned or not: 1 is cloned, 0 is not cloned.
    partition-status: Get partition status. 1 param is required: 'a' or 'b'.
    upgrade-progress-status: Get current upgrade progress status: -1 ~ 100
    upgrade-state: Get current upgrade state.
    upgrade-type: Get current upgrade type: offline or online

 * Parameters should be provided separated with ','.
 * e.g. "partition-status,a"

Available setter board params:
    partition-ab: Switch partition between a/b. 1 param is required: <a, b or toggle>
    partition-ab-cloned: Set cloned flag 0 or 1. 1 param is required: <0 or 1>
    partition-status: Set partition status. 2 params are required: <a, b>,<ok, failed or corrupted>
    upgrade-progress-status: Set upgrade progress status. 1 integer is requied: <-1 ~ 100>
    upgrade-state: Set upgrade state. 2 params are required.
    upgrade-type: Set upgrade type. 1 param is required: <online or offline>

 * Parameters should be provided separated with ','.
 * e.g. "upgrade_progress_status,100"

Change-Id: Idf6df267c5955d38f525e6aaa6cea089b3f1a90d
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
tools/osu/osu.c

index 78c7b64d01d716ddb6d8b6fffe564b3a6a25aca2..f9945af1346c688cfc3be9efcb4968ff6a130e6b 100644 (file)
@@ -228,7 +228,10 @@ int main(int argc, char **argv)
 
        if (args.help) {
                print_help(argv[0]);
-               return 0;
+
+               args.get_board_param = true;
+               args.set_board_param = true;
+               return print_argument(&args);
        }
 
        if (args.resize)