Merge pull request #1780 from ogayot/oem-update-index

oem+drivers: fix wrong order or lower layers when building overlays
This commit is contained in:
Olivier Gayot 2023-09-01 09:20:45 +02:00 committed by GitHub
commit e363ef5c82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -268,9 +268,9 @@ class AptConfigurer:
async def overlay(self):
overlay = await self.mounter.setup_overlay(
[
self.install_tree.upperdir,
self.configured_tree.upperdir,
self.source_path,
self.configured_tree.upperdir,
self.install_tree.upperdir,
]
)
try:

View File

@ -155,6 +155,15 @@ class Mounter:
path.unlink(missing_ok=True)
async def setup_overlay(self, lowers: List[Lower]) -> OverlayMountpoint:
"""Setup a RW overlay FS over one or more lower layers.
Be careful, when multiple lower layers are specified, they are stacked
from the leftmost one and going right. This is the opposite of what the
lowerdir mount option expects.
Therefore, when calling setup_overlay([x, y, z]), the corresponding
mount command will look something like:
$ mount [...] -o lowerdir=z:y:x
Which means z will be top, y will be middle and x will be bottom.
"""
tdir = self.tmpfiles.tdir()
target = f"{tdir}/mount"
lowerdir = lowerdir_for(lowers)