fix(disk_util): Sort mount order instead of special casing /

Now that /usr is a mount point we need to make sure it gets mounted
before /usr/share/oem. Simply sorting by path length works well enough.
This commit is contained in:
Michael Marineau 2014-01-05 18:09:25 -08:00
parent ba532952b1
commit 19ecd4572f

View File

@ -450,8 +450,7 @@ def Mount(options):
mounts[path] = part
rootfs = mounts.pop('/', None)
if not rootfs:
if '/' not in mounts:
raise InvalidLayout('No partition defined to mount on /')
def DoMount(mount):
@ -478,9 +477,8 @@ def Mount(options):
Sudo(['mkdir', '-p', full_src, full_dst])
Sudo(['mount', '--bind', full_src, full_dst])
DoMount(rootfs)
for mount in mounts.itervalues():
DoMount(mount)
for mount in sorted(mounts, key=len):
DoMount(mounts[mount])
def Umount(options):
"""Unmount the given path.