summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extra/usb_updater/gsctool.c8
-rw-r--r--extra/usb_updater/gsctool.h6
2 files changed, 12 insertions, 2 deletions
diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c
index 6db8f7cb10..4540814e56 100644
--- a/extra/usb_updater/gsctool.c
+++ b/extra/usb_updater/gsctool.c
@@ -296,6 +296,8 @@ static const struct option_container cmd_line_options[] = {
"Set or clear CCD password. Use 'clear:<cur password>' to clear it"},
{{"post_reset", no_argument, NULL, 'p'},
"Request post reset after transfer"},
+ {{"force_ro", no_argument, NULL, 'q'},
+ "Force inactive RO update"},
{{"sn_rma_inc", required_argument, NULL, 'R'},
"RMA_INC%Increment SN RMA count by RMA_INC. RMA_INC should be 0-7."},
{{"rma_auth", optional_argument, NULL, 'r'},
@@ -1013,7 +1015,8 @@ static void pick_sections(struct transfer_descriptor *td)
* Is it newer in the new image than the running RO section on
* the device?
*/
- if (a_newer_than_b(&sections[i].shv, &targ.shv[0]))
+ if (a_newer_than_b(&sections[i].shv, &targ.shv[0]) ||
+ td->force_ro)
sections[i].ustatus = needed;
}
}
@@ -2761,6 +2764,9 @@ int main(int argc, char *argv[])
case 'O':
openbox_desc_file = optarg;
break;
+ case 'q':
+ td.force_ro = 1;
+ break;
case 'r':
rma = 1;
rma_auth_code = optarg;
diff --git a/extra/usb_updater/gsctool.h b/extra/usb_updater/gsctool.h
index d58c3ba71f..0be6faeb1c 100644
--- a/extra/usb_updater/gsctool.h
+++ b/extra/usb_updater/gsctool.h
@@ -32,7 +32,11 @@ struct transfer_descriptor {
* the cr50 versioning scheme.
*/
int background_update_supported;
-
+ /*
+ * Unconditionally update the inactive RO, helps to make sure both RO
+ * sections are at the same level.
+ */
+ int force_ro;
/*
* offsets of RO and WR sections available for update (not currently
* active).