Hi Karsten,

Quoting Johannes Schauer (2018-10-02 04:23:54)
> > Another thing that I have stumbled upon is that providing a sources.list on
> > stdin only works when no target directory is provided on the commandline,
> > i.e. when automatically creating a tarball. While
> > 
> >   echo -e "deb http://deb.debian.org/debian-ports/ sid main\ndeb 
> > http://deb.debian.org/debian-ports/ unreleased main" | mmdebstrap 
> > --architectures=riscv64 > /tmp/rv64-chroot.tar
> > 
> > works, the following doesn't:
> > 
> >   echo -e "deb http://deb.debian.org/debian-ports/ sid main\ndeb 
> > http://deb.debian.org/debian-ports/ unreleased main" | mmdebstrap 
> > --architectures=riscv64 sid /tmp/rv64-chroot
> > 
> > It results in
> > 
> >   I: riscv64 cannot be executed, falling back to qemu-user
> >   I: automatically chosen mode: root
> >   I: running apt-get update...
> >   done
> >   apt-get update didn't download anything at /usr/bin/mmdebstrap line 721.
> 
> This is actually a feature. In your second invocation, you didn't specify the
> "MIRROR" argument. The docs say:
> 
> > If no MIRROR option is provided, http://deb.debian.org/debian is used.
> 
> In your first invocation, you also didn't specify the "SUITE" argument. The
> docs say:
> 
> > If no SUITE was specified, then a single MIRROR "-" is added and thus the
> > information of the desired suite has to come from standard input as part of 
> > a
> > valid apt sources.list file.
> 
> So the implicit '-' as the mirror argument only works if there was no SUITE. 
> If
> you pass a SUITE, you need to explicitly tell it that you want to read the
> mirror from stdin. This is to have compatibility with how debootstrap also 
> just
> uses deb.debian.org/debian as the mirror if the mirror argument is missing.
> 
> To make the cause of the problem more obvious, I'm now printing the content of
> /etc/apt/sources.list in the chroot in case apt-get didn't download anything:
> 
> https://gitlab.mister-muffin.de/josch/mmdebstrap/commit/1f13d0157bc8364ac491203a6a9156a78f6228a9
> 
> But we could turn this bug into a feature request of the following form:
> 
> If no MIRROR was provided *and* something was specified on standard input, 
> then
> don't use deb.debian.org/debian but use whatever was given on standard input
> instead.
> 
> Or even more liberal:
> 
> If anything is provided on standard input and there is no '-' MIRROR argument,
> then just append whatever is given on standard input to the apt sources.list
> inside the chroot.
> 
> What do you think?

now that I've slept about it, I think your idea makes sense. If you don't
specify a mirror but you pass something on standard input, then the default
mirror should *not* be used. The default mirror should only be used if neither
a mirror nor anything from standard input was given.

I pushed a fix to the upstream repository. I would be happy if you could
download the latest version of the shell script from there and test if it works
as you had expected it to work.

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to