aboutsummaryrefslogtreecommitdiffstats
path: root/applypatch/applypatch_main.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-07-13 13:11:09 -0700
committerTao Bao <tbao@google.com>2018-07-20 11:26:17 -0700
commitd34e6bc44b0e58a3261cd7070a1525099932f205 (patch)
treeff7098efd4f91f323189d3a0fdf248df724bcfc1 /applypatch/applypatch_main.cpp
parent29932e7bcc2865494e4cf03248381475687d227b (diff)
downloadandroid_bootable_recovery-d34e6bc44b0e58a3261cd7070a1525099932f205.tar.gz
android_bootable_recovery-d34e6bc44b0e58a3261cd7070a1525099932f205.tar.bz2
android_bootable_recovery-d34e6bc44b0e58a3261cd7070a1525099932f205.zip
applypatch: Change applypatch command-line arguments.
This applies to the standalone applypatch executable (/system/bin/applypatch on device). This executable is only used when installing (via patching or flashing) a recovery image on non-A/B device. This CL removes the support for patching non-eMMC targets from applypatch that has been deprecated as part of file-based OTA. For patching eMMC targets, it also drops the support for accepting multiple patches (not useful, since the source file must be fixed). This CL needs the matching change in the same topic, which writes the script of "/system/bin/install-recovery.sh". Note that this CL doesn't chanage the applypatch API signatures, in order to minimize the CL size. *BEFORE* usage: /system/bin/applypatch [-b <bonus-file>] <src-file> <tgt-file> <tgt-sha1> <tgt-size> [<src-sha1>:<patch> ...] or /system/bin/applypatch -c <file> [<sha1> ...] or /system/bin/applypatch -l Filenames may be of the form EMMC:<partition>:<len_1>:<sha1_1>:<len_2>:<sha1_2>:... to specify reading from or writing to an EMMC partition. *AFTER* Usage: check mode applypatch --check EMMC:<target-file>:<target-size>:<target-sha1> flash mode applypatch --flash <source-file> --target EMMC:<target-file>:<target-size>:<target-sha1> patch mode applypatch [--bonus <bonus-file>] --patch <patch-file> --target EMMC:<target-file>:<target-size>:<target-sha1> --source EMMC:<source-file>:<source-size>:<source-sha1> show license applypatch --license Bug: 110106408 Test: Run recovery_component_test and recovery_unit_test on marlin. Test: Build a non-A/B target that has /system/bin/install-recovery.sh. Verify that it installs recovery image successfully. Test: Build a non-A/B target that has /system/bin/install-recovery.sh in flashing mode. Verify that it installs recovery image successfully. Change-Id: I71f9a71fb457e6f663e0b5511946949e65b4b78c
Diffstat (limited to 'applypatch/applypatch_main.cpp')
-rw-r--r--applypatch/applypatch_main.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/applypatch/applypatch_main.cpp b/applypatch/applypatch_main.cpp
index 197077c9..4fa73d3c 100644
--- a/applypatch/applypatch_main.cpp
+++ b/applypatch/applypatch_main.cpp
@@ -16,13 +16,7 @@
#include "applypatch_modes.h"
-// This program (applypatch) applies binary patches to files in a way that
-// is safe (the original file is not touched until we have the desired
-// replacement for it) and idempotent (it's okay to run this program
-// multiple times).
-//
-// See the comments to applypatch_modes() function.
-
+// See the comments for applypatch() function.
int main(int argc, char** argv) {
- return applypatch_modes(argc, const_cast<const char**>(argv));
+ return applypatch_modes(argc, argv);
}