From 19ecd4572f1e467c9b9c18db222cf74f81d17417 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Sun, 5 Jan 2014 18:09:25 -0800 Subject: [PATCH] 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. --- build_library/disk_util | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/build_library/disk_util b/build_library/disk_util index 3bf722ece7..a022b08173 100755 --- a/build_library/disk_util +++ b/build_library/disk_util @@ -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.