/[d-i]/trunk/manual/en/appendix/preseed.xml
ViewVC logotype

Contents of /trunk/manual/en/appendix/preseed.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 52906 - (hide annotations) (download) (as text)
Mon Apr 28 10:38:51 2008 UTC (5 years ago) by fjp
File MIME type: text/xml
File size: 54758 byte(s)
Let mkpasswd example match man page; also update translations
1 fjp 43583 <!-- retain these comments for translator revision tracking -->
2 joeyh 32508 <!-- $Id$ -->
3 fjp 32199
4     <!--
5 fjp 43841 Be careful with the format of this file as it is parsed to generate
6 fjp 36205 the example preconfiguration file.
7 fjp 32424 In that file all text between <informalexample> tags that have the
8     attribute 'role="example"' set is included, except if a 'condition'
9     attribute is in force that does not match the specified release or if an
10     'arch' attribute is in force that does not match the specified architecture.
11    
12     Currently only a single variant of the example file is generated (for i386).
13     -->
14    
15 fjp 33725 <appendix id="appendix-preseed">
16 fjp 32199 <title>Automating the installation using preseeding</title>
17    
18     <para>
19    
20 joeyh 42364 This appendix explains how to preseed answers to questions in &d-i; to
21     automate your installation.
22 fjp 32276
23     </para><para>
24    
25 fjp 32199 The configuration fragments used in this appendix are also available as an
26 fjp 36205 example preconfiguration file from &urlset-example-preseed;.
27 fjp 32199
28     </para>
29    
30 fjp 32424 <sect1 id="preseed-intro">
31 fjp 32199 <title>Introduction</title>
32 fjp 32424 <para>
33 fjp 32199
34 joeyh 33719 Preseeding provides a way to set answers to questions asked during the
35     installation process, without having to manually enter the answers while
36     the installation is running. This makes it possible to fully automate most
37     types of installation and even offers some features not available during
38     normal installations.
39 fjp 32424
40 cjwatson 51573 </para><para>
41    
42     Preseeding is not required. If you use an empty preseed file, the installer
43     will behave just the same way as in a normal manual installation. Each
44     question you preseed will (if you got it right!) modify the installation in
45     some way from that baseline.
46    
47 fjp 32424 </para>
48    
49     <sect2 id="preseed-methods">
50     <title>Preseeding methods</title>
51     <para>
52    
53     There are three methods that can be used for preseeding:
54     <firstterm>initrd</firstterm>, <firstterm>file</firstterm> and
55     <firstterm>network</firstterm>. Initrd preseeding will work with any
56 joeyh 32501 installation method and supports preseeding of more things, but it requires
57     the most preparation. File and network preseeding each can be used with
58 joeyh 42364 different installation methods.
59 fjp 32424
60     </para><para>
61    
62     The following table shows which preseeding methods can be used with which
63     installation methods.
64    
65     <informaltable>
66     <tgroup cols="4">
67     <thead>
68     <row>
69     <entry>Installation method</entry><entry>initrd</entry>
70     <entry>file</entry><entry>network</entry>
71     </row>
72     </thead>
73    
74     <tbody>
75     <row>
76 joeyh 32501 <entry>CD/DVD</entry>
77 fjp 32424 <entry>yes</entry>
78     <entry>yes</entry>
79 fjp 42374 <entry>yes<footnote id='apx-ps-net'>
80    
81     <para>
82     but only if you have network access, and set <literal>preseed/url</literal>
83     appropriately
84     </para>
85    
86     </footnote></entry>
87 fjp 32424 </row><row>
88     <entry>netboot</entry>
89     <entry>yes</entry>
90     <entry>no</entry>
91     <entry>yes</entry>
92     </row><row>
93     <entry>hd-media <phrase condition="bootable-usb">(including usb-stick)</phrase></entry>
94     <entry>yes</entry>
95     <entry>yes</entry>
96 joeyh 42364 <entry>yes<footnoteref linkend='apx-ps-net'/></entry>
97 fjp 32424 </row><row condition="supports-floppy-boot">
98     <entry>floppy based (cd-drivers)</entry>
99     <entry>yes</entry>
100     <entry>yes</entry>
101 joeyh 42364 <entry>yes<footnoteref linkend='apx-ps-net'/></entry>
102 fjp 32424 </row><row condition="supports-floppy-boot">
103     <entry>floppy based (net-drivers)</entry>
104     <entry>yes</entry>
105     <entry>no</entry>
106     <entry>yes</entry>
107     </row><row arch="s390">
108     <entry>generic/tape</entry>
109     <entry>yes</entry>
110     <entry>no</entry>
111     <entry>yes</entry>
112     </row>
113     </tbody>
114    
115     </tgroup></informaltable>
116    
117     </para><para>
118    
119     An important difference between the preseeding methods is the point at which
120 fjp 36205 the preconfiguration file is loaded and processed. For initrd preseeding
121 fjp 32424 this is right at the start of the installation, before the first question is
122 joeyh 32501 even asked. For file preseeding this is after the CD or CD image has been
123 fjp 32424 loaded. For network preseeding it is only after the network has been
124     configured.
125    
126     </para><para>
127    
128 joeyh 42364 Obviously, any questions that have been processed before the
129     preconfiguration file is loaded cannot be preseeded (this will include
130     questions that are only displayed at medium or low priority, like the
131     first hardware detection run). <xref linkend="preseed-bootparms"/>
132     offers a way to avoid these questions being asked.
133 fjp 32424
134     </para><para>
135    
136 joeyh 42364 In order to avoid the questions that would normally appear before the
137 fjp 42374 preseeding occurs, you can start the installer in <quote>auto</quote>
138     mode. This delays questions that would normally be asked too early for
139     preseeding (i.e. language, country and keyboard selection) until after
140     the network comes up, thus allowing them to be preseeded. It also runs
141 fjp 44535 the installation at critical priority, which avoids many unimportant
142 fjp 42374 questions. See <xref linkend="preseed-auto"/> for details.
143 fjp 32424
144     </para>
145     </sect2>
146    
147     <sect2 id="preseed-limitations">
148     <title>Limitations</title>
149     <para>
150    
151 joeyh 32501 Although most questions used by &d-i; can be preseeded using this method,
152     there are some notable exceptions. You must (re)partition an entire disk
153 fjp 32424 or use available free space on a disk; it is not possible to use existing
154 fjp 42250 partitions.
155 fjp 32424
156     </para>
157     </sect2>
158    
159 fjp 32504 <!-- Joeyh feels this is too technical, so leave it out for now
160 fjp 32424 <sect2 id="preseed-debconf">
161     <title>Debconf basics</title>
162     <para>
163    
164     Preseeding makes use of the <classname>debconf</classname> framework. This
165     framework is the preferred mechanism used in Debian to interact with the user
166     when configuring packages and also forms the heart of &d-i;.
167     In the <classname>debconf</classname> framework questions or dialogs are
168     based on <firstterm>templates</firstterm>. There are different types of
169     templates for different types of questions. The actual questions are
170     <quote>generated</quote> from templates at runtime; multiple questions can
171     use the same template.
172    
173     </para><para>
174    
175     The following types of templates are relevant for preseeding.
176    
177 fjp 36269 </para>
178    
179 fjp 42377 <itemizedlist spacing="compact">
180 fjp 32199 <listitem><para>
181 fjp 32424 string: allows the user to type any value
182 fjp 32199 </para></listitem>
183     <listitem><para>
184 fjp 32424 password: similar to string but the value typed is not displayed
185 fjp 32199 </para></listitem>
186     <listitem><para>
187 fjp 32424 boolean: for yes/no or true/false type of questions
188 fjp 32199 </para></listitem>
189     <listitem><para>
190 fjp 32424 select: allows the user to select one option from a list
191 fjp 32199 </para></listitem>
192     <listitem><para>
193 fjp 32424 multiselect: allows the user to select zero, one or more options from a list
194 fjp 32199 </para></listitem>
195     <listitem><para>
196 fjp 32424 note: used to display a message
197 fjp 32199 </para></listitem>
198     </itemizedlist>
199    
200 fjp 36269 <para>
201 fjp 32424
202     In &d-i; templates are stored in a readable file
203 joeyh 32501 <filename>/var/cache/debconf/templates.dat</filename>. This file contains all fixed
204 fjp 32424 text and all translations. It can also contain a default value for the
205     template. The fixed text can include variables that will be replaced at
206     runtime.
207    
208     </para><para>
209    
210 joeyh 32501 Another readable file <filename>/var/cache/debconf/questions.dat</filename>
211     is used to store the values for variables and the answers given to questions.
212 fjp 32424 A question always refers to the template used to ask it. For obvious
213 joeyh 37231 security reasons the values for questions of type <quote>password</quote>
214 fjp 32424 are stored in a separate, non-readable file in the same directory.
215    
216     </para>
217     </sect2>
218 fjp 32504 -->
219 fjp 32276 </sect1>
220 fjp 32199
221 fjp 42374
222 fjp 32276 <sect1 id="preseed-using">
223 fjp 32199 <title>Using preseeding</title>
224 fjp 32424 <para>
225 fjp 32199
226 fjp 42374 You will first need to create a preconfiguration file and place it in
227     the location from where you want to use it. Creating the preconfiguration file
228     is covered later in this appendix. Putting it in the correct location is fairly
229     straightforward for network preseeding or if you want to read the file off
230     a floppy or usb-stick. If you want to include the file on a CD or DVD, you
231     will have to remaster the ISO image. How to get the preconfiguration file
232     included in the initrd is outside the scope of this document; please consult
233     the developers' documentation for &d-i;.
234 fjp 32424
235 fjp 32504 </para><para>
236    
237 fjp 36205 An example preconfiguration file that you can use as basis for your own
238     preconfiguration file is available from &urlset-example-preseed;. This file is
239     based on the configuration fragments included in this appendix.
240 fjp 32504
241 fjp 32424 </para>
242    
243 fjp 32276 <sect2 id="preseed-loading">
244 fjp 36205 <title>Loading the preconfiguration file</title>
245 fjp 32199 <para>
246    
247 fjp 32424 If you are using initrd preseeding, you only have to make sure a file named
248 fjp 32199 <filename>preseed.cfg</filename> is included in the root directory of the
249     initrd. The installer will automatically check if this file is present and
250     load it.
251    
252     </para><para>
253    
254 joeyh 35032 For the other preseeding methods you need to tell the installer what file
255     to use when you boot it. This is normally done by passing the kernel a boot
256     parameter, either manually at boot time or by editing the bootloader
257     configuration file (e.g. <filename>syslinux.cfg</filename>) and adding the
258     parameter to the end of the append line(s) for the kernel.
259 fjp 32199
260     </para><para>
261    
262 fjp 36205 If you do specify the preconfiguration file in the bootloader configuration,
263     you might change the configuration so you don't need to hit enter to boot the
264     installer. For syslinux this means setting the timeout to <literal>1</literal>
265     in <filename>syslinux.cfg</filename>.
266 fjp 32199
267     </para><para>
268    
269 fjp 36205 To make sure the installer gets the right preconfiguration file, you can
270     optionally specify a checksum for the file. Currently this needs to be a
271     md5sum, and if specified it must match the preconfiguration file or the
272     installer will refuse to use it.
273 fjp 32199
274     </para>
275    
276     <informalexample><screen>
277 fjp 32424 Boot parameters to specify:
278     - if you're netbooting:
279     preseed/url=http://host/path/to/preseed.cfg
280     preseed/url/checksum=5da499872becccfeda2c4872f9171c3d
281    
282     - if you're booting a remastered CD:
283     preseed/file=/cdrom/preseed.cfg
284     preseed/file/checksum=5da499872becccfeda2c4872f9171c3d
285    
286 fjp 36205 - if you're installing from USB media (put the preconfiguration file in the
287 fjp 32424 toplevel directory of the USB stick):
288     preseed/file=/hd-media/preseed.cfg
289     preseed/file/checksum=5da499872becccfeda2c4872f9171c3d
290 fjp 32199 </screen></informalexample>
291    
292     <para>
293    
294 joeyh 38231 Note that <filename>preseed/url</filename> can be shortened to just
295     <filename>url</filename> and <filename>preseed/file</filename> to just
296 joeyh 38242 <filename>file</filename> when they are passed as boot parameters.
297 joeyh 38231
298 joeyh 42364 </para>
299     </sect2>
300    
301     <sect2 id="preseed-bootparms">
302 fjp 42982 <title>Using boot parameters to preseed questions</title>
303 joeyh 42364 <para>
304    
305     If a preconfiguration file cannot be used to preseed some steps, the
306     install can still be fully automated, since you can pass preseed values on
307 fjp 42982 the command line when booting the installer.
308 joeyh 42364
309 joeyh 38231 </para><para>
310    
311 fjp 42982 Boot parameters can also be used if you do not really want to use preseeding,
312     but just want to provide an answer for a specific question. Some examples where
313     this can be useful are documented elsewhere in this manual.
314    
315     </para><para>
316    
317     To set a value to be used inside &d-i;, just pass
318     <userinput><replaceable>path/to/variable</replaceable>=<replaceable>value</replaceable></userinput>
319     for any of the preseed variables listed in the examples in this appendix.
320     If a value is to be used to configure packages for the target system, you
321 fjp 43525 will need to prepend the <firstterm>owner</firstterm><footnote>
322    
323     <para>
324     The owner of a debconf variable (or template) is normally the name of the
325     package that contains the corresponding debconf template. For variables
326     used in the installer itself the owner is <quote>d-i</quote>.
327     Templates and variables can have more than one owner which helps to
328     determine whether they can be removed from the debconf database if the
329     package is purged.
330     </para>
331    
332     </footnote> of the variable as in
333 fjp 42982 <userinput><replaceable>owner</replaceable>:<replaceable>path/to/variable</replaceable>=<replaceable>value</replaceable></userinput>.
334     If you don't specify the owner, the value for the variable will not be
335     copied to the debconf database in the target system and thus remain unused
336     during the configuration of the relevant package.
337    
338     </para><para>
339    
340 fjp 48423 Normally, preseeding a question in this way will mean that the question will
341     not be asked. To set a specific default value for a question, but still have
342     the question asked, use <quote>?=</quote> instead of <quote>=</quote> as
343     operator. See also <xref linkend="preseed-seenflag"/>.
344    
345     </para><para>
346    
347 joeyh 42364 Note that some variables that are frequently set at the boot prompt
348     have a shorter alias. If an alias is available, it is used in the
349 fjp 48423 examples in this appendix instead of the full variable. The
350     <literal>preseed/url</literal> variable for example has been aliased as
351     <literal>url</literal>. Another example is the <literal>tasks</literal>
352 fjp 42982 alias, which translates to <literal>tasksel:tasksel/first</literal>.
353 fjp 32199
354 joeyh 42364 </para><para>
355    
356     A <quote>--</quote> in the boot options has special meaning. Kernel
357     parameters that appear after the last <quote>--</quote> may be copied
358     into the bootloader configuration for the installed system (if supported by
359     the installer for the bootloader). The installer will automatically filter
360     out any options (like preconfiguration options) that it recognizes.
361    
362 fjp 32199 </para>
363 joeyh 42364 <note><para>
364    
365     Current linux kernels (2.6.9 and later) accept a maximum of 32 command line
366     options and 32 environment options, including any options added by default
367     for the installer. If these numbers are exceeded, the kernel will panic
368     (crash). (For earlier kernels, these numbers were lower.)
369    
370     </para></note>
371     <para>
372    
373     For most installations some of the default options in your bootloader
374     configuration file, like <literal>vga=normal</literal>, may be safely
375     removed which may allow you to add more options for preseeding.
376    
377     </para>
378     <note><para>
379    
380     It may not always be possible to specify values with spaces for boot
381     parameters, even if you delimit them with quotes.
382    
383     </para></note>
384 fjp 32276 </sect2>
385 joeyh 35032
386 joeyh 42364 <sect2 id="preseed-auto">
387     <title>Auto mode</title>
388     <para>
389    
390 fjp 42374 There are several features of Debian Installer that combine to allow
391 joeyh 42364 fairly simple command lines at the boot prompt to result in
392 fjp 42374 arbitrarily complex customized automatic installs. To illustrate
393 joeyh 42364 this, here are some examples that can be used at the boot prompt:
394    
395     <informalexample><screen>
396 fjp 42374 auto url=autoserver
397 joeyh 42364 </screen></informalexample>
398    
399     This relies on there being a DHCP server that will get the machine to
400     the point where <literal>autoserver</literal> can be resolved by DNS,
401     perhaps after adding the local domain if that was provided by DHCP.
402     If this was done at a site where the domain is
403     <literal>example.com</literal>, and they have a reasonably sane DHCP
404     setup, it would result in the preseed file being retrieved from
405     <literal>http://autoserver.example.com/d-i/etch/./preseed.cfg</literal>.
406 fjp 42374
407     </para><para>
408    
409 fjp 43525 The last part of that url (<literal>d-i/etch/./preseed.cfg</literal>)
410     is taken from <literal>auto-install/defaultroot</literal>. By default
411     this includes the directory <literal>etch</literal> to allow future versions
412     to specify their own codename and let people migrate forwards in a
413 joeyh 42364 controlled manner. The <literal>/./</literal> bit is used to indicate
414 fjp 43525 a root, relative to which subsequent paths can be anchored (for use in
415 fjp 42374 preseed/include and preseed/run). This allows files to be specified
416 joeyh 42364 either as full URLs, paths starting with / that are thus anchored, or
417     even paths relative to the location where the last preseed file was
418     found. This can be used to construct more portable scripts where an
419     entire hierarchy of scripts can be moved to a new location without
420     breaking it, for example copying the files onto a USB stick when they
421     started out on a web server. In this example, if the preseed file
422     sets <literal>preseed/run</literal> to
423     <literal>/scripts/late_command.sh</literal> then the file will be
424     fetched from
425     <literal>http://autoserver.example.com/d-i/etch/./scripts/late_command.sh</literal>.
426    
427     </para><para>
428    
429 fjp 43525 If there is no local DHCP or DNS infrastructure, or if you do not want to
430     use the default path to <filename>preseed.cfg</filename>, you can still
431 joeyh 42364 use an explicit url, and if you don't use the <literal>/./</literal>
432 fjp 43525 element it will be anchored to the start of the path (i.e. the third
433     <literal>/</literal> in the URL). Here is an example that requires minimal
434     support from the local network infrastructure:
435 joeyh 42364
436     <informalexample><screen>
437 fjp 42374 auto url=<replaceable>http://192.168.1.2/path/to/mypreseed.file</replaceable>
438 joeyh 42364 </screen></informalexample>
439    
440 fjp 42374 The way this works is that:
441 fjp 42377 <itemizedlist spacing="compact">
442     <listitem><para>
443 fjp 42374 if the URL is missing a protocol, http is assumed,
444 fjp 42377 </para></listitem>
445     <listitem><para>
446     if the hostname section contains no periods, it has the domain derived
447     from DHCP appended to it, and
448     </para></listitem>
449     <listitem><para>
450 fjp 42374 if there's no <literal>/</literal>'s after the hostname, then the default
451     path is added.
452 fjp 42377 </para></listitem>
453 fjp 42374 </itemizedlist>
454 joeyh 42364
455     </para><para>
456    
457     In addition to specifying the url, you can also specify settings that
458 fjp 42374 do not directly affect the behavior of &d-i; itself, but can be passed
459 fjp 43525 through to scripts specified using <literal>preseed/run</literal>
460     in the loaded preseed file. At present, the only example of
461 fjp 42374 this is <literal>auto-install/classes</literal>, which has an alias
462     <literal>classes</literal>. This can be used thus:
463 joeyh 42364
464     <informalexample><screen>
465 fjp 42377 auto url=<replaceable>example.com</replaceable> classes=<replaceable>class_A;class_B</replaceable>
466 joeyh 42364 </screen></informalexample>
467    
468 fjp 42377 The classes could for example denote the type of system to be installed,
469     or the localization to be used.
470    
471     </para><para>
472    
473     It is of course possible to extend this concept, and if you do, it is
474     reasonable to use the auto-install namespace for this. So one might have
475 fjp 42374 something like <literal>auto-install/style</literal> which is then used
476     in your scripts. If you feel the need to do this, please mention it on
477     the <email>debian-boot@lists.debian.org</email> mailing list so that we
478 philh 42376 can avoid namespace conflicts, and perhaps add an alias for the parameter
479 fjp 42374 for you.
480 joeyh 42364
481     </para><para>
482    
483     The <literal>auto</literal> boot label is not yet defined on all
484 fjp 42374 architectures. The same effect may be achieved by simply adding the two
485     parameters <literal>auto=true priority=critical</literal> to the kernel
486     command line. The <literal>auto</literal> parameter is an alias for
487 fjp 44897 <literal>auto-install/enable</literal> and controls the delay of the
488 joeyh 42364 locale and keyboard questions until after there has been a chance to
489     preseed them, while <literal>priority</literal> is an alias for
490 fjp 45355 <literal>debconf/priority</literal> and setting it to
491 joeyh 42364 <literal>critical</literal> stops any questions with a lower priority
492     from being asked.
493    
494     </para><para>
495    
496     Additional options that may be of interest while attempting to
497     automate an install while using DHCP are: <literal>interface=auto
498     netcfg/dhcp_timeout=60</literal> which makes the machine choose the
499     first viable NIC and be more patient about getting a reply to its
500     DHCP query.
501    
502     </para>
503 fjp 45349 <tip><para>
504    
505     An extensive example of how to use this framework, including example scripts
506     and classes, can be found on the <ulink url="http://hands.com/d-i/">website
507     of its developer</ulink>. The examples available there also show many other
508     nice effects that can be achieved by creative use of preconfiguration.
509    
510     </para></tip>
511 joeyh 42364 </sect2>
512 fjp 42377
513     <sect2 id="preseed-aliases">
514     <title>Aliases useful with preseeding</title>
515     <para>
516    
517     The following aliases can be useful when using (auto mode) preseeding.
518    
519     </para>
520    
521     <!-- Setting column width does not seem to work; use non-breaking spaces
522     to separate columns a bit -->
523     <informaltable frame="none">
524     <tgroup cols="2"><tbody>
525 fjp 44897 <row><entry>auto</entry><entry>auto-install/enable</entry></row>
526 fjp 42377 <row><entry>classes</entry><entry>auto-install/classes</entry></row>
527     <row><entry>fb</entry><entry>debian-installer/framebuffer</entry></row>
528     <row><entry>locale</entry><entry>debian-installer/locale</entry></row>
529     <row><entry>priority</entry><entry>debconf/priority</entry></row>
530     <row><entry>file</entry><entry>preseed/file</entry></row>
531     <row><entry>url</entry><entry>preseed/url</entry></row>
532 fjp 43658 <row><entry>interface</entry><entry>netcfg/choose_interface</entry></row>
533 fjp 42377 <row><entry>hostname&nbsp;&nbsp;&nbsp;</entry><entry>netcfg/get_hostname</entry></row>
534     <row><entry>domain</entry><entry>netcfg/get_domain</entry></row>
535 fjp 43658 <row><entry>protocol</entry><entry>mirror/protocol</entry></row>
536 fjp 42377 <row><entry>suite</entry><entry>mirror/suite</entry></row>
537     </tbody></tgroup>
538     </informaltable>
539    
540     </sect2>
541 joeyh 42364
542 joeyh 35032 <sect2 id="preseed-dhcp">
543 fjp 36205 <title>Using a DHCP server to specify preconfiguration files</title>
544 joeyh 35032 <para>
545 fjp 32199
546 fjp 36205 It's also possible to use DHCP to specify a preconfiguration file to download
547     from the network. DHCP allows specifying a filename. Normally this is a file
548     to netboot, but if it appears to be an URL then installation media that
549     support network preseeding will download the file from the URL and use it as a
550     preconfiguration file. Here is an example of how to set it up in the dhcpd.conf
551 joeyh 35032 for version 3 of the ISC DHCP server (the dhcp3-server Debian package).
552    
553     </para>
554    
555     <informalexample><screen>
556     if substring (option vendor-class-identifier, 0, 3) = "d-i" {
557 fjp 36204 filename "http://host/preseed.cfg";
558 joeyh 35032 }
559     </screen></informalexample>
560    
561     <para>
562 fjp 35033
563 joeyh 35032 Note that the above example limits this filename to DHCP clients that identify
564     themselves as "d-i", so it will not affect regular DHCP clients, but only
565     the installer. You can also put the text in a stanza for only one particular
566     host to avoid preseeding all installs on your network.
567    
568     </para><para>
569 fjp 35033
570 joeyh 35032 A good way to use the DHCP preseeding is to only preseed values specific to
571     your network, such as the Debian mirror to use. This way installs on your
572     network will automatically get a good mirror selected, but the rest of the
573     installation can be performed interactively. Using DHCP preseeding to fully
574     automate Debian installs should only be done with care.
575 fjp 35033
576 joeyh 35032 </para>
577 fjp 35051 </sect2>
578 fjp 32276 </sect1>
579 fjp 32199
580 fjp 42374
581 fjp 36204 <sect1 id="preseed-creating">
582 fjp 36205 <title>Creating a preconfiguration file</title>
583 fjp 32424 <para>
584 fjp 32199
585 fjp 32424 The preconfiguration file is in the format used by the
586 fjp 36204 <command>debconf-set-selections</command> command. The general format of
587     a line in a preconfiguration file is:
588 fjp 32424
589 fjp 36204 <informalexample><screen>
590 holger-guest 37282 &lt;owner&gt; &lt;question name&gt; &lt;question type&gt; &lt;value&gt;
591 fjp 36204 </screen></informalexample>
592 fjp 32424
593 fjp 36204 </para><para>
594    
595     There are a few rules to keep in mind when writing a preconfiguration file.
596    
597 fjp 36267 </para>
598    
599 fjp 32199 <itemizedlist>
600 fjp 36267 <listitem><para>
601 fjp 36204 Put only a single space or tab between type and value: any additional
602     whitespace will be interpreted as belonging to the value.
603 fjp 36267 </para></listitem>
604     <listitem><para>
605 fjp 36204 A line can be split into multiple lines by appending a backslash
606 fjp 36214 (<quote><literal>\</literal></quote>) as the line continuation character.
607 joeyh 37231 A good place to split a line is after the question name; a bad place is
608 fjp 36204 between type and value.
609 fjp 36267 </para></listitem>
610     <listitem><para>
611 joeyh 37231 Most questions need to be preseeded using the values valid in English and
612     not the translated values. However, there are some questions (for example
613 tale 40409 in <classname>partman</classname>) where the translated values need to be
614 fjp 36204 used.
615 fjp 36267 </para></listitem>
616     <listitem><para>
617 joeyh 37231 Some questions take a code as value instead of the English text that is
618 fjp 36204 shown during installation.
619 fjp 36267 </para></listitem>
620 fjp 32199 </itemizedlist>
621    
622 fjp 36267 <para>
623 fjp 36204
624     The easiest way to create a preconfiguration file is to use the example file
625     linked in <xref linkend="preseed-contents"/> as basis and work from there.
626    
627     </para><para>
628    
629     An alternative method is to do a manual installation and then, after
630     rebooting, use the <command>debconf-get-selections</command> from the
631     <classname>debconf-utils</classname> package to dump both the debconf
632     database and the installer's cdebconf database to a single file:
633    
634     <informalexample><screen>
635     $ debconf-get-selections --installer &gt; <replaceable>file</replaceable>
636     $ debconf-get-selections &gt;&gt; <replaceable>file</replaceable>
637     </screen></informalexample>
638    
639     </para><para>
640    
641     However, a file generated in this manner will have some items that should
642     not be preseeded, and the example file is a better starting place for most
643     users.
644    
645     </para>
646    
647     <note><para>
648    
649     This method relies on the fact that, at the end of the installation, the
650     installer's cdebconf database is saved to the installed system in
651     <filename>/var/log/installer/cdebconf</filename>. However, because the
652     database may contain sensitive information, by default the files are only
653     readable by root.
654    
655     </para><para>
656    
657     The directory <filename>/var/log/installer</filename> and all files in it
658     will be deleted from your system if you purge the package
659     <classname>installation-report</classname>.
660    
661     </para></note>
662    
663 fjp 32199 <para>
664    
665 joeyh 37231 To check possible values for questions, you can use <command>nano</command>
666 fjp 36204 to examine the files in <filename>/var/lib/cdebconf</filename> while an
667     installation is in progress. View <filename>templates.dat</filename> for
668     the raw templates and <filename>questions.dat</filename> for the current
669     values and for the values assigned to variables.
670    
671     </para><para>
672    
673 fjp 36205 To check if the format of your preconfiguration file is valid before performing
674     an install, you can use the command <command>debconf-set-selections -c
675 fjp 32276 <replaceable>preseed.cfg</replaceable></command>.
676    
677 fjp 32199 </para>
678 fjp 32276 </sect1>
679 fjp 32199
680 fjp 42374
681 joeyh 33719 <sect1 id="preseed-contents">
682 fjp 52853 <title>Contents of the preconfiguration file (for &releasename;)</title>
683 fjp 32199 <para>
684    
685     The configuration fragments used in this appendix are also available as an
686 fjp 36205 example preconfiguration file from &urlset-example-preseed;.
687 fjp 32199
688     </para><para>
689    
690     Note that this example is based on an installation for the Intel x86
691     architecture. If you are installing a different architecture, some of the
692     examples (like keyboard selection and bootloader installation) may not be
693 fjp 36205 relevant and will need to be replaced by debconf settings appropriate for
694     your architecture.
695 fjp 32199
696     </para>
697    
698 fjp 32276 <sect2 id="preseed-l10n">
699 fjp 32199 <title>Localization</title>
700     <para>
701    
702     Setting localization values will only work if you are using initrd preseeding.
703 fjp 36205 With all other methods the preconfiguration file will only be loaded after
704     these questions have been asked.
705 fjp 32199
706     </para><para>
707    
708     The locale can be used to specify both language and country.
709     To specify the locale as a boot parameter, use
710 joeyh 38231 <userinput>locale=<replaceable>en_US</replaceable></userinput>.
711 fjp 32199
712 fjp 32424 <informalexample role="example"><screen>
713 fjp 32199 # Locale sets language and country.
714     d-i debian-installer/locale string en_US
715     </screen></informalexample>
716    
717     </para><para>
718    
719 fjp 32276 Keyboard configuration consists of selecting a keyboard architecture and a
720     keymap. In most cases the correct keyboard architecture is selected by
721 joeyh 32501 default, so there's normally no need to preseed it. The keymap must
722     be valid for the selected keyboard architecture.
723 fjp 32199
724 fjp 32424 <informalexample role="example"><screen>
725     # Keyboard selection.
726     #d-i console-tools/archs select at
727     d-i console-keymaps-at/keymap select us
728     # Example for a different keyboard architecture
729     #d-i console-keymaps-usb/keymap select mac-usb-us
730     </screen></informalexample>
731    
732 fjp 32276 </para><para>
733    
734 fjp 36205 To skip keyboard configuration, preseed
735 fjp 32276 <classname>console-tools/archs</classname> with
736     <userinput>skip-config</userinput>.
737     This will result in the kernel keymap remaining active.
738    
739     </para>
740    
741     <note><para>
742 fjp 32199
743 fjp 32276 The changes in the input layer for 2.6 kernels have made the keyboard
744     architecture virtually obsolete. For 2.6 kernels normally a <quote>PC</quote>
745     (<userinput>at</userinput>) keymap should be selected.
746    
747     </para></note>
748     </sect2>
749    
750     <sect2 id="preseed-network">
751 fjp 32199 <title>Network configuration</title>
752     <para>
753    
754     Of course, preseeding the network configuration won't work if you're
755 fjp 36205 loading your preconfiguration file from the network. But it's great when
756     you're booting from CD or USB stick. If you are loading preconfiguration
757     files from the network, you can pass network config parameters by using
758     kernel boot parameters.
759 fjp 32199
760 cjwatson 33890 </para><para>
761 fjp 32200
762 cjwatson 33890 If you need to pick a particular interface when netbooting before loading
763 fjp 36205 a preconfiguration file from the network, use a boot parameter such as
764 joeyh 38231 <userinput>interface=<replaceable>eth1</replaceable></userinput>.
765 cjwatson 33890
766 fjp 38662 </para><para>
767    
768     Although preseeding the network configuration is normally not possible when
769     using network preseeding (using <quote>preseed/url</quote>), you can use
770     the following hack to work around that, for example if you'd like to set a
771     static address for the network interface. The hack is to force the network
772     configuration to run again after the preconfiguration file has been loaded
773     by creating a <quote>preseed/run</quote> script containing the following
774 fjp 52829 commands:
775 fjp 38662
776     <informalexample><screen>
777 fjp 52821 killall.sh; netcfg
778 fjp 38662 </screen></informalexample>
779    
780 fjp 52824 </para><para>
781    
782     The following debconf variables are relevant for network configuration.
783    
784 cjwatson 33891 </para>
785    
786 fjp 32424 <informalexample role="example"><screen>
787 fjp 32199 # netcfg will choose an interface that has link if possible. This makes it
788     # skip displaying a list if there is more than one interface.
789     d-i netcfg/choose_interface select auto
790    
791 cjwatson 33890 # To pick a particular interface instead:
792     #d-i netcfg/choose_interface select eth1
793    
794 fjp 32199 # If you have a slow dhcp server and the installer times out waiting for
795     # it, this might be useful.
796     #d-i netcfg/dhcp_timeout string 60
797    
798 joeyh 34168 # If you prefer to configure the network manually, uncomment this line and
799     # the static network configuration below.
800 fjp 32199 #d-i netcfg/disable_dhcp boolean true
801 joeyh 34168
802 fjp 36205 # If you want the preconfiguration file to work on systems both with and
803     # without a dhcp server, uncomment these lines and the static network
804     # configuration below.
805 joeyh 34168 #d-i netcfg/dhcp_failed note
806     #d-i netcfg/dhcp_options select Configure network manually
807    
808     # Static network configuration.
809 fjp 32199 #d-i netcfg/get_nameservers string 192.168.1.1
810     #d-i netcfg/get_ipaddress string 192.168.1.42
811     #d-i netcfg/get_netmask string 255.255.255.0
812     #d-i netcfg/get_gateway string 192.168.1.1
813     #d-i netcfg/confirm_static boolean true
814    
815     # Any hostname and domain names assigned from dhcp take precedence over
816     # values set here. However, setting the values still prevents the questions
817     # from being shown, even if values come from dhcp.
818     d-i netcfg/get_hostname string unassigned-hostname
819     d-i netcfg/get_domain string unassigned-domain
820    
821     # Disable that annoying WEP key dialog.
822     d-i netcfg/wireless_wep string
823     # The wacky dhcp hostname that some ISPs use as a password of sorts.
824     #d-i netcfg/dhcp_hostname string radish
825     </screen></informalexample>
826    
827 fjp 32276 </sect2>
828 fjp 32199
829 fjp 32276 <sect2 id="preseed-mirror">
830 fjp 32199 <title>Mirror settings</title>
831     <para>
832    
833 fjp 43576 Depending on the installation method you use, a mirror may be used to
834     download additional components of the installer, to install the base system,
835     and to set up the <filename>/etc/apt/sources.list</filename> for the installed
836 fjp 32199 system.
837    
838     </para><para>
839    
840     The parameter <classname>mirror/suite</classname> determines the suite for
841     the installed system.
842    
843     </para><para>
844    
845     The parameter <classname>mirror/udeb/suite</classname> determines the suite
846     for additional components for the installer. It is only useful to set this
847     if components are actually downloaded over the network and should match the
848     suite that was used to build the initrd for the installation method used for
849     the installation.
850 fjp 36205 By default the value for <classname>mirror/udeb/suite</classname> is the
851     same as <classname>mirror/suite</classname>.
852 fjp 32199
853     </para>
854    
855 fjp 32424 <informalexample role="example"><screen>
856 fjp 45612 # If you select ftp, the mirror/country string does not need to be set.
857 fjp 49849 #d-i mirror/protocol string ftp
858     d-i mirror/country string manual
859 fjp 44410 d-i mirror/http/hostname string &archive-mirror;
860 fjp 32199 d-i mirror/http/directory string /debian
861     d-i mirror/http/proxy string
862    
863     # Suite to install.
864     #d-i mirror/suite string testing
865     # Suite to use for loading installer components (optional).
866     #d-i mirror/udeb/suite string testing
867     </screen></informalexample>
868    
869 fjp 32276 </sect2>
870 fjp 32199
871 fjp 50731 <sect2 id="preseed-time">
872     <title>Clock and time zone setup</title>
873    
874     <informalexample role="example"><screen>
875     # Controls whether or not the hardware clock is set to UTC.
876     d-i clock-setup/utc boolean true
877    
878     # You may set this to any valid setting for $TZ; see the contents of
879     # /usr/share/zoneinfo/ for valid values.
880     d-i time/zone string US/Eastern
881    
882     # Controls whether to use NTP to set the clock during the install
883     d-i clock-setup/ntp boolean true
884     # NTP server to use. The default is almost always fine here.
885     #d-i clock-setup/ntp-server ntp.example.com
886     </screen></informalexample>
887    
888     </sect2>
889    
890 fjp 32276 <sect2 id="preseed-partman">
891 fjp 32199 <title>Partitioning</title>
892 fjp 32276 <para>
893 fjp 32199
894 fjp 32276 Using preseeding to partition the harddisk is very much limited to what is
895 fjp 43576 supported by <classname>partman-auto</classname>. You can choose to partition
896     either existing free space on a disk or a whole disk. The layout of the
897 fjp 32276 disk can be determined by using a predefined recipe, a custom recipe from
898 fjp 36205 a recipe file or a recipe included in the preconfiguration file. It is
899 fjp 42250 currently not possible to partition multiple disks using preseeding.
900 fjp 32276
901     </para>
902    
903     <warning><para>
904    
905     The identification of disks is dependent on the order in which their drivers
906     are loaded. If there are multiple disks in the system, make very sure the
907     correct one will be selected before using preseeding.
908    
909     </para></warning>
910    
911 fjp 32424 <informalexample role="example"><screen>
912 fjp 32199 # If the system has free space you can choose to only partition that space.
913 joeyh 37231 # Note: this must be preseeded with a localized (translated) value.
914 fjp 32199 #d-i partman-auto/init_automatically_partition \
915 fjp 42036 # select Guided - use the largest continuous free space
916 fjp 32199
917 cjwatson 48588 # Alternatively, you can specify a disk to partition. The device name must
918     # be given in traditional non-devfs format.
919     # For example, to use the first SCSI/SATA hard disk:
920 joeyh 48960 d-i partman-auto/disk string /dev/sda
921     # Note: If you want to use whatever disk is available, no matter
922     # what its device name, comment the line above out. This will only work if
923 fjp 49849 # the system only has one disk.
924 alphix-guest 40397 # In addition, you'll need to specify the method to use.
925     # The presently available methods are: "regular", "lvm" and "crypto"
926     d-i partman-auto/method string lvm
927 fjp 32199
928 alphix-guest 40397 # If one of the disks that are going to be automatically partitioned
929     # contains an old LVM configuration, the user will normally receive a
930     # warning. This can be preseeded away...
931 fjp 52902 d-i partman-lvm/device_remove_lvm boolean true
932 fjp 41531 # And the same goes for the confirmation to write the lvm partitions.
933     d-i partman-lvm/confirm boolean true
934 alphix-guest 40397
935 fjp 35039 # You can choose from any of the predefined partitioning recipes.
936 joeyh 37231 # Note: this must be preseeded with a localized (translated) value.
937 fjp 32199 d-i partman-auto/choose_recipe \
938     select All files in one partition (recommended for new users)
939     #d-i partman-auto/choose_recipe \
940     # select Separate /home partition
941     #d-i partman-auto/choose_recipe \
942     # select Separate /home, /usr, /var, and /tmp partitions
943    
944     # Or provide a recipe of your own...
945     # The recipe format is documented in the file devel/partman-auto-recipe.txt.
946     # If you have a way to get a recipe file into the d-i environment, you can
947     # just point at it.
948     #d-i partman-auto/expert_recipe_file string /hd-media/recipe
949    
950 fjp 42036 # If not, you can put an entire recipe into the preconfiguration file in one
951 fjp 36205 # (logical) line. This example creates a small /boot partition, suitable
952     # swap, and uses the rest of the space for the root partition:
953 fjp 32199 #d-i partman-auto/expert_recipe string \
954     # boot-root :: \
955     # 40 50 100 ext3 \
956     # $primary{ } $bootable{ } \
957     # method{ format } format{ } \
958     # use_filesystem{ } filesystem{ ext3 } \
959     # mountpoint{ /boot } \
960     # . \
961     # 500 10000 1000000000 ext3 \
962     # method{ format } format{ } \
963     # use_filesystem{ } filesystem{ ext3 } \
964     # mountpoint{ / } \
965     # . \
966     # 64 512 300% linux-swap \
967     # method{ swap } format{ } \
968     # .
969    
970 cjwatson 50443 # This makes partman automatically partition without confirmation, provided
971     # that you told it what to do using one of the methods above.
972 fjp 32199 d-i partman/confirm_write_new_label boolean true
973     d-i partman/choose_partition \
974     select Finish partitioning and write changes to disk
975     d-i partman/confirm boolean true
976     </screen></informalexample>
977    
978 fjp 32276 </sect2>
979 fjp 32199
980 fjp 41551 <sect2 id="preseed-partman-raid">
981     <title>Partitioning using RAID</title>
982     <para>
983    
984     You can also use preseeding to set up partitions on software RAID arrays.
985     Supported are RAID levels 0, 1 and 5, creating degraded arrays and
986     specifying spare devices.
987     If you are using RAID 1, you can preseed grub to install to all devices
988     used in the array; see <xref linkend="preseed-bootloader"/>.
989    
990     </para>
991    
992     <warning><para>
993    
994     This type of automated partitioning is easy to get wrong. It is also a
995     very new component that may still have some bugs or missing error
996     handling. The responsibility to get the various recipes right (so they
997     make sense and don't conflict) lies with the user.
998     Check <filename>/var/log/syslog</filename> if you run into problems.
999    
1000     </para><para>
1001    
1002     Note that only RAID 0 and RAID 1 have been tested by the developers of the
1003     component. RAID 5 is untested. Advanced RAID setup with degraded arrays or
1004     spare devices has only been tested lightly.
1005    
1006     </para></warning>
1007    
1008     <informalexample><screen>
1009     # NOTE: this option is of beta release quality and should be used carefully
1010    
1011     # The method should be set to "raid".
1012     #d-i partman-auto/method string raid
1013     # Specify the disks to be partitioned. They will all get the same layout,
1014     # so this will only work if the disks are the same size.
1015     #d-i partman-auto/disk string /dev/discs/disc0/disc /dev/discs/disc1/disc
1016    
1017     # Next you need to specify the physical partitions that will be used.
1018     #d-i partman-auto/expert_recipe string \
1019     # multiraid :: \
1020     # 1000 5000 4000 raid \
1021     # $primary{ } method{ raid } \
1022     # . \
1023     # 64 512 300% raid \
1024     # method{ raid } \
1025     # . \
1026     # 500 10000 1000000000 raid \
1027     # method{ raid } \
1028     # .
1029    
1030     # Last you need to specify how the previously defined partitions will be
1031     # used in the RAID setup. Remember to use the correct partition numbers
1032     # for logical partitions.
1033     # Parameters are:
1034 fjp 41587 # &lt;raidtype&gt; &lt;devcount&gt; &lt;sparecount&gt; &lt;fstype&gt; &lt;mountpoint&gt; \
1035     # &lt;devices&gt; &lt;sparedevices&gt;
1036 fjp 41551 # RAID levels 0, 1 and 5 are supported; devices are separated using "#"
1037     #d-i partman-auto-raid/recipe string \
1038     # 1 2 0 ext3 / \
1039     # /dev/discs/disc0/part1#/dev/discs/disc1/part1 \
1040     # . \
1041     # 1 2 0 swap - \
1042     # /dev/discs/disc0/part5#/dev/discs/disc1/part5 \
1043     # . \
1044     # 0 2 0 ext3 /home \
1045     # /dev/discs/disc0/part6#/dev/discs/disc1/part6 \
1046     # .
1047    
1048     # This makes partman automatically partition without confirmation.
1049     d-i partman-md/confirm boolean true
1050     d-i partman/confirm_write_new_label boolean true
1051     d-i partman/choose_partition \
1052     select Finish partitioning and write changes to disk
1053     d-i partman/confirm boolean true
1054     </screen></informalexample>
1055    
1056     </sect2>
1057    
1058 fjp 50731 <sect2 id="preseed-base-installer">
1059     <title>Base system installation</title>
1060     <para>
1061 fjp 32199
1062 fjp 50731 There is actually not very much that can be preseeded for this stage of the
1063     installation. The only questions asked concern the installation of the kernel.
1064    
1065     </para>
1066    
1067 fjp 32424 <informalexample role="example"><screen>
1068 fjp 50731 # Select the initramfs generator used to generate the initrd for 2.6 kernels.
1069     #d-i base-installer/kernel/linux/initramfs-generators string yaird
1070 fjp 32199
1071 fjp 50731 # The kernel image (meta) package to be installed; "none" can be used if no
1072     # kernel is to be installed.
1073 fjp 52424 #d-i base-installer/kernel/image string linux-image-2.6-486
1074 fjp 32199 </screen></informalexample>
1075    
1076 fjp 32276 </sect2>
1077 fjp 32199
1078 fjp 32424 <sect2 id="preseed-account">
1079 fjp 32199 <title>Account setup</title>
1080     <para>
1081    
1082     The password for the root account and name and password for a first regular
1083     user's account can be preseeded. For the passwords you can use either clear
1084     text values or MD5 <emphasis>hashes</emphasis>.
1085    
1086     </para>
1087     <warning><para>
1088    
1089     Be aware that preseeding passwords is not completely secure as everyone
1090 fjp 36205 with access to the preconfiguration file will have the knowledge of these
1091     passwords. Using MD5 hashes is considered slightly better in terms of
1092     security but it might also give a false sense of security as access to a
1093     MD5 hash allows for brute force attacks.
1094 fjp 32199
1095     </para></warning>
1096    
1097 fjp 32424 <informalexample role="example"><screen>
1098 joeyh 36167 # Skip creation of a root account (normal user account will be able to
1099     # use sudo).
1100     #d-i passwd/root-login boolean false
1101     # Alternatively, to skip creation of a normal user account.
1102     #d-i passwd/make-user boolean false
1103    
1104 fjp 32199 # Root password, either in clear text
1105 fjp 33865 #d-i passwd/root-password password r00tme
1106     #d-i passwd/root-password-again password r00tme
1107 fjp 32199 # or encrypted using an MD5 hash.
1108 fjp 33865 #d-i passwd/root-password-crypted password [MD5 hash]
1109 fjp 32199
1110 joeyh 36167 # To create a normal user account.
1111 fjp 33865 #d-i passwd/user-fullname string Debian User
1112     #d-i passwd/username string debian
1113 fjp 32199 # Normal user's password, either in clear text
1114 fjp 33865 #d-i passwd/user-password password insecure
1115     #d-i passwd/user-password-again password insecure
1116 fjp 32199 # or encrypted using an MD5 hash.
1117 fjp 48437 #d-i passwd/user-password-crypted password [MD5 hash]
1118     # Create the first user with the specified UID instead of the default.
1119 fjp 49849 #d-i passwd/user-uid string 1010
1120 joeyh 48007
1121     # The user account will be added to some standard initial groups. To
1122     # override that, use this.
1123 fjp 49849 #d-i passwd/user-default-groups string audio cdrom video
1124 fjp 32199 </screen></informalexample>
1125    
1126     <para>
1127    
1128     The <classname>passwd/root-password-crypted</classname> and
1129 fjp 36205 <classname>passwd/user-password-crypted</classname> variables can also
1130     be preseeded with <quote>!</quote> as their value. In that case, the
1131     corresponding account is disabled. This may be convenient for the root
1132     account, provided of course that an alternative method is setup to allow
1133     administrative activities or root login (for instance by using SSH key
1134     authentication or <command>sudo</command>).
1135 fjp 32199
1136 fjp 32504 </para><para>
1137    
1138     An MD5 hash for a password can be generated using the following command.
1139    
1140     <informalexample><screen>
1141 fjp 52906 $ echo "r00tme" | mkpasswd -s -m md5
1142 fjp 32504 </screen></informalexample>
1143    
1144 fjp 32199 </para>
1145 fjp 32276 </sect2>
1146 fjp 32199
1147 fjp 46792 <sect2 id="preseed-apt">
1148     <title>Apt setup</title>
1149     <para>
1150 fjp 32199
1151 fjp 46792 Setup of the <filename>/etc/apt/sources.list</filename> and basic configuration
1152     options is fully automated based on your installation method and answers to
1153     earlier questions. You can optionally add other (local) repositories.
1154    
1155     </para>
1156    
1157 fjp 32424 <informalexample role="example"><screen>
1158 fjp 46792 # You can choose to install non-free and contrib software.
1159     #d-i apt-setup/non-free boolean true
1160     #d-i apt-setup/contrib boolean true
1161     # Uncomment this if you don't want to use a network mirror.
1162 fjp 49849 #d-i apt-setup/use_mirror boolean false
1163 fjp 48955 # Select which update services to use; define the mirrors to be used.
1164     # Values shown below are the normal defaults.
1165 cjwatson 51570 #d-i apt-setup/services-select multiselect security, volatile
1166 fjp 48955 #d-i apt-setup/security_host string security.debian.org
1167 fjp 49849 #d-i apt-setup/volatile_host string volatile.debian.org
1168 fjp 32199
1169 fjp 46792 # Additional repositories, local[0-9] available
1170     #d-i apt-setup/local0/repository string \
1171     # http://local.server/debian stable main
1172     #d-i apt-setup/local0/comment string local server
1173     # Enable deb-src lines
1174     #d-i apt-setup/local0/source boolean true
1175     # URL to the public key of the local repository; you must provide a key or
1176     # apt will complain about the unauthenticated repository and so the
1177     # sources.list line will be left commented out
1178     #d-i apt-setup/local0/key string http://local.server/key
1179 fjp 32199
1180 fjp 46792 # By default the installer requires that repositories be authenticated
1181     # using a known gpg key. This setting can be used to disable that
1182     # authentication. Warning: Insecure, not recommended.
1183     #d-i debian-installer/allow_unauthenticated string true
1184 fjp 32199 </screen></informalexample>
1185    
1186 fjp 32276 </sect2>
1187 fjp 32199
1188 joeyh 33719 <sect2 id="preseed-pkgsel">
1189 fjp 32199 <title>Package selection</title>
1190 fjp 32276 <para>
1191 fjp 32199
1192 fjp 32276 You can choose to install any combination of tasks that are available.
1193     Available tasks as of this writing include:
1194    
1195 fjp 32424 </para>
1196    
1197 fjp 32276 <itemizedlist>
1198     <listitem><para>
1199 joeyh 36744 <userinput>standard</userinput>
1200 fjp 32276 </para></listitem>
1201     <listitem><para>
1202 joeyh 36744 <userinput>desktop</userinput>
1203 fjp 32276 </para></listitem>
1204     <listitem><para>
1205 joeyh 36744 <userinput>gnome-desktop</userinput>
1206 fjp 32276 </para></listitem>
1207     <listitem><para>
1208 joeyh 36744 <userinput>kde-desktop</userinput>
1209 fjp 32276 </para></listitem>
1210     <listitem><para>
1211 joeyh 36744 <userinput>web-server</userinput>
1212 fjp 32276 </para></listitem>
1213     <listitem><para>
1214 joeyh 36744 <userinput>print-server</userinput>
1215 fjp 32276 </para></listitem>
1216     <listitem><para>
1217 joeyh 36744 <userinput>dns-server</userinput>
1218 fjp 32276 </para></listitem>
1219     <listitem><para>
1220 joeyh 36744 <userinput>file-server</userinput>
1221 fjp 32276 </para></listitem>
1222     <listitem><para>
1223 joeyh 36744 <userinput>mail-server</userinput>
1224 fjp 32276 </para></listitem>
1225 joeyh 36744 <listitem><para>
1226     <userinput>sql-database</userinput>
1227     </para></listitem>
1228     <listitem><para>
1229     <userinput>laptop</userinput>
1230     </para></listitem>
1231 fjp 32276 </itemizedlist>
1232    
1233 fjp 32424 <para>
1234    
1235 joeyh 33719 You can also choose to install no tasks, and force the installation of a
1236     set of packages in some other way. We recommend always including the
1237 joeyh 36744 <userinput>standard</userinput> task.
1238 fjp 32276
1239 fjp 39468 </para><para>
1240 fjp 32276
1241 fjp 39468 If you want to install some individual packages in addition to packages
1242     installed by tasks, you can use the parameter
1243     <classname>pkgsel/include</classname>. The value of this parameter can be
1244 fjp 43580 a list of packages separated by either commas or spaces, which allows it
1245     to be used easily on the kernel command line as well.
1246 cjwatson 39390
1247     </para>
1248    
1249 fjp 32424 <informalexample role="example"><screen>
1250 fjp 49849 #tasksel tasksel/first multiselect standard, web-server
1251 joeyh 46463 # If the desktop task is selected, install the kde and xfce desktops
1252     # instead of the default gnome desktop.
1253 fjp 49849 #tasksel tasksel/desktop multiselect kde, xfce
1254 joeyh 33719
1255 fjp 39468 # Individual additional packages to install
1256 cjwatson 39390 #d-i pkgsel/include string openssh-server build-essential
1257    
1258 joeyh 33719 # Some versions of the installer can report back on what software you have
1259 fjp 33796 # installed, and what software you use. The default is not to report back,
1260 joeyh 33719 # but sending reports helps the project determine what software is most
1261     # popular and include it on CDs.
1262     #popularity-contest popularity-contest/participate boolean false
1263 fjp 32199 </screen></informalexample>
1264    
1265 fjp 32276 </sect2>
1266 fjp 32199
1267 fjp 46792 <sect2 id="preseed-bootloader">
1268     <title>Boot loader installation</title>
1269    
1270     <informalexample role="example"><screen>
1271     # Grub is the default boot loader (for x86). If you want lilo installed
1272     # instead, uncomment this:
1273 fjp 49849 #d-i grub-installer/skip boolean true
1274 joeyh 46819 # To also skip installing lilo, and install no bootloader, uncomment this
1275     # too:
1276 fjp 49849 #d-i lilo-installer/skip boolean true
1277 fjp 46792
1278     # This is fairly safe to set, it makes grub install automatically to the MBR
1279     # if no other operating system is detected on the machine.
1280     d-i grub-installer/only_debian boolean true
1281    
1282     # This one makes grub-installer install to the MBR if it also finds some other
1283     # OS, which is less safe as it might not be able to boot that other OS.
1284     d-i grub-installer/with_other_os boolean true
1285    
1286     # Alternatively, if you want to install to a location other than the mbr,
1287     # uncomment and edit these lines:
1288     #d-i grub-installer/only_debian boolean false
1289     #d-i grub-installer/with_other_os boolean false
1290     #d-i grub-installer/bootdev string (hd0,0)
1291     # To install grub to multiple disks:
1292     #d-i grub-installer/bootdev string (hd0,0) (hd1,0) (hd2,0)
1293 fjp 52901
1294     # Optional password for grub, either in clear text
1295     #d-i grub-installer/password password r00tme
1296     #d-i grub-installer/password-again password r00tme
1297     # or encrypted using an MD5 hash.
1298     #d-i grub-installer/password-crypted password [MD5 hash]
1299 fjp 46792 </screen></informalexample>
1300    
1301     </sect2>
1302    
1303 joeyh 33719 <sect2 id="preseed-finish">
1304 fjp 50744 <title>Finishing up the installation</title>
1305 joeyh 33719
1306     <informalexample role="example"><screen>
1307     # Avoid that last message about the install being complete.
1308 joeyh 37253 d-i finish-install/reboot_in_progress note
1309 joeyh 33719
1310     # This will prevent the installer from ejecting the CD during the reboot,
1311     # which is useful in some situations.
1312     #d-i cdrom-detect/eject boolean false
1313 joeyh 50076
1314     # This is how to make the installer shutdown when finished, but not
1315     # reboot into the installed system.
1316     #d-i debian-installer/exit/halt boolean true
1317 joeyh 33719 </screen></informalexample>
1318    
1319     </sect2>
1320    
1321 fjp 32276 <sect2 id="preseed-X">
1322 fjp 32199 <title>X configuration</title>
1323 fjp 32276 <para>
1324 fjp 32199
1325 fjp 32276 Preseeding Debian's X config is possible, but you probably need to know
1326     some details about the video hardware of the machine, since Debian's X
1327     configurator does not do fully automatic configuration of everything.
1328    
1329     </para>
1330    
1331 fjp 32424 <informalexample role="example"><screen>
1332 fjp 32199 # X can detect the right driver for some cards, but if you're preseeding,
1333     # you override whatever it chooses. Still, vesa will work most places.
1334 cjwatson 33887 #xserver-xorg xserver-xorg/config/device/driver select vesa
1335 fjp 32199
1336     # A caveat with mouse autodetection is that if it fails, X will retry it
1337     # over and over. So if it's preseeded to be done, there is a possibility of
1338     # an infinite loop if the mouse is not autodetected.
1339 cjwatson 33887 #xserver-xorg xserver-xorg/autodetect_mouse boolean true
1340 fjp 32199
1341     # Monitor autodetection is recommended.
1342 cjwatson 33887 xserver-xorg xserver-xorg/autodetect_monitor boolean true
1343 fjp 32199 # Uncomment if you have an LCD display.
1344 cjwatson 33887 #xserver-xorg xserver-xorg/config/monitor/lcd boolean true
1345 fjp 32199 # X has three configuration paths for the monitor. Here's how to preseed
1346     # the "medium" path, which is always available. The "simple" path may not
1347     # be available, and the "advanced" path asks too many questions.
1348 cjwatson 33887 xserver-xorg xserver-xorg/config/monitor/selection-method \
1349 fjp 32199 select medium
1350 cjwatson 33887 xserver-xorg xserver-xorg/config/monitor/mode-list \
1351 fjp 32199 select 1024x768 @ 60 Hz
1352     </screen></informalexample>
1353    
1354 fjp 32276 </sect2>
1355 fjp 32199
1356 fjp 32276 <sect2 id="preseed-other">
1357 fjp 32199 <title>Preseeding other packages</title>
1358    
1359 fjp 32424 <informalexample role="example"><screen>
1360 fjp 32199 # Depending on what software you choose to install, or if things go wrong
1361     # during the installation process, it's possible that other questions may
1362     # be asked. You can preseed those too, of course. To get a list of every
1363     # possible question that could be asked during an install, do an
1364     # installation, and then run these commands:
1365     # debconf-get-selections --installer > file
1366     # debconf-get-selections >> file
1367     </screen></informalexample>
1368    
1369 fjp 32276 </sect2>
1370     </sect1>
1371 fjp 32199
1372 fjp 42374
1373 fjp 32276 <sect1 id="preseed-advanced">
1374 fjp 32199 <title>Advanced options</title>
1375 fjp 32424
1376 joeyh 42364 <sect2 id="preseed-hooks">
1377     <title>Running custom commands during the installation</title>
1378     <para>
1379 fjp 32424
1380 joeyh 42364 A very powerful and flexible option offered by the preconfiguration tools
1381     is the ability to run commands or scripts at certain points in the
1382     installation.
1383    
1384     </para>
1385    
1386 fjp 32424 <informalexample role="example"><screen>
1387     # d-i preseeding is inherently not secure. Nothing in the installer checks
1388     # for attempts at buffer overflows or other exploits of the values of a
1389 fjp 36205 # preconfiguration file like this one. Only use preconfiguration files from
1390     # trusted locations! To drive that home, and because it's generally useful,
1391     # here's a way to run any shell command you'd like inside the installer,
1392 fjp 32424 # automatically.
1393    
1394     # This first command is run as early as possible, just after
1395     # preseeding is read.
1396     #d-i preseed/early_command string anna-install some-udeb
1397    
1398     # This command is run just before the install finishes, but when there is
1399 joeyh 33719 # still a usable /target directory. You can chroot to /target and use it
1400     # directly, or use the apt-install and in-target commands to easily install
1401     # packages and run commands in the target system.
1402     #d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
1403 fjp 32424 </screen></informalexample>
1404    
1405     </sect2>
1406 joeyh 42364
1407     <sect2 id="preseed-seenflag">
1408     <title>Using preseeding to change default values</title>
1409     <para>
1410 fjp 32424
1411 joeyh 42364 It is possible to use preseeding to change the default answer for a
1412     question, but still have the question asked. To do this the
1413     <firstterm>seen</firstterm> flag must be reset to <quote>false</quote> after
1414     setting the value for a question.
1415    
1416     <informalexample><screen>
1417     d-i foo/bar string value
1418     d-i foo/bar seen false
1419     </screen></informalexample>
1420    
1421 fjp 45087 The same effect can be achieved for <emphasis>all</emphasis> questions by
1422     setting the parameter <classname>preseed/interactive=true</classname> at
1423     the boot prompt. This can also be useful for testing or debugging your
1424     preconfiguration file.
1425 rmh 45062
1426 fjp 48420 </para><para>
1427    
1428 fjp 45087 If you are preseeding using boot parameters, you can make the installer ask
1429     the corresponding question by using the <quote>?=</quote> operator, i.e.
1430     <userinput><replaceable>foo</replaceable>/<replaceable>bar</replaceable>?=<replaceable>value</replaceable></userinput>.
1431 fjp 44894 This will of course only have effect for parameters that correspond to
1432     questions that are actually displayed during an installation and not for
1433     <quote>internal</quote> parameters.
1434    
1435     </para><para>
1436    
1437     </para>
1438 joeyh 42364 </sect2>
1439    
1440 fjp 32424 <sect2 id="preseed-chainload">
1441 fjp 36205 <title>Chainloading preconfiguration files</title>
1442 fjp 32276 <para>
1443 fjp 32199
1444 fjp 36205 It is possible to include other preconfiguration files from a preconfiguration
1445     file. Any settings in those files will override pre-existing settings from
1446     files loaded earlier. This makes it possible to put, for example, general
1447 fjp 32276 networking settings for your location in one file and more specific
1448     settings for certain configurations in other files.
1449    
1450     </para>
1451    
1452 fjp 32199 <informalexample><screen>
1453 joeyh 42364 # More than one file can be listed, separated by spaces; all will be
1454 fjp 32199 # loaded. The included files can have preseed/include directives of their
1455     # own as well. Note that if the filenames are relative, they are taken from
1456 fjp 36205 # the same directory as the preconfiguration file that includes them.
1457 fjp 32199 #d-i preseed/include string x.cfg
1458    
1459 fjp 36205 # The installer can optionally verify checksums of preconfiguration files
1460     # before using them. Currently only md5sums are supported, list the md5sums
1461 fjp 32199 # in the same order as the list of files to include.
1462     #d-i preseed/include/checksum string 5da499872becccfeda2c4872f9171c3d
1463    
1464     # More flexibly, this runs a shell command and if it outputs the names of
1465 fjp 36205 # preconfiguration files, includes those files.
1466 fjp 32199 #d-i preseed/include_command \
1467 joeyh 48439 # string if [ "`hostname`" = bob ]; then echo bob.cfg; fi
1468 joeyh 37224
1469     # Most flexibly of all, this downloads a program and runs it. The program
1470 fjp 39285 # can use commands such as debconf-set to manipulate the debconf database.
1471 fjp 43525 # More than one script can be listed, separated by spaces.
1472 joeyh 37224 # Note that if the filenames are relative, they are taken from the same
1473     # directory as the preconfiguration file that runs them.
1474 fjp 43525 #d-i preseed/run string foo.sh
1475 fjp 32199 </screen></informalexample>
1476    
1477 joeyh 42364 <para>
1478    
1479     It is also possible to chainload from the initrd or file preseeding phase,
1480 fjp 42374 into network preseeding by setting preseed/url in the earlier files.
1481 joeyh 42364 This will cause network preseeding to be performed when the network comes
1482     up. You need to be careful when doing this, since there will be two
1483     distinct runs at preseeding, meaning for example that you get another
1484     chance to run the preseed/early command, the second one happening after the
1485     network comes up.
1486    
1487     </para>
1488    
1489 fjp 32424 </sect2>
1490 fjp 32276 </sect1>
1491 fjp 32199 </appendix>

Properties

Name Value
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.5