From: Georges Discry Date: Fri, 21 Apr 2023 23:24:24 +0000 (+0200) Subject: Fix installation of essential packages on Debian stretch X-Git-Tag: v15~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27b586dc5dcdad18938494b75bc460065cb8241b;p=thirdparty%2Fmkosi.git Fix installation of essential packages on Debian stretch 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. --- diff --git a/mkosi/distributions/debian.py b/mkosi/distributions/debian.py index 5324ce96d..6c047c8b3 100644 --- a/mkosi/distributions/debian.py +++ b/mkosi/distributions/debian.py @@ -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.