[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1020323: debian-policy: document DPKG_ROOT



Hi Russ,

thank you for your explanations, things are quite a bit clearer now.

Quoting Russ Allbery (2022-09-20 05:47:45)
> The point of putting this in Policy is to provide guidance to the
> packagers, not to the bootstrappers.  Presumably you already have other
> documentation that you maintain about how to bootstrap Debian that spells
> out what to do in what order; that's outside of Policy's remit.  What
> Policy is trying to do is to define for packagers what interface they have
> to implement, and DPKG_ROOT is now part of that interface.
> 
> So in other words, you can just say something like:
> 
>     Maintainer scripts in essential or build-essential packages must
>     preface all paths they act on in maintainer scripts with an expansion
>     of the DPKG_ROOT environment variable.  This will normally be empty
>     (and thus normally will not change anything), but in some situations
>     it may be set to a bootstrapping path to tell packages to act under
>     that path instead of on the root file system.
> 
> That wording probably isn't quite right, but I think that's the general
> idea.

okay, if you think this should be a new section, then let me try to come up
with a text here.

   To enable creating a foreign architecture Debian chroot during the early
   bootstrap of a new Debian architecture, maintainer scripts and utilities
   called by maintainer scripts of packages in the essential and
   build-essential set, should support operating on a custom chroot directory.
   This is to avoid running any of the foreign architecture utilities from the
   chroot, because those cannot be executed during the early bootstrapping
   phase of a new architecture.  Instead, by avoiding the chroot() call,
   utilities from the outside should operate on the chroot path given via the
   `DPKG_ROOT` environment variable.  This environment variable is set but
   empty during normal package installations.  If the `DPKG_ROOT` environment
   variable is not empty, then this indicates to the maintainer scripts and the
   tools it executes, that a chroot is being built as part of an early
   architecture bootstrap and all operations should be performed in the chroot
   path given by the contents of the `DPKG_ROOT` environment variable. In that
   case, the maintainer script should not modify anything outside the chroot
   directory.

I refrained from using "must" because we promised maintainers that they would
not need to do the work themselves but will get patches sent from us. We do not
want to force work on maintainers by making it an RC bug if they do not support
DPKG_ROOT.

Helmut, what do you think?

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature


Reply to: