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

debconf constructs to watch out for, to support preseeding

The debconf preseeding support that I've added to d-i relies on d-i
components not doing things with debconf that mae preseeding impossible.
Please watch out for the following uses of debconf:

 - Reset before asking a question:

   db_reset some/question
   db_input high some/question
   db_get some/question
   # Do something with $RET here

   Resetting the question clears the preseeded value and unsets the seen
   flag, which destroys any preseeded value. This can generally be
   changed to do the reset after asking the question, which will let the
   first ask of it be preseeded:

   db_input high some/question
   db_get some/question
   # Do something with $RET here
   db_reset some/question

 - Explicitly setting a question's answer before asking it:

   db_set some/question blah
   db_input high some/question

   This just wipes out any preseeded value. Generally this can be
   changed to set a good default in the templates file, and if
   necessary, reset the question after asking it. Another approach that
   works sometimes is to avoid setting the question if it already has a
   value or is already seen.

 - Unsetting seen flag.

   db_fset some/question seen false

   This is completly unnecessary, and it just makes preseeding not work.
   In the d-i environment, if you ask a question twice, the user will
   see it twice, without you needing to touch the seen flag. The only
   valid use of touching the seen flag is setting it to true, to prevent
   a question from being displayes, as preseeding and a few other places
   in d-i do.

I've fixed some of the worst offenders and hopefully it will be possible
to preseed all the questions asked in a standard install fairly soon.

see shy jo

Attachment: signature.asc
Description: Digital signature

Reply to: