]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix installation of essential packages on Debian stretch
authorGeorges Discry <georges@discry.be>
Fri, 21 Apr 2023 23:24:24 +0000 (01:24 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 22 Apr 2023 05:19:00 +0000 (07:19 +0200)
There is a bug in Debian stretch where `libuuid1` (which is essential)
unnecessarily depends on `passwd`. When configuring the essential
packages and their dependencies, `passwd` is configured before
`base-passwd` and the installation fails.

debootstrap did not have this issue because it explicitly orders the
installation of some essential packages, including `base-passwd`.

By explicitly installing `base-passwd` first, the rest of the essential
packages can then be configured without failure.

mkosi/distributions/debian.py

index 5324ce96daa1b2a49693adb7bc64cfce4545065f..6c047c8b3204022961179d2a70ed660a0c113d4a 100644 (file)
@@ -101,6 +101,12 @@ class DebianInstaller(DistributionInstaller):
                 run(["dpkg-deb", "--fsys-tarfile", deb], stdout=f)
                 run(["tar", "-C", state.root, "--keep-directory-symlink", "--extract", "--file", f.name])
 
+        # There is a bug in Debian stretch where libuuid1 (which is essential) unecessarily depends on passwd,
+        # which breaks the installation as passwd is then configured before base-passwd
+
+        if state.config.release == "stretch":
+            cls.install_packages(state, ["base-passwd"])
+
         # Finally, run apt to properly install packages in the chroot without having to worry that maintainer
         # scripts won't find basic tools that they depend on.