Manage Interactive Input: Difference between revisions
(→Syntax explained: + grep) |
(→References: replaced link to discussion (pipermail -> mail-archive)) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 25: | Line 25: | ||
#* Name of the package to install that asks interactively for input | #* Name of the package to install that asks interactively for input | ||
# Question template name | # 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:' ~/control_files/templates</code> to extract the essential information) | #* 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 | #* boolean | ||
Line 41: | Line 41: | ||
== References == | == References == | ||
* [ | * [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 === |
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)
- Package 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
dpkg-deb -e packagename.deb ~/control_files/
, then rungrep -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)
- 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
- Answer value type
- boolean
- string
- password
- select
- multiselect
- note
- 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
- "Install Sun Java on etch" (discussion on linux-fai mailing list, 09-May-2007)
More reading
- DebianWiki: DebianInstaller / Preseed
- The Debconf Programmer's Tutorial (background reading about template/question names)
- Using preseeding (Ubuntu documentation)
- Automating the installation using preseeding (Embedded Debian documentation)