summaryrefslogtreecommitdiff
path: root/qcom
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2020-02-24 13:23:55 +0530
committerJohn Stultz <john.stultz@linaro.org>2020-03-17 04:10:56 +0000
commit39f249cbdbb300301bfb7cafc705b34866fd8ce8 (patch)
tree9805e9f48e4bd750ee423c02296f74c238df3bd8 /qcom
parent8bd2e61f623552eccd2d0b85f140535f219a2279 (diff)
db845c: qcom: rmtfs: Use -o option to override partition by-name
Instead of hardcoding BY_PARTLABEL_PATH for AOSP, reuse -o option as suggested by Bjorn to expand John's patch to find correct partition by-name on newer kernels (which is /dev/block/platform/soc*/*.*/by-name). For example: On db845c running v5.4+ kernel we run: rmtfs -o /dev/block/platform/soc@0/1d84000.ufshc/by-name -P -r -s Change-Id: I05a18566370aff1018a79ec2c83532a2849ca359 Signed-off-by: Amit Pundir <amit.pundir@linaro.org> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'qcom')
-rw-r--r--qcom/rmtfs/rmtfs.c6
-rw-r--r--qcom/rmtfs/storage.c7
2 files changed, 7 insertions, 6 deletions
diff --git a/qcom/rmtfs/rmtfs.c b/qcom/rmtfs/rmtfs.c
index 795c021..26c0488 100644
--- a/qcom/rmtfs/rmtfs.c
+++ b/qcom/rmtfs/rmtfs.c
@@ -499,7 +499,11 @@ int main(int argc, char **argv)
while ((option = getopt(argc, argv, "o:Prsv")) != -1) {
switch (option) {
- /* -o sets the directory where EFS images are stored. */
+ /*
+ * -o sets the directory where EFS images are stored,
+ * or sets the directory from where raw EFS partitions
+ * can be picked by-name when used with -P option.
+ */
case 'o':
storage_root = optarg;
break;
diff --git a/qcom/rmtfs/storage.c b/qcom/rmtfs/storage.c
index d31f757..4c78ab3 100644
--- a/qcom/rmtfs/storage.c
+++ b/qcom/rmtfs/storage.c
@@ -11,11 +11,7 @@
#define MAX_CALLERS 10
#define STORAGE_MAX_SIZE (16 * 1024 * 1024)
-#ifndef ANDROID
#define BY_PARTLABEL_PATH "/dev/disk/by-partlabel"
-#else
-#define BY_PARTLABEL_PATH "/dev/block/by-name"
-#endif
#define MIN(x, y) ((x) < (y) ? (x) : (y))
@@ -60,7 +56,8 @@ int storage_init(const char *storage_root, bool read_only, bool use_partitions)
storage_dir = storage_root;
if (use_partitions) {
- storage_dir = BY_PARTLABEL_PATH;
+ if (!storage_root)
+ storage_dir = BY_PARTLABEL_PATH;
storage_use_partitions = true;
}