recovery: Autodetection of device flash type
Detect flash type at runtime rather than requiring this to be set in the
device configuration. The detection is based on the existence of /proc/mtd,
/proc/emmc, or /dev/block/bml1.
Change-Id: I464962a567022c5862c249f06d36c2d1cddeacba
diff --git a/updater/install.c b/updater/install.c
index c71781a..7b9aa80 100644
--- a/updater/install.c
+++ b/updater/install.c
@@ -33,17 +33,12 @@
#include "mincrypt/sha.h"
#include "minzip/DirUtil.h"
#include "mounts.h"
+#include "flashutils/flashutils.h"
#include "mtdutils/mtdutils.h"
#include "mmcutils/mmcutils.h"
#include "updater.h"
#include "applypatch/applypatch.h"
-#ifndef BOARD_USES_MMCUTILS
-#define DEFAULT_FILESYSTEM "yaffs2"
-#else
-#define DEFAULT_FILESYSTEM "ext3"
-#endif
-
// mount(type, location, mount_point)
//
// what: type="MTD" location="<partition>" to mount a yaffs2 filesystem
@@ -76,7 +71,7 @@
mkdir(mount_point, 0755);
if (strcmp(type, "MTD") == 0 || strcmp(type, "MMC") == 0) {
- if (0 == mount_partition(location, mount_point, DEFAULT_FILESYSTEM, 0))
+ if (0 == mount_partition(location, mount_point, get_default_filesystem(), 0))
result = mount_point;
else
result = strdup("");