]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
debian: Add TODO to drop /var/lib/dpkg/status logic when possible
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 22 Apr 2023 20:41:33 +0000 (22:41 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 23 Apr 2023 14:09:36 +0000 (16:09 +0200)
It's created automatically by apt since apt 2.5.4 so add a note that
we can drop it once that version is widely available. Also disable
dpkg locking since it causes a apt failure due to not being able to
access the lock file in /var/lib/dpkg. Since we're building in a
chroot, we don't care about locking anyway.

mkosi/distributions/debian.py

index 6c047c8b3204022961179d2a70ed660a0c113d4a..f00d3cd70f049bb91b8936b2ff8576eb73cd901f 100644 (file)
@@ -164,6 +164,8 @@ def setup_apt(state: MkosiState, repos: Sequence[str]) -> None:
     state.workspace.joinpath("apt/apt.conf.d").mkdir(exist_ok=True)
     state.workspace.joinpath("apt/preferences.d").mkdir(exist_ok=True)
     state.workspace.joinpath("apt/log").mkdir(exist_ok=True)
+
+    # TODO: Drop once apt 2.5.4 is widely available.
     state.root.joinpath("var").mkdir(mode=0o755, exist_ok=True)
     state.root.joinpath("var/lib").mkdir(mode=0o755, exist_ok=True)
     state.root.joinpath("var/lib/dpkg").mkdir(mode=0o755, exist_ok=True)
@@ -189,6 +191,7 @@ def setup_apt(state: MkosiState, repos: Sequence[str]) -> None:
             Dir::Etc::trustedparts "/usr/share/keyrings";
             Dir::Log "{state.workspace / "apt/log"}";
             Dir::Bin::dpkg "{shutil.which("dpkg")}";
+            Debug::NoLocking "true";
             DPkg::Options:: "--root={state.root}";
             DPkg::Options:: "--log={state.workspace / "apt/dpkg.log"}";
             DPkg::Options:: "--force-unsafe-io";