summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2010-09-18 01:07:14 +0200
committerDoug Zongker <dougz@android.com>2010-09-18 01:07:14 +0200
commitc9ebb58623430b73e8f5a30c5ac34b770f29359a (patch)
treeab2d48836f85f0211670192376b17ddfb920bf0f
parentam 1dcd2fd0: (-s ours) am 792b0071: do not merge - update to match ext4utils api (diff)
parentam d7d42089: remove unneeded partition roots (diff)
downloadandroid_bootable_recovery-c9ebb58623430b73e8f5a30c5ac34b770f29359a.tar
android_bootable_recovery-c9ebb58623430b73e8f5a30c5ac34b770f29359a.tar.gz
android_bootable_recovery-c9ebb58623430b73e8f5a30c5ac34b770f29359a.tar.bz2
android_bootable_recovery-c9ebb58623430b73e8f5a30c5ac34b770f29359a.tar.lz
android_bootable_recovery-c9ebb58623430b73e8f5a30c5ac34b770f29359a.tar.xz
android_bootable_recovery-c9ebb58623430b73e8f5a30c5ac34b770f29359a.tar.zst
android_bootable_recovery-c9ebb58623430b73e8f5a30c5ac34b770f29359a.zip
-rw-r--r--install.c15
-rw-r--r--roots.c56
-rw-r--r--roots.h14
3 files changed, 3 insertions, 82 deletions
diff --git a/install.c b/install.c
index 2619a0cc0..a56dbd048 100644
--- a/install.c
+++ b/install.c
@@ -159,17 +159,6 @@ try_update_binary(const char *path, ZipArchive *zip) {
return INSTALL_SUCCESS;
}
-static int
-handle_update_package(const char *path, ZipArchive *zip)
-{
- // Update should take the rest of the progress bar.
- ui_print("Installing update...\n");
-
- int result = try_update_binary(path, zip);
- register_package_root(NULL, NULL); // Unregister package root
- return result;
-}
-
// Reads a file containing one or more public keys as produced by
// DumpPublicKey: this is an RSAPublicKey struct as it would appear
// as a C source literal, eg:
@@ -300,6 +289,6 @@ install_package(const char *root_path)
/* Verify and install the contents of the package.
*/
- int status = handle_update_package(path, &zip);
- return status;
+ ui_print("Installing update...\n");
+ return try_update_binary(path, &zip);
}
diff --git a/roots.c b/roots.c
index 5369d2ff2..9691ad365 100644
--- a/roots.c
+++ b/roots.c
@@ -50,11 +50,7 @@ static const char g_package_file[] = "@\0g_package_file";
static const char g_ramdisk[] = "@\0g_ramdisk";
static RootInfo g_roots[] = {
- { "BOOT:", g_mtd_device, NULL, "boot", NULL, g_raw },
- { "PACKAGE:", NULL, NULL, NULL, NULL, g_package_file },
- { "RECOVERY:", g_mtd_device, NULL, "recovery", "/", g_raw },
- { "SYSTEM:", g_mtd_device, NULL, "system", "/system", "yaffs2" },
- { "MBM:", g_mtd_device, NULL, "mbm", NULL, g_raw },
+ { "SDCARD:", "/dev/block/mmcblk0p1", "/dev/block/mmcblk0", NULL, "/sdcard", "vfat" },
{ "TMP:", NULL, NULL, NULL, "/tmp", g_ramdisk },
#ifdef USE_EXT4
@@ -98,56 +94,6 @@ get_root_info_for_path(const char *root_path)
return NULL;
}
-static const ZipArchive *g_package = NULL;
-static char *g_package_path = NULL;
-
-int
-register_package_root(const ZipArchive *package, const char *package_path)
-{
- if (package != NULL) {
- package_path = strdup(package_path);
- if (package_path == NULL) {
- return -1;
- }
- g_package_path = (char *)package_path;
- } else {
- free(g_package_path);
- g_package_path = NULL;
- }
- g_package = package;
- return 0;
-}
-
-int
-is_package_root_path(const char *root_path)
-{
- const RootInfo *info = get_root_info_for_path(root_path);
- return info != NULL && info->filesystem == g_package_file;
-}
-
-const char *
-translate_package_root_path(const char *root_path,
- char *out_buf, size_t out_buf_len, const ZipArchive **out_package)
-{
- const RootInfo *info = get_root_info_for_path(root_path);
- if (info == NULL || info->filesystem != g_package_file) {
- return NULL;
- }
-
- /* Strip the package root off of the path.
- */
- size_t root_len = strlen(info->name);
- root_path += root_len;
- size_t root_path_len = strlen(root_path);
-
- if (out_buf_len < root_path_len + 1) {
- return NULL;
- }
- strcpy(out_buf, root_path);
- *out_package = g_package;
- return out_buf;
-}
-
/* Takes a string like "SYSTEM:lib" and turns it into a string
* like "/system/lib". The translated path is put in out_buf,
* and out_buf is returned if the translation succeeded.
diff --git a/roots.h b/roots.h
index bc847ea67..e85191d99 100644
--- a/roots.h
+++ b/roots.h
@@ -24,14 +24,6 @@
* components, like "SYSTEM:a/b/c".
*/
-/* Associate this package with the package root "PKG:".
- */
-int register_package_root(const ZipArchive *package, const char *package_path);
-
-/* Returns non-zero iff root_path points inside a package.
- */
-int is_package_root_path(const char *root_path);
-
/* Takes a string like "SYSTEM:lib" and turns it into a string
* like "/system/lib". The translated path is put in out_buf,
* and out_buf is returned if the translation succeeded.
@@ -39,12 +31,6 @@ int is_package_root_path(const char *root_path);
const char *translate_root_path(const char *root_path,
char *out_buf, size_t out_buf_len);
-/* Takes a string like "PKG:lib/libc.so" and returns a pointer to
- * the containing zip file and a path like "lib/libc.so".
- */
-const char *translate_package_root_path(const char *root_path,
- char *out_buf, size_t out_buf_len, const ZipArchive **out_package);
-
/* Returns negative on error, positive if it's mounted, zero if it isn't.
*/
int is_root_path_mounted(const char *root_path);