mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-26 21:11:54 +01:00
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:
parent
ba532952b1
commit
19ecd4572f
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user