mmc-utils: Expand 'writeprotect boot'
This patch updates 'mmc writeprotect boot set' with a few more optional
parameters, so that it can be used to enable permanent write-protection
and so that the two boot partitions can be protected independently. It
also splits protection information output by 'mmc writeprotect boot get'
by partition.
BUG=b:151202634
TEST=Enabled different kinds of protection on my Trogdor.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I327fff23675b267a9f75d754ccc47db3f84c294c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/mmc-utils/+/2103512
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
diff --git a/mmc.c b/mmc.c
index fe3f479..85e0dbd 100644
--- a/mmc.c
+++ b/mmc.c
@@ -69,8 +69,12 @@
NULL
},
{ do_writeprotect_boot_set, -1,
- "writeprotect boot set", "<device>\n"
- "Set the boot partitions write protect status for <device>.\nThis sets the eMMC boot partitions to be write-protected until\nthe next boot.",
+ "writeprotect boot set", "[-p] " "<device> [<number>]\n"
+ "Set the boot partition write protect status for <device>.\n"
+ "If <number> is passed (0 or 1), only protect that particular\n"
+ "eMMC boot partition, otherwise protect both. It will be\n"
+ "write-protected until the next boot.\n"
+ " -p Protect partition permanently instead. WARNING: THIS IS IRREVERSIBLE!\n",
NULL
},
{ do_writeprotect_user_set, -4,