On Mon, 22 Feb 2021, Johannes Schauer Marin Rodrigues wrote:
So yes, workarounds are (sadly) still necessary to debootstrap Debian. But arguing with Debian policy is the wrong way forward as policy does not talk about the debootstrap scenario but only about the system where your packages were at least configured once before. To find a good solution that can make it into Debian policy, talk to the dpkg maintainers and write patches against dpkg. As the author of mmdebstrap I already got them to integrate several changes into dpkg that make the work for programs like debootstrap and mmdebstrap easier and with features like DPKG_ROOT I'm very confident that they will greatly appreciate your help in further improving the situation.
I didn't realize I was arguing with Debian policy! Right at the start I was as initially I _only_ wanted to add a depends to passwd and base-files - without realizing that that _did_ break the policy that you shouldn't state dependencies on Essential: yes packages. But since then I've been argying that Debian Policy _doesn't_ need to change at all. The existing wording of the policy, that on a strict reading implies that configure _never_ has had to be run can be correct. The reason I took this to debian-devel is because the "no-new functionality" change that makes everything work and have a strict reading of the policy is to remove Essential: yes from base-passwd. And I could see that that change was potentially going to impact thousands of packages as every package should then specify an implicit or explicit dependency on this package. c.f. i3lock-fancy which has a Dependency: gawk | cpl-plugin-hawki-calib | cpl-plugin-hawki-doc | mawk | original-awk | python-tomahawk But awk is a Pre-Depends of base-files and only gawk, mawk or original-awk provide it therefore this must be satisfied (unless there's something in non-free or the like that can also provide awk that I haven't looked for) (As far as I can see, the only reason base-files depends on awk is to make awk "essential". It doesn't seem to need it itself.) I am now working on a proof-of-concept patch to dpkg to achieve the same result (that base-passwd can be both Essential:yes and conform to the strictest reading of the policy on Essential:yes). Assuming I can get something working I'll open a bug against dpkg and see the the dpkg developers can make anything of it. dpkg is sufficently complicated and operates in so many different ways that I don't think I can possibly create something better than "works for me" but we'll see where I get to. I really didn't mean to tread on anyones toes here. This all started for me because debootstrap couldn't do what I wanted out of the box and I thought doing it myself would be easier than enhancing debootstrap. I then had the apparently trivial fix of adding a couple of dependencies to a couple of packages and it all spiralled from there. Had I known about the existency of mmdebstrap before I started then I might never have got to here. FWIW I would like debian to cover the bootstrap case, and I believe that it is already extremely close to achieving that out of the box. Tim.