summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorBrint E. Kriebel <bekit@cyngn.com>2016-01-29 11:47:56 -0800
committerBrint E. Kriebel <bekit@cyngn.com>2016-01-29 11:55:29 -0800
commit1a1555ca3280757ececacacc38ea1e0d25afb6ed (patch)
treee543da48092297c36bf034d6c991c505275cb0fa /tools
parenta321927684eb1fa22cdc4eb3855bdd1ef614aa79 (diff)
downloadbuild-1a1555ca3280757ececacacc38ea1e0d25afb6ed.zip
build-1a1555ca3280757ececacacc38ea1e0d25afb6ed.tar.gz
build-1a1555ca3280757ececacacc38ea1e0d25afb6ed.tar.bz2
releasetools: Use the first entry of a mount point when reading fstab
There may be multiple entries in fstab for a mount point. Use the first value found so the entries are prioritized in order. Change-Id: Ibd2631413d3e00507d3a0ec84fb91755f1c7993c Ticket: OPO-326
Diffstat (limited to 'tools')
-rw-r--r--tools/releasetools/common.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 224b276..4f8db79 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -268,9 +268,10 @@ def LoadRecoveryFSTab(read_helper, fstab_version, type):
else:
print("%s: unknown option \"%s\"" % (mount_point, i))
- d[mount_point] = Partition(mount_point=mount_point, fs_type=pieces[1],
- device=pieces[2], length=length,
- device2=device2)
+ if not d.get(mount_point):
+ d[mount_point] = Partition(mount_point=mount_point, fs_type=pieces[1],
+ device=pieces[2], length=length,
+ device2=device2)
elif fstab_version == 2:
d = {}
@@ -306,9 +307,10 @@ def LoadRecoveryFSTab(read_helper, fstab_version, type):
context = i
mount_point = pieces[1]
- d[mount_point] = Partition(mount_point=mount_point, fs_type=pieces[2],
- device=pieces[0], length=length,
- device2=None, context=context)
+ if not d.get(mount_point):
+ d[mount_point] = Partition(mount_point=mount_point, fs_type=pieces[2],
+ device=pieces[0], length=length,
+ device2=None, context=context)
else:
raise ValueError("Unknown fstab_version: \"%d\"" % (fstab_version,))