fs_mgr: introduce fs_mgr_format to format wiped partitions
Move fastboot's format logic into fs_mgr, to consolidate the knowledge
about how to do this (and when to wipe metadata).
Try to format these formattable paritions if they are wiped.
If formatting fails, we will fall out to let recovery mode handle it.
Bug: 20082763
Change-Id: I397cc197550e78d932e8a154fd234695c46dbe7b
diff --git a/init/Android.mk b/init/Android.mk
index 489dc93..228e645 100644
--- a/init/Android.mk
+++ b/init/Android.mk
@@ -45,7 +45,9 @@
libc \
libselinux \
libmincrypt \
- libext4_utils_static
+ libext4_utils_static \
+ libsparse_static \
+ libz
LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
diff --git a/init/devices.c b/init/devices.c
index 1012fee..73fe223 100644
--- a/init/devices.c
+++ b/init/devices.c
@@ -564,7 +564,7 @@
make_device(devpath, path, block, major, minor, (const char **)links);
if (links) {
for (i = 0; links[i]; i++)
- make_link(devpath, links[i]);
+ make_link_init(devpath, links[i]);
}
}
diff --git a/init/util.c b/init/util.c
index e1a3ee3..12cb11d 100644
--- a/init/util.c
+++ b/init/util.c
@@ -335,7 +335,7 @@
}
}
-void make_link(const char *oldpath, const char *newpath)
+void make_link_init(const char *oldpath, const char *newpath)
{
int ret;
char buf[256];
diff --git a/init/util.h b/init/util.h
index 04b8129..a7e7c8b 100644
--- a/init/util.h
+++ b/init/util.h
@@ -33,7 +33,7 @@
int mkdir_recursive(const char *pathname, mode_t mode);
void sanitize(char *p);
-void make_link(const char *oldpath, const char *newpath);
+void make_link_init(const char *oldpath, const char *newpath);
void remove_link(const char *oldpath, const char *newpath);
int wait_for_file(const char *filename, int timeout);
void open_devnull_stdio(void);