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

Re: patch to fix debootstrap invocation on local archive

On Wed, Apr 11, 2001 at 09:25:43AM -0700, David Whedon wrote:
> Thu, Apr 12, 2001 at 01:12:40AM +1000 wrote:
> > On Wed, Apr 11, 2001 at 10:53:33AM -0400, Adam Di Carlo wrote:
> > > Anyhow, this does highlight that we need to cope with errors and
> > > problems in debootstrap a *lot* more gracefully.   I don't know if
> > > that has well defined exit codes (archive not found, out of memory,
> > > out of disk, etc).  I hope so, because we can't very well do an
> > > interface without that.
> > Yes, this needs fixing. How should boot-floppies and debootstrap interact?
> > Possible interactions are:
> >       * failures/success (duh)
> We definately need to get the return code better.  That is our fault at the 
> moment. As it is we're using popen() so we can also log the progress, though
> that doesn't give us a useful return code.  We should be calling wait4()
> manually, or similar, I think.

Well, debootstrap doesn't really return meaningful return codes yet. Or, at
least, if it does, it's more by luck than design.

> >       * progress -- how much has downloaded (x%), what's happening
> >         (I: installing essential packages), etc
> It would be really nice to have some %'s, like apt-get.

Is it reasonable for boot-floppies/dbootstrap to do the display of
that (with slang and such), or does debootstrap need to do it? Or
does debootstrap need to have some sort of module or something to do
boot-floppies-like-slang itself?

> >       * interactivity -- "please insert the 5th base-system floppy"
> I was hoping debootstrap would be able to do its job without any interaction.
> As currently written we can't handle interactivity, though I could change that
> if it is desired.  We aren't supporting base system on floppies,  unless someone
> really wants to.

We've supported the base system on floppies up until potato; I'd like
to continue it. Actually, now that I think about it, it can probably be
done outside of debootstrap too. Hmmm.... [0]

Interactivity would also be good for "failed to get console-data. [Skip]
[Abort]" sorts of options, which would probably be handy.

> > I'm happy to do just about anything on the debootstrap end for this;
> > what's convenient for boot-floppies? Calling a program, displaying the
> > slang stuff "myself", using a named pipe, using stdio?
> I'd suggest continuing to use stdout, and then exit with a helpful return code.
> As currently written we have about 3 lines that can be used to tell the user
> what is going on.  We're just taking every line from debootstrap's stdout,
> example :
> http://people.debian.org/~dwhedon/debootstrap.png
> With that in mind, maybe replacing the 'trying to get' string with a % of the
> total bytes to download, and I'll work on catching the return code 
> intelligently.  The rest looks good.

That's not bad. Another possibility that could be managed would be
having all the dpkg output go to &2, and having summary/informative
output go to &1. Then you could redirect &2 to the second VC, which
might be more managable.

I could also make the summary/informative output look like:
	I: Getting libc6 2.2.2-1...
	P: 30% Downloading base system
if you were able to draw percentage bars somewhere on the screen, say.

How about I make a debootstrap that directs dpkg's output to stderr,
prefaces all the informative stuff to stdout with an I:, and ends with
error code 1 after printing E: something, all iff the first arg is
"--boot-floppies"? That can be extended later to have P: lines for
percentages or whatever too, if desired.


[0] Yes, I think it can. Hmm. You'd handle it something like:

    On machine with access to the archive (net, local mirror, CD#1):
        create a tarball of Release, Packages.gz, and the appropriate .debs
        split the tarball into X floppy images
    On installation machine:
        untar into pseudo-mirror-area
        point debootstrap at mirror-area

    If you're willing to be a bit cleverer, you can probably munge the names
    before creating the floppy images, and then unpack them directly into

    So that would need some hacking on dbootstrap, but wouldn't need

Anthony Towns <aj@humbug.org.au> <http://azure.humbug.org.au/~aj/>
I don't speak for anyone save myself. GPG signed mail preferred.

``_Any_ increase in interface difficulty, in exchange for a benefit you
  do not understand, cannot perceive, or don't care about, is too much.''
                      -- John S. Novak, III (The Humblest Man on the Net)

Reply to: