aboutsummaryrefslogtreecommitdiffstats
path: root/updater
diff options
context:
space:
mode:
Diffstat (limited to 'updater')
-rw-r--r--updater/Android.mk3
-rw-r--r--updater/install.c11
2 files changed, 14 insertions, 0 deletions
diff --git a/updater/Android.mk b/updater/Android.mk
index 9f9da06..1ea1fb7 100644
--- a/updater/Android.mk
+++ b/updater/Android.mk
@@ -28,6 +28,9 @@ LOCAL_STATIC_LIBRARIES += \
libsparse_static \
libz
+LOCAL_C_INCLUDES += external/e2fsprogs/lib
+LOCAL_STATIC_LIBRARIES += libext2_blkid libext2_uuid
+
ifneq ($(BOARD_RECOVERY_BLDRMSG_OFFSET),)
LOCAL_CFLAGS += -DBOARD_RECOVERY_BLDRMSG_OFFSET=$(BOARD_RECOVERY_BLDRMSG_OFFSET)
endif
diff --git a/updater/install.c b/updater/install.c
index 8d569ff..43d5cfb 100644
--- a/updater/install.c
+++ b/updater/install.c
@@ -33,6 +33,7 @@
#include <sys/xattr.h>
#include <linux/xattr.h>
#include <inttypes.h>
+#include <blkid/blkid.h>
#include "bootloader.h"
#include "applypatch/applypatch.h"
@@ -167,6 +168,16 @@ Value* MountFn(const char* name, State* state, int argc, Expr* argv[]) {
}
result = mount_point;
} else {
+ char *detected_fs_type = blkid_get_tag_value(NULL, "TYPE", location);
+ if (detected_fs_type) {
+ uiPrintf(state, "detected filesystem %s for %s\n",
+ detected_fs_type, location);
+ fs_type = detected_fs_type;
+ } else {
+ uiPrintf(state, "could not detect filesystem for %s, assuming %s\n",
+ location, fs_type);
+ }
+
if (mount(location, mount_point, fs_type,
MS_NOATIME | MS_NODEV | MS_NODIRATIME,
has_mount_options ? mount_options : "") < 0) {