Your message dated Thu, 02 Sep 2021 00:57:58 +0100
with message-id <d6632e77779b87d5fdd491c678df8c8fd17eabc0.ca...@gmail.com>
and subject line Re: Re: debootstrap: man page says that --include will add 
package to download and extract list, but an experiment shows opposite
has caused the Debian Bug report #935334,
regarding debootstrap: man page says that --include will add package to 
download and extract list, but an experiment shows opposite
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
935334: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=935334
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: debootstrap
Version: 1.0.115
Severity: normal

It is known that debootstrap first extracts packages without writting to dpkg 
database
using "dpkg-deb" or "ar" and then unpacks and configures packages using more 
high-level
methods.

I will refer to that low-level stage (when we extract packages using "dpkg-deb" 
or "ar") as
extract stage.

Manual page says: "--include=alpha,beta  Comma separated list of packages which 
will be
added to download and extract lists."

So, it follows from manual page that --include=alpha will add a package to set 
of packages,
which are extracted at extract stage. But experiment shows that this is not 
true. So,
please either fix debootstrap or its manual page.

Same for --exclude.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.15.0-0.bpo.2-amd64 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to C.UTF-8), LANGUAGE=en_US:en (charmap=UTF-8) (ignored: LC_ALL set to 
C.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

Versions of packages debootstrap depends on:
ii  wget  1.20.3-1+b1

Versions of packages debootstrap recommends:
ii  arch-test               0.16-1
ii  debian-archive-keyring  2019.1
ii  gnupg                   2.2.17-3

Versions of packages debootstrap suggests:
pn  squid-deb-proxy-client  <none>
pn  ubuntu-archive-keyring  <none>

-- no debconf information

--- End Message ---
--- Begin Message ---
On Sun, 22 Mar 2020 23:46:34 +0300 =?UTF-8?B?QXNrYXIgU2FmaW4=?=
<safinas...@mail.ru> wrote:
> Steps to reproduce:
> * Get fresh sid system with debootstrap installed
> * Run: debootstrap --include=aptitude --foreign sid /tmp/sid
> * Then run: ls /tmp/sid/usr/bin/aptitude
> 
> I expected to see: /tmp/sid/usr/bin/aptitude
> 
> I see instead: ls: cannot access '/tmp/sid/usr/bin/aptitude': No such
file or directory
> 
> I will state again that this bug can be fixed either by changing
code, either by changing documentation.

The problem here does not seem to be a bug but rather a failure on your
part to use debootstrap correctly, and/or a failure to understand what
to expect from the first stage of the two-stage execution model that
you have invoked, perhaps mistakenly, with your use of the `--foreign`
option.

If you tweak your example to simply remove the use of the `--foreign`
flag in step 3 then you should find that your `ls` command in step 4
works just fine.

It is important to understand what `--foreign` does if you're going to
use it and if you're to appreciate why your expectations are wrong
here. This option is meant for situations where you're building a
chroot for an architecture different to that of your host OS. What it
does is to prematurely stop the process after some initial work is
done, requiring you to pair this with a second execution using the `--
second-stage` option to have it complete the process. It's been a very
long time since I last looked at the code myself, but I believe that
I'm correct in saying that the first stage includes downloading all of
the packages and extracting a very minimal set of essential packages
necessary to making the second stage work, and that the second stage
then involves extracting / installing all remaining packages and
execution of package configuration scripts (which must be done using
the target architecture, apparently). More specifically, you would
typically not execute the second stage with the system/host copy of
debootstrap, but rather (via the `chroot` command) the copy placed in a
temporary location within the target directory you pointed debootstrap
at.

Normal usage model:
 - `sudo debootstrap --include=aptitude sid /tmp/sid`

Two-stage "foreign" usage model:
 - `sudo debootstrap --include=aptitude --arch=$ARCH --foreign sid /tmp/sid`
 - `sudo chroot /tmp/sid /bin/sh /deboostrap/debootstrap --second-stage`

(The `bin/sh` bit may be unnecessary, I'm copying from something that
does include that and I can't remember).

If you use debootstrap in this two-stage mode, and only do the first
stage, you cannot expect all of the packages to have been extracted,
nevermind that they would be in a usable state (with the configuration
stage of package installation having not yet been done), hence why it
is false to expect to be able to find your aptitude binary, and why it
would be even more wrong to assume that you could actually *run*
aptitude after just the first stage, if that's what you were wanting to
do.

To be fair, the documentation in the man page for `--foreign` says that
it causes debootstrap to only do the "initial packaging phase", which
could very easily mislead users into expecting that *every* package
would be unpacked during the first stage, which I am pretty certain is
not the actually case, so the documentation could benefit from being
improved.

I'm going to go ahead and close this, since there is no bug with the
functioning of `--include`/`--exclude` as you described. Feel free to
open a new bug to request improved clarification of the actions that
take place within each of the steps in the two-stage model.

--- End Message ---

Reply via email to