From c1a754cfe2f64661aec278016250c35f60630ed3 Mon Sep 17 00:00:00 2001 From: Kelvin Cao Date: Tue, 5 Sep 2023 06:44:16 -0700 Subject: [PATCH] show only --- cli/mfg.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cli/mfg.c b/cli/mfg.c index 314f54d8..5dc0a299 100644 --- a/cli/mfg.c +++ b/cli/mfg.c @@ -1057,6 +1057,7 @@ static int config_set(int argc, char **argv) char *setting_file; FILE *uds_fimg; char *uds_file; + int show_only; int assume_yes; } cfg = {}; const struct argconfig_options opts[] = { @@ -1069,6 +1070,8 @@ static int config_set(int argc, char **argv) .value_addr=&cfg.uds_fimg, .argument_type=required_argument, .help="UDS file"}, + {"show-settings-only", 's', "", CFG_NONE, &cfg.show_only, no_argument, + "Show secure settings without programming"}, {"yes", 'y', "", CFG_NONE, &cfg.assume_yes, no_argument, "assume yes when prompted"}, {NULL} @@ -1136,9 +1139,15 @@ static int config_set(int argc, char **argv) } } - printf("Writing the below settings to device: \n"); + if (cfg.show_only) + printf("Secure settings for device: \n"); + else + printf("Writing the below settings to device: \n"); print_security_cfg_set(&settings); + if (cfg.show_only) + return 0; + if (!cfg.assume_yes) fprintf(stderr, "\nWARNING: This operation makes changes to the device OTP memory and is IRREVERSIBLE!\n");