aboutsummaryrefslogtreecommitdiffstats
path: root/roots.c
diff options
context:
space:
mode:
authorShashank Mittal <mittals@codeaurora.org>2010-07-27 11:09:19 -0700
committerKoushik Dutta <koushd@gmail.com>2010-10-12 18:46:30 -0700
commit815ca5d230e2416370ab9645c0da9e4a0905000d (patch)
tree0e71beb26946af967498eabe8e26059acf27eb35 /roots.c
parent0209a62c7dffcde7db6c2a57a22eb2c00f76bc62 (diff)
downloadandroid_bootable_recovery-815ca5d230e2416370ab9645c0da9e4a0905000d.tar.gz
android_bootable_recovery-815ca5d230e2416370ab9645c0da9e4a0905000d.tar.bz2
android_bootable_recovery-815ca5d230e2416370ab9645c0da9e4a0905000d.zip
[recovery]: Add support for OTA upgrade on mmc devices.
Change-Id: I8f230dfa5be4e9f142765797d949e10434e1fdeb
Diffstat (limited to 'roots.c')
-rw-r--r--roots.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/roots.c b/roots.c
index 474ea1df..c7bd16d1 100644
--- a/roots.c
+++ b/roots.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2007 The Android Open Source Project
+ * Copyright (c) 2010, Code Aurora Forum. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +26,7 @@
#include "mtdutils/mtdutils.h"
#include "mtdutils/mounts.h"
+#include "mmcutils/mmcutils.h"
#include "minzip/Zip.h"
#include "roots.h"
#include "common.h"
@@ -35,6 +37,7 @@
xxx may just want to use enums
*/
static const char g_mtd_device[] = "@\0g_mtd_device";
+static const char g_mmc_device[] = "@\0g_mmc_device";
static const char g_raw[] = "@\0g_raw";
static const char g_package_file[] = "@\0g_package_file";
@@ -383,6 +386,22 @@ format_root_device(const char *root)
}
}
}
-
+
+ //Handle MMC device types
+ if(info->device == g_mmc_device) {
+ mmc_scan_partitions();
+ const MmcPartition *partition;
+ partition = mmc_find_partition_by_name(info->partition_name);
+ if (partition == NULL) {
+ LOGE("format_root_device: can't find mmc partition \"%s\"\n",
+ info->partition_name);
+ return -1;
+ }
+ if (!strcmp(info->filesystem, "ext3")) {
+ if(mmc_format_ext3(partition))
+ LOGE("\n\"%s\" wipe failed!\n", info->partition_name);
+ }
+ }
+
return format_non_mtd_device(root);
}