summaryrefslogtreecommitdiffstats
path: root/mtdutils
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2010-09-14 18:06:55 -0700
committerDoug Zongker <dougz@android.com>2010-09-14 21:26:38 -0700
commit8e5e4dada713609c9b2c45ea9cf4572bb89ef761 (patch)
treeb1dd9d0f6408811e71dade4f1ccbc52f18114a5e /mtdutils
parentd12560aa2134d3af21a1220cd4873553f9c51743 (diff)
downloadbootable_recovery-8e5e4dada713609c9b2c45ea9cf4572bb89ef761.zip
bootable_recovery-8e5e4dada713609c9b2c45ea9cf4572bb89ef761.tar.gz
bootable_recovery-8e5e4dada713609c9b2c45ea9cf4572bb89ef761.tar.bz2
close update package before installing; allow remount
Close the update package before invoking the binary, to allow the installer to unmount /cache if it wants to. Add a function to allow remounting of a mount as read-only. Change-Id: Idfcc96c3da66083295177f729263560be58034e4
Diffstat (limited to 'mtdutils')
-rw-r--r--mtdutils/mounts.c8
-rw-r--r--mtdutils/mounts.h2
-rw-r--r--mtdutils/mtdutils.c2
3 files changed, 11 insertions, 1 deletions
diff --git a/mtdutils/mounts.c b/mtdutils/mounts.c
index 2ab3ff6..c90fc8a 100644
--- a/mtdutils/mounts.c
+++ b/mtdutils/mounts.c
@@ -212,3 +212,11 @@ unmount_mounted_volume(const MountedVolume *volume)
}
return ret;
}
+
+int
+remount_read_only(const MountedVolume* volume)
+{
+ return mount(volume->device, volume->mount_point, volume->filesystem,
+ MS_NOATIME | MS_NODEV | MS_NODIRATIME |
+ MS_RDONLY | MS_REMOUNT, 0);
+}
diff --git a/mtdutils/mounts.h b/mtdutils/mounts.h
index 2e2765a..30b2927 100644
--- a/mtdutils/mounts.h
+++ b/mtdutils/mounts.h
@@ -28,4 +28,6 @@ find_mounted_volume_by_mount_point(const char *mount_point);
int unmount_mounted_volume(const MountedVolume *volume);
+int remount_read_only(const MountedVolume* volume);
+
#endif // MTDUTILS_MOUNTS_H_
diff --git a/mtdutils/mtdutils.c b/mtdutils/mtdutils.c
index d16f44e..48d5ea9 100644
--- a/mtdutils/mtdutils.c
+++ b/mtdutils/mtdutils.c
@@ -455,7 +455,7 @@ static int write_block(MtdWriteContext *ctx, const char *data)
if (retry > 0) {
fprintf(stderr, "mtd: wrote block after %d retries\n", retry);
}
- fprintf(stderr, "mtd: successfully wrote block at %x\n", pos);
+ fprintf(stderr, "mtd: successfully wrote block at %llx\n", pos);
return 0; // Success!
}