]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix mount_overlay() with multiple lowerdirs
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 6 Nov 2023 10:28:16 +0000 (11:28 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 6 Nov 2023 16:09:34 +0000 (17:09 +0100)
Multiple lower directories are specified by delimiting with colons,
not by specifying the lowerdir= option multiple times. Also, the
lowerdirs are stacked right to left so make sure we reverse the given
list.

mkosi/mounts.py

index 791f760133e4525694c009cb0892470ea6c7e351..bc1dd5405b2532c2fddc841ebc763e0a04675547 100644 (file)
@@ -74,7 +74,8 @@ def mount(
 @contextlib.contextmanager
 def mount_overlay(lowerdirs: Sequence[Path], upperdir: Path, where: Path) -> Iterator[Path]:
     with tempfile.TemporaryDirectory(dir=upperdir.parent, prefix=f"{upperdir.name}-workdir") as workdir:
-        options = [f"lowerdir={lower}" for lower in lowerdirs] + [
+        options = [
+            f"lowerdir={':'.join(os.fspath(p) for p in reversed(lowerdirs))}",
             f"upperdir={upperdir}",
             f"workdir={workdir}",
             # Disable the inodes index and metacopy (only copy metadata upwards if possible)