From bac7fba02763ae5e78e8e4ba0bea727330ad953e Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Wed, 10 Apr 2013 11:32:17 -0700 Subject: verifier: update to support certificates using SHA-256 Change-Id: Ifd5a29d459acf101311fa1c220f728c3d0ac2e4e --- install.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'install.cpp') diff --git a/install.cpp b/install.cpp index 0f3298f1d..0cb5cc7df 100644 --- a/install.cpp +++ b/install.cpp @@ -190,7 +190,7 @@ really_install_package(const char *path, int* wipe_cache) ui->Print("Opening update package...\n"); int numKeys; - RSAPublicKey* loadedKeys = load_keys(PUBLIC_KEYS_FILE, &numKeys); + Certificate* loadedKeys = load_keys(PUBLIC_KEYS_FILE, &numKeys); if (loadedKeys == NULL) { LOGE("Failed to load keys\n"); return INSTALL_CORRUPT; -- cgit v1.2.3 From fafc85b4ad7a5679c6b562bed64460732e05fd1e Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 9 Jul 2013 12:29:45 -0700 Subject: recovery: move log output to stdout Recovery currently has a random mix of messages printed to stdout and messages printed to stderr, which can make logs hard to read. Move everything to stdout. Change-Id: Ie33bd4a9e1272e731302569cdec918e0534c48a6 --- install.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'install.cpp') diff --git a/install.cpp b/install.cpp index 0cb5cc7df..e1ab848f6 100644 --- a/install.cpp +++ b/install.cpp @@ -154,6 +154,7 @@ try_update_binary(const char *path, ZipArchive *zip, int* wipe_cache) { } else { ui->Print("\n"); } + fflush(stdout); } else if (strcmp(command, "wipe_cache") == 0) { *wipe_cache = 1; } else if (strcmp(command, "clear_display") == 0) { -- cgit v1.2.3 From 239ac6abac4524be93fce710360c0512c6cc2ab3 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 20 Aug 2013 16:03:25 -0700 Subject: recovery: install packages in a known mount environment When installing a package, we should have /tmp and /cache mounted and nothing else. Ensure this is true by explicitly mounting them and unmounting everything else as the first step of every install. Also fix an error in the progress bar that crops up when you do multiple package installs in one instance of recovery. Change-Id: I4837ed707cb419ddd3d9f6188b6355ba1bcfe2b2 --- install.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'install.cpp') diff --git a/install.cpp b/install.cpp index e1ab848f6..797a525fd 100644 --- a/install.cpp +++ b/install.cpp @@ -180,7 +180,9 @@ really_install_package(const char *path, int* wipe_cache) { ui->SetBackground(RecoveryUI::INSTALLING_UPDATE); ui->Print("Finding update package...\n"); - ui->SetProgressType(RecoveryUI::INDETERMINATE); + // Give verification half the progress bar... + ui->SetProgressType(RecoveryUI::DETERMINATE); + ui->ShowProgress(VERIFICATION_PROGRESS_FRACTION, VERIFICATION_PROGRESS_TIME); LOGI("Update location: %s\n", path); if (ensure_path_mounted(path) != 0) { @@ -198,10 +200,7 @@ really_install_package(const char *path, int* wipe_cache) } LOGI("%d key(s) loaded from %s\n", numKeys, PUBLIC_KEYS_FILE); - // Give verification half the progress bar... ui->Print("Verifying update package...\n"); - ui->SetProgressType(RecoveryUI::DETERMINATE); - ui->ShowProgress(VERIFICATION_PROGRESS_FRACTION, VERIFICATION_PROGRESS_TIME); int err; err = verify_file(path, loadedKeys, numKeys); @@ -237,7 +236,13 @@ install_package(const char* path, int* wipe_cache, const char* install_file) } else { LOGE("failed to open last_install: %s\n", strerror(errno)); } - int result = really_install_package(path, wipe_cache); + int result; + if (setup_install_mounts() != 0) { + LOGE("failed to set up expected mounts for install; aborting\n"); + result = INSTALL_ERROR; + } else { + result = really_install_package(path, wipe_cache); + } if (install_log) { fputc(result == INSTALL_SUCCESS ? '1' : '0', install_log); fputc('\n', install_log); -- cgit v1.2.3