diff --git a/subiquity/server/apt.py b/subiquity/server/apt.py index d06a498d3..d18e4911e 100644 --- a/subiquity/server/apt.py +++ b/subiquity/server/apt.py @@ -268,9 +268,9 @@ async def configure_for_install(self, context): 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: diff --git a/subiquity/server/mounter.py b/subiquity/server/mounter.py index 2139b7a55..53d45d2ca 100644 --- a/subiquity/server/mounter.py +++ b/subiquity/server/mounter.py @@ -155,6 +155,15 @@ async def unmount(self, mountpoint: Mountpoint, remove=True): 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)