Manage Interactive Input: Difference between revisions

From FAIWiki
Jump to navigation Jump to search
(→‎Syntax explained: + list of value types)
(→‎References: replaced link to discussion (pipermail -> mail-archive))
 
(12 intermediate revisions by the same user not shown)
Line 13: Line 13:
Questions by debconf can be answered in the FAI config space in the ''debconf'' folder. This is called ''"debconf preseeding"''.
Questions by debconf can be answered in the FAI config space in the ''debconf'' folder. This is called ''"debconf preseeding"''.


Debconf preseeding is done by adding to ''debconf/DEFAULT'' (or another file matching an FAI class) something like:
Debconf preseeding is done by adding to ''debconf/DEFAULT'' (or another file matching a FAI class) something like:


  sun-java6-bin  shared/accepted-sun-dlj-v1-1    boolean true
  sun-java6-bin  shared/accepted-sun-dlj-v1-1    boolean true
Line 19: Line 19:
  sun-java6-jre  shared/accepted-sun-dlj-v1-1    boolean true
  sun-java6-jre  shared/accepted-sun-dlj-v1-1    boolean true


== Syntax explained ==
=== Syntax explained ===


The arguments on each line are separated by white space, and have the following meaning: (in sequential order)
The arguments on each line are separated by white space, and have the following meaning: (in sequential order)
# Package name
# Package name
# Question name
#* Name of the package to install that asks interactively for input
# Question template name
#* The identifier of the question from the interactive installation (see file ''packagename.templates'' in .deb package; you can extract the templates file from the .deb package with <code>dpkg-deb -e packagename.deb ~/control_files/</code>, then run <code>grep -e '^Template:' -e '^Type:' -e '^Default:' ~/control_files/templates | xargs | sed -e 's/\s*Template: /\npackagename\t/g' -e 's/\s*Type: */\t/g' -e 's/\s*Default: */\t/g'</code>, replacing ''packagename'' accordingly, to extract the essential information)
# Answer value type
# Answer value type
#* boolean
#* string
#* password
#* select
#* multiselect
#* note
# Answer value
# Answer value
#* The value to use for automated installation, comma-separated for ''multiselect'', empty for ''note''


''Answer value type''s may be:
=== Examples ===
* boolean
* see the files in ''/var/lib/fai/config/debconf/'' of your FAI host (or boot medium)
* string
* [http://www.debian.org/releases/lenny/example-preseed.txt example-preseed.txt] (sample from Debian/lenny installer)
* password
* select
* multiselect
 
'''Examples:''' see the files in ''/var/lib/fai/config/debconf/'' of your FAI host (or boot medium)!


== References ==
== References ==
* [https://lists.uni-koeln.de/pipermail/linux-fai/2007-May/004965.html "Install Sun Java on etch"] (discussion on linux-fai mailing list, 09-May-2007)
* [http://www.mail-archive.com/linux-fai@uni-koeln.de/msg00112.html "Install Sun Java on etch"] (discussion on linux-fai mailing list, 09-May-2007)


=== More reading ===
=== More reading ===
* [http://wiki.debian.org/DebianInstaller/Preseed DebianWiki: DebianInstaller / Preseed]
* [http://wiki.debian.org/DebianInstaller/Preseed DebianWiki: DebianInstaller / Preseed]
* [http://www.debian.org/releases/lenny/example-preseed.txt example-preseed.txt] (sample from Debian/lenny)
* [http://www.fifi.org/doc/debconf-doc/tutorial.html The Debconf Programmer's Tutorial] (background reading about template/question names)
* [https://help.ubuntu.com/8.04/installation-guide/i386/preseed-using.html Using preseeding] (Ubuntu documentation)
* [https://help.ubuntu.com/8.04/installation-guide/i386/preseed-using.html Using preseeding] (Ubuntu documentation)
* [http://www.emdebian.org/release/grip/a1106.html Automating the installation using preseeding] (Embedded Debian documentation)
* [http://www.emdebian.org/release/grip/a1106.html Automating the installation using preseeding] (Embedded Debian documentation)

Latest revision as of 08:16, 26 August 2010

Some Debian packages request interactive input by a user for installation. This how-to describes how to handle such situations that usually produce an error in the installation process.

Problem (Example)

When installing Java (Debian package sun-java6-bin) the package requests you to accept Sun's license before the installation is effectively performed. If you have this package (or a package having a dependency to it) in a FAI class the installation may result in the following error:

sun-dlj-v1-1 license could not be presented
try 'dpkg-reconfigure debconf' to select a frontend other than noninteractive
dpkg: error processing ...

Note: The problem is debconf must ask for acceptance of the Java license. As aptitude runs in non-interactive mode it aborts installing the package.

Solution

Questions by debconf can be answered in the FAI config space in the debconf folder. This is called "debconf preseeding".

Debconf preseeding is done by adding to debconf/DEFAULT (or another file matching a FAI class) something like:

sun-java6-bin   shared/accepted-sun-dlj-v1-1    boolean true
sun-java6-jdk   shared/accepted-sun-dlj-v1-1    boolean true
sun-java6-jre   shared/accepted-sun-dlj-v1-1    boolean true

Syntax explained

The arguments on each line are separated by white space, and have the following meaning: (in sequential order)

  1. Package name
    • Name of the package to install that asks interactively for input
  2. Question template name
    • The identifier of the question from the interactive installation (see file packagename.templates in .deb package; you can extract the templates file from the .deb package with dpkg-deb -e packagename.deb ~/control_files/, then run grep -e '^Template:' -e '^Type:' -e '^Default:' ~/control_files/templates | xargs | sed -e 's/\s*Template: /\npackagename\t/g' -e 's/\s*Type: */\t/g' -e 's/\s*Default: */\t/g', replacing packagename accordingly, to extract the essential information)
  3. Answer value type
    • boolean
    • string
    • password
    • select
    • multiselect
    • note
  4. Answer value
    • The value to use for automated installation, comma-separated for multiselect, empty for note

Examples

  • see the files in /var/lib/fai/config/debconf/ of your FAI host (or boot medium)
  • example-preseed.txt (sample from Debian/lenny installer)

References

More reading