Asking base-config questions before the first reboot

Colin Watson cjwatson at
Wed Sep 22 12:27:58 CDT 2004

We have a late Warty (actually, Sounder 9) design requirement to ask
some base-config questions before the first reboot, so that if nothing
goes wrong you reboot, the installer installs a load of packages, and
you get dropped straight into X.

Whatever we (probably I) do to implement this is going to get much less
user testing before release than we would like, so running away from any
kind of risk in the implementation is a very good idea. After looking at
the alternatives for a while, I concluded that they were all complicated
enough that posting a design document would be a good idea, if nothing
else so that people have an idea what I'm doing.

There's an existing package called baseconfig-udeb which does this by
running base-config inside a chroot and Jedi-mind-tricking it into
starting up a new instance of debconf which takes over the screen. This
has a certain elegant insanity to it, but it isn't well-tested or
well-integrated (in particular, the sequence of events in prebaseconfig
is totally weird when baseconfig-udeb is involved), and in my own
testing it experiences some bad display corruption, probably due to
terminal type issues. I don't think we should rely on getting this
working before Warty. Also, I'd prefer to reboot before spending time
installing lots of packages so that we can make sure that the first
reboot works properly and make absolutely sure we're using the
production kernel. So, after some consideration, I've rejected this

A much simpler solution is to ask whatever questions are required
pre-reboot using cdebconf as usual, and do the normal trick of copying
questions from the cdebconf database at the beginning of base-config.
The natural approaches to this involve too much code duplication,
duplication of data such as timezone lists, and duplication of
translated templates, which are going to be hard to continue to

To me, the best solution seems to be to have the base-config source
package itself spit out some new udebs, one for each set of questions
(this makes it look nice on the main menu). These will act somewhat like
the .config maintainer scripts in normal Debian packages: they will ask
questions, but the answers to those questions will not be acted upon.
When base-config runs for real post-reboot, it will fetch the answers
and do whatever it needs to do with them.

These new udebs are as follows:


    Runs tzsetup, with country preset to whatever you selected in
    countrychooser. Issues: tzsetup needs tempfile, which isn't in
    busybox; needs /usr/share/zoneinfo/*, /etc/timezone, /etc/localtime,
    /etc/default/rcS, maybe /etc/init.d/ from /target, so will
    need to know to fetch them from the chroot; needs hwclock from
    /target, similarly.

    On the other hand, asking this question before the first reboot
    makes it easier to use the d-i infrastructure to find out whether
    there are other operating systems installed on the machine.


    Asks whether you want to download updates from the network, probably
    only if you're installing from CD-ROM and networking is configured.
    Issues: this question is buried in the middle of apt-setup at the
    moment. There'll probably be code duplication, but we can at least
    avoid the translated template duplication.

In addition, the shadow source package needs to spit out a udeb to ask
for the new username and password:


    Asks for a full name, username, password, password confirmation;
    repeats if the password and password confirmation don't match.
    Issues: again, there'll probably be code duplication here, but the
    translated templates can be preserved.

Issues with all of these:

  debconf returns 30 on backup, but the exit code returned by a udeb for
  backup is 10 for some reason. Will need a wrapper.

  In order for this to work, base-config and shadow need to be
  preseedable (i.e. honour answers already in the debconf database).
  base-config is preseedable in Debian sid, but not in warty because the
  work was only done recently; I don't think shadow is preseedable even
  in sid yet.

  Will require InstallerSeed changes, NEW processing, CD changes, and as
  much testing as we can give it.

Comments (especially Matt, Jeff, Mark)?

Colin Watson                                    [cjwatson at]

More information about the ubuntu-devel mailing list