/[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 67226 - (show annotations) (download) (as text)
Wed Feb 8 18:17:45 2012 UTC (15 months, 1 week ago) by joeyh
File MIME type: text/xml
File size: 61866 byte(s)
clarify wording
1 <!-- retain these comments for translator revision tracking -->
2 <!-- $Id$ -->
3
4 <!--
5 Be careful with the format of this file as it is parsed to generate
6 the example preconfiguration file.
7 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 <appendix id="appendix-preseed">
16 <title>Automating the installation using preseeding</title>
17
18 <para>
19
20 This appendix explains how to preseed answers to questions in &d-i; to
21 automate your installation.
22
23 </para><para>
24
25 The configuration fragments used in this appendix are also available as an
26 example preconfiguration file from &urlset-example-preseed;.
27
28 </para>
29
30 <sect1 id="preseed-intro">
31 <title>Introduction</title>
32 <para>
33
34 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
40 </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 </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 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 different installation methods.
59
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 <entry>CD/DVD</entry>
77 <entry>yes</entry>
78 <entry>yes</entry>
79 <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 </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 <entry>yes<footnoteref linkend='apx-ps-net'/></entry>
97 </row><row condition="supports-floppy-boot">
98 <entry>floppy based (cd-drivers)</entry>
99 <entry>yes</entry>
100 <entry>yes</entry>
101 <entry>yes<footnoteref linkend='apx-ps-net'/></entry>
102 </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 the preconfiguration file is loaded and processed. For initrd preseeding
121 this is right at the start of the installation, before the first question is
122 even asked. For file preseeding this is after the CD or CD image has been
123 loaded. For network preseeding it is only after the network has been
124 configured.
125
126 </para><para>
127
128 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
134 </para><para>
135
136 In order to avoid the questions that would normally appear before the
137 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 the installation at critical priority, which avoids many unimportant
142 questions. See <xref linkend="preseed-auto"/> for details.
143
144 </para>
145 </sect2>
146
147 <sect2 id="preseed-limitations">
148 <title>Limitations</title>
149 <para>
150
151 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 or use available free space on a disk; it is not possible to use existing
154 partitions.
155
156 </para>
157 </sect2>
158
159 <!-- Joeyh feels this is too technical, so leave it out for now
160 <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 </para>
178
179 <itemizedlist spacing="compact">
180 <listitem><para>
181 string: allows the user to type any value
182 </para></listitem>
183 <listitem><para>
184 password: similar to string but the value typed is not displayed
185 </para></listitem>
186 <listitem><para>
187 boolean: for yes/no or true/false type of questions
188 </para></listitem>
189 <listitem><para>
190 select: allows the user to select one option from a list
191 </para></listitem>
192 <listitem><para>
193 multiselect: allows the user to select zero, one or more options from a list
194 </para></listitem>
195 <listitem><para>
196 note: used to display a message
197 </para></listitem>
198 </itemizedlist>
199
200 <para>
201
202 In &d-i; templates are stored in a readable file
203 <filename>/var/cache/debconf/templates.dat</filename>. This file contains all fixed
204 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 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 A question always refers to the template used to ask it. For obvious
213 security reasons the values for questions of type <quote>password</quote>
214 are stored in a separate, non-readable file in the same directory.
215
216 </para>
217 </sect2>
218 -->
219 </sect1>
220
221
222 <sect1 id="preseed-using">
223 <title>Using preseeding</title>
224 <para>
225
226 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
235 </para><para>
236
237 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
241 </para>
242
243 <sect2 id="preseed-loading">
244 <title>Loading the preconfiguration file</title>
245 <para>
246
247 If you are using initrd preseeding, you only have to make sure a file named
248 <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 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 <phrase arch="linux-any">(e.g.
258 <filename>syslinux.cfg</filename>) and adding the parameter to the end of
259 the append line(s) for the kernel.</phrase><phrase arch="kfreebsd-any">(e.g.
260 <filename>grub.cfg</filename>) and adding the parameter as a new
261 <literal>set</literal> line for the kernel.</phrase><phrase arch="hurd-any">(e.g.
262 <filename>grub.cfg</filename>) and adding the parameter to the end of the
263 <filename>gnumach.gz</filename> line.</phrase>
264
265 </para><para>
266
267 If you do specify the preconfiguration file in the bootloader configuration,
268 you might change the configuration so you don't need to hit enter to boot the
269 installer. <phrase arch="linux-any">For syslinux this means setting the timeout
270 to <literal>1</literal> in <filename>syslinux.cfg</filename>.</phrase><phrase
271 arch="kfrebsd-any;hurd-any">For grub this means setting the timeout to
272 <literal>0</literal> in <filename>grub.cfg</filename>.</phrase>
273
274 </para><para>
275
276 To make sure the installer gets the right preconfiguration file, you can
277 optionally specify a checksum for the file. Currently this needs to be a
278 md5sum, and if specified it must match the preconfiguration file or the
279 installer will refuse to use it.
280
281 </para>
282
283 <informalexample><screen>
284 Boot parameters to specify:
285 - if you're netbooting:
286 preseed/url=http://host/path/to/preseed.cfg
287 preseed/url/checksum=5da499872becccfeda2c4872f9171c3d
288
289 - if you're booting a remastered CD:
290 preseed/file=/cdrom/preseed.cfg
291 preseed/file/checksum=5da499872becccfeda2c4872f9171c3d
292
293 - if you're installing from USB media (put the preconfiguration file in the
294 toplevel directory of the USB stick):
295 preseed/file=/hd-media/preseed.cfg
296 preseed/file/checksum=5da499872becccfeda2c4872f9171c3d
297 </screen></informalexample>
298
299 <para>
300
301 Note that <filename>preseed/url</filename> can be shortened to just
302 <filename>url</filename>, <filename>preseed/file</filename> to just
303 <filename>file</filename> and <filename>preseed/file/checksum</filename> to just
304 <filename>preseed-md5</filename> when they are passed as boot parameters.
305
306 </para>
307 </sect2>
308
309 <sect2 id="preseed-bootparms">
310 <title>Using boot parameters to preseed questions</title>
311 <para>
312
313 If a preconfiguration file cannot be used to preseed some steps, the
314 install can still be fully automated, since you can pass preseed values on
315 the command line when booting the installer.
316
317 </para><para>
318
319 Boot parameters can also be used if you do not really want to use preseeding,
320 but just want to provide an answer for a specific question. Some examples where
321 this can be useful are documented elsewhere in this manual.
322
323 </para><para>
324
325 To set a value to be used inside &d-i;, just pass
326 <userinput><replaceable>path/to/variable</replaceable>=<replaceable>value</replaceable></userinput>
327 for any of the preseed variables listed in the examples in this appendix.
328 If a value is to be used to configure packages for the target system, you
329 will need to prepend the <firstterm>owner</firstterm><footnote>
330
331 <para>
332 The owner of a debconf variable (or template) is normally the name of the
333 package that contains the corresponding debconf template. For variables
334 used in the installer itself the owner is <quote>d-i</quote>.
335 Templates and variables can have more than one owner which helps to
336 determine whether they can be removed from the debconf database if the
337 package is purged.
338 </para>
339
340 </footnote> of the variable as in
341 <userinput><replaceable>owner</replaceable>:<replaceable>path/to/variable</replaceable>=<replaceable>value</replaceable></userinput>.
342 If you don't specify the owner, the value for the variable will not be
343 copied to the debconf database in the target system and thus remain unused
344 during the configuration of the relevant package.
345
346 </para><para>
347
348 Normally, preseeding a question in this way will mean that the question will
349 not be asked. To set a specific default value for a question, but still have
350 the question asked, use <quote>?=</quote> instead of <quote>=</quote> as
351 operator. See also <xref linkend="preseed-seenflag"/>.
352
353 </para><para>
354
355 Note that some variables that are frequently set at the boot prompt
356 have a shorter alias. If an alias is available, it is used in the
357 examples in this appendix instead of the full variable. The
358 <literal>preseed/url</literal> variable for example has been aliased as
359 <literal>url</literal>. Another example is the <literal>tasks</literal>
360 alias, which translates to <literal>tasksel:tasksel/first</literal>.
361
362 </para><para>
363
364 A <quote>--</quote> in the boot options has special meaning. Kernel
365 parameters that appear after the last <quote>--</quote> may be copied
366 into the bootloader configuration for the installed system (if supported by
367 the installer for the bootloader). The installer will automatically filter
368 out any options (like preconfiguration options) that it recognizes.
369
370 </para>
371 <note arch="linux-any"><para>
372
373 Current linux kernels (2.6.9 and later) accept a maximum of 32 command line
374 options and 32 environment options, including any options added by default
375 for the installer. If these numbers are exceeded, the kernel will panic
376 (crash). (For earlier kernels, these numbers were lower.)
377
378 </para></note>
379 <para>
380
381 For most installations some of the default options in your bootloader
382 configuration file, like <literal>vga=normal</literal>, may be safely
383 removed which may allow you to add more options for preseeding.
384
385 </para>
386 <note><para>
387
388 It may not always be possible to specify values with spaces for boot
389 parameters, even if you delimit them with quotes.
390
391 </para></note>
392 </sect2>
393
394 <sect2 id="preseed-auto">
395 <title>Auto mode</title>
396 <para>
397
398 There are several features of &debian; Installer that combine to allow
399 fairly simple command lines at the boot prompt to result in
400 arbitrarily complex customized automatic installs. To illustrate
401 this, here are some examples that can be used at the boot prompt:
402
403 <informalexample><screen>
404 auto url=autoserver
405 </screen></informalexample>
406
407 This relies on there being a DHCP server that will get the machine to
408 the point where <literal>autoserver</literal> can be resolved by DNS,
409 perhaps after adding the local domain if that was provided by DHCP.
410 If this was done at a site where the domain is
411 <literal>example.com</literal>, and they have a reasonably sane DHCP
412 setup, it would result in the preseed file being retrieved from
413 <literal>http://autoserver.example.com/d-i/&releasename;/./preseed.cfg</literal>.
414
415 </para><para>
416
417 The last part of that url (<literal>d-i/&releasename;/./preseed.cfg</literal>)
418 is taken from <literal>auto-install/defaultroot</literal>. By default
419 this includes the directory <literal>&releasename;</literal> to allow future versions
420 to specify their own codename and let people migrate forwards in a
421 controlled manner. The <literal>/./</literal> bit is used to indicate
422 a root, relative to which subsequent paths can be anchored (for use in
423 preseed/include and preseed/run). This allows files to be specified
424 either as full URLs, paths starting with / that are thus anchored, or
425 even paths relative to the location where the last preseed file was
426 found. This can be used to construct more portable scripts where an
427 entire hierarchy of scripts can be moved to a new location without
428 breaking it, for example copying the files onto a USB stick when they
429 started out on a web server. In this example, if the preseed file
430 sets <literal>preseed/run</literal> to
431 <literal>/scripts/late_command.sh</literal> then the file will be
432 fetched from
433 <literal>http://autoserver.example.com/d-i/&releasename;/./scripts/late_command.sh</literal>.
434
435 </para><para>
436
437 If there is no local DHCP or DNS infrastructure, or if you do not want to
438 use the default path to <filename>preseed.cfg</filename>, you can still
439 use an explicit url, and if you don't use the <literal>/./</literal>
440 element it will be anchored to the start of the path (i.e. the third
441 <literal>/</literal> in the URL). Here is an example that requires minimal
442 support from the local network infrastructure:
443
444 <informalexample><screen>
445 auto url=<replaceable>http://192.168.1.2/path/to/mypreseed.file</replaceable>
446 </screen></informalexample>
447
448 The way this works is that:
449 <itemizedlist spacing="compact">
450 <listitem><para>
451 if the URL is missing a protocol, http is assumed,
452 </para></listitem>
453 <listitem><para>
454 if the hostname section contains no periods, it has the domain derived
455 from DHCP appended to it, and
456 </para></listitem>
457 <listitem><para>
458 if there's no <literal>/</literal>'s after the hostname, then the default
459 path is added.
460 </para></listitem>
461 </itemizedlist>
462
463 </para><para>
464
465 In addition to specifying the url, you can also specify settings that
466 do not directly affect the behavior of &d-i; itself, but can be passed
467 through to scripts specified using <literal>preseed/run</literal>
468 in the loaded preseed file. At present, the only example of
469 this is <literal>auto-install/classes</literal>, which has an alias
470 <literal>classes</literal>. This can be used thus:
471
472 <informalexample><screen>
473 auto url=<replaceable>example.com</replaceable> classes=<replaceable>class_A;class_B</replaceable>
474 </screen></informalexample>
475
476 The classes could for example denote the type of system to be installed,
477 or the localization to be used.
478
479 </para><para>
480
481 It is of course possible to extend this concept, and if you do, it is
482 reasonable to use the auto-install namespace for this. So one might have
483 something like <literal>auto-install/style</literal> which is then used
484 in your scripts. If you feel the need to do this, please mention it on
485 the <email>debian-boot@lists.debian.org</email> mailing list so that we
486 can avoid namespace conflicts, and perhaps add an alias for the parameter
487 for you.
488
489 </para><para>
490
491 The <literal>auto</literal> boot label is not yet defined everywhere.
492 The same effect may be achieved by simply adding the two
493 parameters <literal>auto=true priority=critical</literal> to the kernel
494 command line. The <literal>auto</literal> parameter is an alias for
495 <literal>auto-install/enable</literal> and setting it to
496 <literal>true</literal> delays the
497 locale and keyboard questions until after there has been a chance to
498 preseed them, while <literal>priority</literal> is an alias for
499 <literal>debconf/priority</literal> and setting it to
500 <literal>critical</literal> stops any questions with a lower priority
501 from being asked.
502
503 </para><para>
504
505 Additional options that may be of interest while attempting to
506 automate an install while using DHCP are: <literal>interface=auto
507 netcfg/dhcp_timeout=60</literal> which makes the machine choose the
508 first viable NIC and be more patient about getting a reply to its
509 DHCP query.
510
511 </para>
512 <tip><para>
513
514 An extensive example of how to use this framework, including example scripts
515 and classes, can be found on the <ulink url="http://hands.com/d-i/">website
516 of its developer</ulink>. The examples available there also show many other
517 nice effects that can be achieved by creative use of preconfiguration.
518
519 </para></tip>
520 </sect2>
521
522 <sect2 id="preseed-aliases">
523 <title>Aliases useful with preseeding</title>
524 <para>
525
526 The following aliases can be useful when using (auto mode) preseeding.
527 Note that these are simply short aliases for question names, and you
528 always need to specify a value as well: for example,
529 <literal>auto=true</literal> or <literal>interface=eth0</literal>.
530
531 </para>
532
533 <!-- Setting column width does not seem to work; use non-breaking spaces
534 to separate columns a bit -->
535 <informaltable frame="none">
536 <tgroup cols="2"><tbody>
537 <row><entry>auto</entry><entry>auto-install/enable</entry></row>
538 <row><entry>classes</entry><entry>auto-install/classes</entry></row>
539 <row><entry>fb</entry><entry>debian-installer/framebuffer</entry></row>
540 <row><entry>language</entry><entry>debian-installer/language</entry></row>
541 <row><entry>country</entry><entry>debian-installer/country</entry></row>
542 <row><entry>locale</entry><entry>debian-installer/locale</entry></row>
543 <row><entry>priority</entry><entry>debconf/priority</entry></row>
544 <row><entry>file</entry><entry>preseed/file</entry></row>
545 <row><entry>url</entry><entry>preseed/url</entry></row>
546 <row><entry>interface</entry><entry>netcfg/choose_interface</entry></row>
547 <row><entry>hostname&nbsp;&nbsp;&nbsp;</entry><entry>netcfg/get_hostname</entry></row>
548 <row><entry>domain</entry><entry>netcfg/get_domain</entry></row>
549 <row><entry>protocol</entry><entry>mirror/protocol</entry></row>
550 <row><entry>suite</entry><entry>mirror/suite</entry></row>
551 </tbody></tgroup>
552 </informaltable>
553
554 </sect2>
555
556 <sect2 id="preseed-dhcp">
557 <title>Using a DHCP server to specify preconfiguration files</title>
558 <para>
559
560 It's also possible to use DHCP to specify a preconfiguration file to download
561 from the network. DHCP allows specifying a filename. Normally this is a file
562 to netboot, but if it appears to be an URL then installation media that
563 support network preseeding will download the file from the URL and use it as a
564 preconfiguration file. Here is an example of how to set it up in the dhcpd.conf
565 for version 3 of the ISC DHCP server (the dhcp3-server &debian; package).
566
567 </para>
568
569 <informalexample><screen>
570 if substring (option vendor-class-identifier, 0, 3) = "d-i" {
571 filename "http://host/preseed.cfg";
572 }
573 </screen></informalexample>
574
575 <para>
576
577 Note that the above example limits this filename to DHCP clients that identify
578 themselves as "d-i", so it will not affect regular DHCP clients, but only
579 the installer. You can also put the text in a stanza for only one particular
580 host to avoid preseeding all installs on your network.
581
582 </para><para>
583
584 A good way to use the DHCP preseeding is to only preseed values specific to
585 your network, such as the &debian; mirror to use. This way installs on your
586 network will automatically get a good mirror selected, but the rest of the
587 installation can be performed interactively. Using DHCP preseeding to fully
588 automate &debian; installs should only be done with care.
589
590 </para>
591 </sect2>
592 </sect1>
593
594
595 <sect1 id="preseed-creating">
596 <title>Creating a preconfiguration file</title>
597 <para>
598
599 The preconfiguration file is in the format used by the
600 <command>debconf-set-selections</command> command. The general format of
601 a line in a preconfiguration file is:
602
603 <informalexample><screen>
604 &lt;owner&gt; &lt;question name&gt; &lt;question type&gt; &lt;value&gt;
605 </screen></informalexample>
606
607 </para><para>
608
609 There are a few rules to keep in mind when writing a preconfiguration file.
610
611 </para>
612
613 <itemizedlist>
614 <listitem><para>
615 Put only a single space or tab between type and value: any additional
616 whitespace will be interpreted as belonging to the value.
617 </para></listitem>
618 <listitem><para>
619 A line can be split into multiple lines by appending a backslash
620 (<quote><literal>\</literal></quote>) as the line continuation character.
621 A good place to split a line is after the question name; a bad place is
622 between type and value. Split lines will be joined into a single line
623 with all leading/trailing whitespace condensed to a single space.
624 </para></listitem>
625 <listitem><para>
626 For debconf variables (templates) used only in the installer itself, the
627 owner should be set to <quote>d-i</quote>; to preseed variables used
628 in the installed system, the name of the package that contains the
629 corresponding debconf template should be used. Only variables that have
630 their owner set to something other than <quote>d-i</quote> will be
631 propagated to the debconf database for the installed system.
632 </para></listitem>
633 <listitem><para>
634 Most questions need to be preseeded using the values valid in English and
635 not the translated values. However, there are some questions (for example
636 in <classname>partman</classname>) where the translated values need to be
637 used.
638 </para></listitem>
639 <listitem><para>
640 Some questions take a code as value instead of the English text that is
641 shown during installation.
642 </para></listitem>
643 </itemizedlist>
644
645 <para>
646
647 The easiest way to create a preconfiguration file is to use the example file
648 linked in <xref linkend="preseed-contents"/> as basis and work from there.
649
650 </para><para>
651
652 An alternative method is to do a manual installation and then, after
653 rebooting, use the <command>debconf-get-selections</command> from the
654 <classname>debconf-utils</classname> package to dump both the debconf
655 database and the installer's cdebconf database to a single file:
656
657 <informalexample><screen>
658 $ debconf-get-selections --installer &gt; <replaceable>file</replaceable>
659 $ debconf-get-selections &gt;&gt; <replaceable>file</replaceable>
660 </screen></informalexample>
661
662 </para><para>
663
664 However, a file generated in this manner will have some items that should
665 not be preseeded, and the example file is a better starting place for most
666 users.
667
668 </para>
669
670 <note><para>
671
672 This method relies on the fact that, at the end of the installation, the
673 installer's cdebconf database is saved to the installed system in
674 <filename>/var/log/installer/cdebconf</filename>. However, because the
675 database may contain sensitive information, by default the files are only
676 readable by root.
677
678 </para><para>
679
680 The directory <filename>/var/log/installer</filename> and all files in it
681 will be deleted from your system if you purge the package
682 <classname>installation-report</classname>.
683
684 </para></note>
685
686 <para>
687
688 To check possible values for questions, you can use <command>nano</command>
689 to examine the files in <filename>/var/lib/cdebconf</filename> while an
690 installation is in progress. View <filename>templates.dat</filename> for
691 the raw templates and <filename>questions.dat</filename> for the current
692 values and for the values assigned to variables.
693
694 </para><para>
695
696 To check if the format of your preconfiguration file is valid before performing
697 an install, you can use the command <command>debconf-set-selections -c
698 <replaceable>preseed.cfg</replaceable></command>.
699
700 </para>
701 </sect1>
702
703
704 <sect1 id="preseed-contents">
705 <title>Contents of the preconfiguration file (for &releasename;)</title>
706 <para>
707
708 The configuration fragments used in this appendix are also available as an
709 example preconfiguration file from &urlset-example-preseed;.
710
711 </para><para>
712
713 Note that this example is based on an installation for the Intel x86
714 architecture. If you are installing a different architecture, some of the
715 examples (like keyboard selection and bootloader installation) may not be
716 relevant and will need to be replaced by debconf settings appropriate for
717 your architecture.
718
719 </para><para>
720
721 Details on how the different Debian Installer components actually work can be
722 found in <xref linkend="module-details"/>.
723
724 </para>
725
726 <sect2 id="preseed-l10n">
727 <title>Localization</title>
728 <para>
729
730 Setting localization values will only work if you are using initrd preseeding.
731 With all other methods the preconfiguration file will only be loaded after
732 these questions have been asked.
733
734 </para><para>
735
736 The locale can be used to specify both language and country and can be any
737 combination of a language supported by &d-i; and a recognized country. If
738 the combination does not form a valid locale, the installer will automatically
739 select a locale that is valid for the selected language.
740 To specify the locale as a boot parameter, use
741 <userinput>locale=<replaceable>en_US</replaceable></userinput>.
742
743 </para><para>
744
745 Although this method is very easy to use, it does not allow preseeding of
746 all possible combinations of language, country and locale<footnote>
747
748 <para>
749 Preseeding <literal>locale</literal> to <userinput>en_NL</userinput> would
750 for example result in <literal>en_US.UTF-8</literal> as default locale for
751 the installed system. If e.g. <literal>en_GB.UTF-8</literal> is preferred
752 instead, the values will need to be preseeded individually.
753 </para>
754
755 </footnote>. So alternatively the values can be preseeded individually.
756 Language and country can also be specified as boot parameters.
757
758 <informalexample role="example"><screen>
759 # Preseeding only locale sets language, country and locale.
760 d-i debian-installer/locale string en_US
761
762 # The values can also be preseeded individually for greater flexibility.
763 #d-i debian-installer/language string en
764 #d-i debian-installer/country string NL
765 #d-i debian-installer/locale string en_GB.UTF-8
766 # Optionally specify additional locales to be generated.
767 #d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8
768 </screen></informalexample>
769
770 </para><para>
771
772 Keyboard configuration consists of selecting a keyboard architecture and a
773 keymap. In most cases the correct keyboard architecture is selected by
774 default, so there's normally no need to preseed it. The keymap must
775 be known to the &d-i; for the selected keyboard architecture.
776
777 <informalexample role="example"><screen>
778 # Keyboard selection.
779 #d-i console-tools/archs select at
780 # keymap is an alias for console-keymaps-at
781 d-i keymap select us
782 d-i keyboard-configuration/xkb-keymap select us
783 # Example for a different keyboard architecture
784 #d-i console-keymaps-usb/keymap select mac-usb-us
785 </screen></informalexample>
786
787 </para><para>
788
789 To skip keyboard configuration, preseed
790 <classname>console-tools/archs</classname> with
791 <userinput>skip-config</userinput>.
792 This will result in the kernel keymap remaining active.
793
794 </para>
795
796 <note><para>
797
798 The changes in the input layer for 2.6 kernels have made the keyboard
799 architecture virtually obsolete. For 2.6 kernels normally a <quote>PC</quote>
800 (<userinput>at</userinput>) keymap should be selected.
801
802 </para></note>
803 </sect2>
804
805 <sect2 id="preseed-network">
806 <title>Network configuration</title>
807 <para>
808
809 Of course, preseeding the network configuration won't work if you're
810 loading your preconfiguration file from the network. But it's great when
811 you're booting from CD or USB stick. If you are loading preconfiguration
812 files from the network, you can pass network config parameters by using
813 kernel boot parameters.
814
815 </para><para>
816
817 If you need to pick a particular interface when netbooting before loading
818 a preconfiguration file from the network, use a boot parameter such as
819 <userinput>interface=<replaceable>eth1</replaceable></userinput>.
820
821 </para><para>
822
823 Although preseeding the network configuration is normally not possible when
824 using network preseeding (using <quote>preseed/url</quote>), you can use
825 the following hack to work around that, for example if you'd like to set a
826 static address for the network interface. The hack is to force the network
827 configuration to run again after the preconfiguration file has been loaded
828 by creating a <quote>preseed/run</quote> script containing the following
829 commands:
830
831 <informalexample><screen>
832 killall.sh; netcfg
833 </screen></informalexample>
834
835 </para><para>
836
837 The following debconf variables are relevant for network configuration.
838
839 </para>
840
841 <informalexample role="example"><screen>
842 # Disable network configuration entirely. This is useful for cdrom
843 # installations on non-networked devices where the network questions,
844 # warning and long timeouts are a nuisance.
845 #d-i netcfg/enable boolean false
846
847 # netcfg will choose an interface that has link if possible. This makes it
848 # skip displaying a list if there is more than one interface.
849 d-i netcfg/choose_interface select auto
850
851 # To pick a particular interface instead:
852 #d-i netcfg/choose_interface select eth1
853
854 # If you have a slow dhcp server and the installer times out waiting for
855 # it, this might be useful.
856 #d-i netcfg/dhcp_timeout string 60
857
858 # If you prefer to configure the network manually, uncomment this line and
859 # the static network configuration below.
860 #d-i netcfg/disable_dhcp boolean true
861
862 # If you want the preconfiguration file to work on systems both with and
863 # without a dhcp server, uncomment these lines and the static network
864 # configuration below.
865 #d-i netcfg/dhcp_failed note
866 #d-i netcfg/dhcp_options select Configure network manually
867
868 # Static network configuration.
869 #d-i netcfg/get_nameservers string 192.168.1.1
870 #d-i netcfg/get_ipaddress string 192.168.1.42
871 #d-i netcfg/get_netmask string 255.255.255.0
872 #d-i netcfg/get_gateway string 192.168.1.1
873 #d-i netcfg/confirm_static boolean true
874
875 # Any hostname and domain names assigned from dhcp take precedence over
876 # values set here. However, setting the values still prevents the questions
877 # from being shown, even if values come from dhcp.
878 d-i netcfg/get_hostname string unassigned-hostname
879 d-i netcfg/get_domain string unassigned-domain
880
881 # Disable that annoying WEP key dialog.
882 d-i netcfg/wireless_wep string
883 # The wacky dhcp hostname that some ISPs use as a password of sorts.
884 #d-i netcfg/dhcp_hostname string radish
885
886 # If non-free firmware is needed for the network or other hardware, you can
887 # configure the installer to always try to load it, without prompting. Or
888 # change to false to disable asking.
889 #d-i hw-detect/load_firmware boolean true
890 </screen></informalexample>
891
892 <para>
893
894 Please note that <command>netcfg</command> will automatically determine the
895 netmask if <classname>netcfg/get_netmask</classname> is not preseeded. In
896 this case, the variable has to be marked as <literal>seen</literal> for
897 automatic installations. Similarly, <command>netcfg</command> will choose
898 an appropriate address if <classname>netcfg/get_gateway</classname> is not
899 set. As a special case, you can set
900 <classname>netcfg/get_gateway</classname> to <quote>none</quote> to specify
901 that no gateway should be used.
902
903 </para>
904
905 </sect2>
906
907 <sect2 id="preseed-network-console">
908 <title>Network console</title>
909
910 <informalexample role="example"><screen>
911 # Use the following settings if you wish to make use of the network-console
912 # component for remote installation over SSH. This only makes sense if you
913 # intend to perform the remainder of the installation manually.
914 #d-i anna/choose_modules string network-console
915 #d-i network-console/password password r00tme
916 #d-i network-console/password-again password r00tme
917 </screen></informalexample>
918
919 </sect2>
920
921 <sect2 id="preseed-mirror">
922 <title>Mirror settings</title>
923 <para>
924
925 Depending on the installation method you use, a mirror may be used to
926 download additional components of the installer, to install the base system,
927 and to set up the <filename>/etc/apt/sources.list</filename> for the installed
928 system.
929
930 </para><para>
931
932 The parameter <classname>mirror/suite</classname> determines the suite for
933 the installed system.
934
935 </para><para>
936
937 The parameter <classname>mirror/udeb/suite</classname> determines the suite
938 for additional components for the installer. It is only useful to set this
939 if components are actually downloaded over the network and should match the
940 suite that was used to build the initrd for the installation method used for
941 the installation. Normally the installer will automatically use the correct
942 value and there should be no need to set this.
943
944 </para>
945
946 <informalexample role="example"><screen>
947 # If you select ftp, the mirror/country string does not need to be set.
948 #d-i mirror/protocol string ftp
949 d-i mirror/country string manual
950 d-i mirror/http/hostname string &archive-mirror;
951 d-i mirror/http/directory string /debian
952 d-i mirror/http/proxy string
953
954 # Suite to install.
955 #d-i mirror/suite string testing
956 # Suite to use for loading installer components (optional).
957 #d-i mirror/udeb/suite string testing
958 </screen></informalexample>
959
960 </sect2>
961
962 <sect2 id="preseed-account">
963 <title>Account setup</title>
964 <para>
965
966 The password for the root account and name and password for a first regular
967 user's account can be preseeded. For the passwords you can use either clear
968 text values or MD5 <emphasis>hashes</emphasis>.
969
970 </para>
971 <warning><para>
972
973 Be aware that preseeding passwords is not completely secure as everyone
974 with access to the preconfiguration file will have the knowledge of these
975 passwords. Using MD5 hashes is considered slightly better in terms of
976 security but it might also give a false sense of security as access to a
977 MD5 hash allows for brute force attacks.
978
979 </para></warning>
980
981 <informalexample role="example"><screen>
982 # Skip creation of a root account (normal user account will be able to
983 # use sudo).
984 #d-i passwd/root-login boolean false
985 # Alternatively, to skip creation of a normal user account.
986 #d-i passwd/make-user boolean false
987
988 # Root password, either in clear text
989 #d-i passwd/root-password password r00tme
990 #d-i passwd/root-password-again password r00tme
991 # or encrypted using an MD5 hash.
992 #d-i passwd/root-password-crypted password [MD5 hash]
993
994 # To create a normal user account.
995 #d-i passwd/user-fullname string Debian User
996 #d-i passwd/username string debian
997 # Normal user's password, either in clear text
998 #d-i passwd/user-password password insecure
999 #d-i passwd/user-password-again password insecure
1000 # or encrypted using an MD5 hash.
1001 #d-i passwd/user-password-crypted password [MD5 hash]
1002 # Create the first user with the specified UID instead of the default.
1003 #d-i passwd/user-uid string 1010
1004
1005 # The user account will be added to some standard initial groups. To
1006 # override that, use this.
1007 #d-i passwd/user-default-groups string audio cdrom video
1008 </screen></informalexample>
1009
1010 <para>
1011
1012 The <classname>passwd/root-password-crypted</classname> and
1013 <classname>passwd/user-password-crypted</classname> variables can also
1014 be preseeded with <quote>!</quote> as their value. In that case, the
1015 corresponding account is disabled. This may be convenient for the root
1016 account, provided of course that an alternative method is set up to allow
1017 administrative activities or root login (for instance by using SSH key
1018 authentication or <command>sudo</command>).
1019
1020 </para><para>
1021
1022 The following command can be used to generate an MD5 hash for a password:
1023
1024 <informalexample><screen>
1025 $ printf "r00tme" | mkpasswd -s -m md5
1026 </screen></informalexample>
1027
1028 </para>
1029 </sect2>
1030
1031 <sect2 id="preseed-time">
1032 <title>Clock and time zone setup</title>
1033
1034 <informalexample role="example"><screen>
1035 # Controls whether or not the hardware clock is set to UTC.
1036 d-i clock-setup/utc boolean true
1037
1038 # You may set this to any valid setting for $TZ; see the contents of
1039 # /usr/share/zoneinfo/ for valid values.
1040 d-i time/zone string US/Eastern
1041
1042 # Controls whether to use NTP to set the clock during the install
1043 d-i clock-setup/ntp boolean true
1044 # NTP server to use. The default is almost always fine here.
1045 #d-i clock-setup/ntp-server string ntp.example.com
1046 </screen></informalexample>
1047
1048 </sect2>
1049
1050 <sect2 id="preseed-partman">
1051 <title>Partitioning</title>
1052 <para>
1053
1054 Using preseeding to partition the harddisk is limited to what is supported
1055 by <classname>partman-auto</classname>. You can choose to partition
1056 either existing free space on a disk or a whole disk. The layout of the
1057 disk can be determined by using a predefined recipe, a custom recipe from
1058 a recipe file or a recipe included in the preconfiguration file.
1059
1060 </para><para>
1061
1062 Preseeding of advanced partition setups using RAID, LVM and encryption is
1063 supported, but not with the full flexibility possible when partitioning
1064 during a non-preseeded install.
1065
1066 </para><para>
1067
1068 The examples below only provide basic information on the use of recipes.
1069 For detailed information see the files
1070 <filename>partman-auto-recipe.txt</filename> and
1071 <filename>partman-auto-raid-recipe.txt</filename> included in the
1072 <classname>debian-installer</classname> package.
1073 Both files are also available from the
1074 <ulink url="&url-d-i-gitweb-doc-devel;">&d-i; source
1075 repository</ulink>. Note that the supported functionality may change
1076 between releases.
1077
1078 </para>
1079
1080 <warning><para>
1081
1082 The identification of disks is dependent on the order in which their drivers
1083 are loaded. If there are multiple disks in the system, make very sure the
1084 correct one will be selected before using preseeding.
1085
1086 </para></warning>
1087
1088 <sect3 id="preseed-partman-example">
1089 <title>Partitioning example</title>
1090
1091 <informalexample role="example"><screen>
1092 # If the system has free space you can choose to only partition that space.
1093 # This is only honoured if partman-auto/method (below) is not set.
1094 #d-i partman-auto/init_automatically_partition select biggest_free
1095
1096 # Alternatively, you may specify a disk to partition. If the system has only
1097 # one disk the installer will default to using that, but otherwise the device
1098 # name must be given in traditional, non-devfs format (so e.g. /dev/hda or
1099 # /dev/sda, and not e.g. /dev/discs/disc0/disc).
1100 # For example, to use the first SCSI/SATA hard disk:
1101 #d-i partman-auto/disk string /dev/sda
1102 # In addition, you'll need to specify the method to use.
1103 # The presently available methods are:
1104 # - regular: use the usual partition types for your architecture
1105 # - lvm: use LVM to partition the disk
1106 # - crypto: use LVM within an encrypted partition
1107 d-i partman-auto/method string lvm
1108
1109 # If one of the disks that are going to be automatically partitioned
1110 # contains an old LVM configuration, the user will normally receive a
1111 # warning. This can be preseeded away...
1112 d-i partman-lvm/device_remove_lvm boolean true
1113 # The same applies to pre-existing software RAID array:
1114 d-i partman-md/device_remove_md boolean true
1115 # And the same goes for the confirmation to write the lvm partitions.
1116 d-i partman-lvm/confirm boolean true
1117
1118 # You can choose one of the three predefined partitioning recipes:
1119 # - atomic: all files in one partition
1120 # - home: separate /home partition
1121 # - multi: separate /home, /usr, /var, and /tmp partitions
1122 d-i partman-auto/choose_recipe select atomic
1123
1124 # Or provide a recipe of your own...
1125 # If you have a way to get a recipe file into the d-i environment, you can
1126 # just point at it.
1127 #d-i partman-auto/expert_recipe_file string /hd-media/recipe
1128
1129 # If not, you can put an entire recipe into the preconfiguration file in one
1130 # (logical) line. This example creates a small /boot partition, suitable
1131 # swap, and uses the rest of the space for the root partition:
1132 #d-i partman-auto/expert_recipe string \
1133 # boot-root :: \
1134 # 40 50 100 ext3 \
1135 # $primary{ } $bootable{ } \
1136 # method{ format } format{ } \
1137 # use_filesystem{ } filesystem{ ext3 } \
1138 # mountpoint{ /boot } \
1139 # . \
1140 # 500 10000 1000000000 ext3 \
1141 # method{ format } format{ } \
1142 # use_filesystem{ } filesystem{ ext3 } \
1143 # mountpoint{ / } \
1144 # . \
1145 # 64 512 300% linux-swap \
1146 # method{ swap } format{ } \
1147 # .
1148
1149 # The full recipe format is documented in the file partman-auto-recipe.txt
1150 # included in the 'debian-installer' package or available from D-I source
1151 # repository. This also documents how to specify settings such as file
1152 # system labels, volume group names and which physical devices to include
1153 # in a volume group.
1154
1155 # This makes partman automatically partition without confirmation, provided
1156 # that you told it what to do using one of the methods above.
1157 d-i partman-partitioning/confirm_write_new_label boolean true
1158 d-i partman/choose_partition select finish
1159 d-i partman/confirm boolean true
1160 d-i partman/confirm_nooverwrite boolean true
1161 </screen></informalexample>
1162
1163 </sect3>
1164 <sect3 id="preseed-partman-raid">
1165 <title>Partitioning using RAID</title>
1166 <para>
1167
1168 You can also use preseeding to set up partitions on software RAID arrays.
1169 Supported are RAID levels 0, 1, 5, 6 and 10, creating degraded arrays and
1170 specifying spare devices.
1171
1172 </para><para arch="any-x86">
1173
1174 If you are using RAID 1, you can preseed grub to install to all devices
1175 used in the array; see <xref linkend="preseed-bootloader"/>.
1176
1177 </para>
1178
1179 <warning><para>
1180
1181 This type of automated partitioning is easy to get wrong. It is also
1182 functionality that receives relatively little testing from the developers
1183 of &d-i;. The responsibility to get the various recipes right (so they
1184 make sense and don't conflict) lies with the user.
1185 Check <filename>/var/log/syslog</filename> if you run into problems.
1186
1187 </para></warning>
1188
1189 <informalexample role="example"><screen>
1190 # The method should be set to "raid".
1191 #d-i partman-auto/method string raid
1192 # Specify the disks to be partitioned. They will all get the same layout,
1193 # so this will only work if the disks are the same size.
1194 #d-i partman-auto/disk string /dev/sda /dev/sdb
1195
1196 # Next you need to specify the physical partitions that will be used.
1197 #d-i partman-auto/expert_recipe string \
1198 # multiraid :: \
1199 # 1000 5000 4000 raid \
1200 # $primary{ } method{ raid } \
1201 # . \
1202 # 64 512 300% raid \
1203 # method{ raid } \
1204 # . \
1205 # 500 10000 1000000000 raid \
1206 # method{ raid } \
1207 # .
1208
1209 # Last you need to specify how the previously defined partitions will be
1210 # used in the RAID setup. Remember to use the correct partition numbers
1211 # for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported;
1212 # devices are separated using "#".
1213 # Parameters are:
1214 # &lt;raidtype&gt; &lt;devcount&gt; &lt;sparecount&gt; &lt;fstype&gt; &lt;mountpoint&gt; \
1215 # &lt;devices&gt; &lt;sparedevices&gt;
1216
1217 #d-i partman-auto-raid/recipe string \
1218 # 1 2 0 ext3 / \
1219 # /dev/sda1#/dev/sdb1 \
1220 # . \
1221 # 1 2 0 swap - \
1222 # /dev/sda5#/dev/sdb5 \
1223 # . \
1224 # 0 2 0 ext3 /home \
1225 # /dev/sda6#/dev/sdb6 \
1226 # .
1227
1228 # For additional information see the file partman-auto-raid-recipe.txt
1229 # included in the 'debian-installer' package or available from D-I source
1230 # repository.
1231
1232 # This makes partman automatically partition without confirmation.
1233 d-i partman-md/confirm boolean true
1234 d-i partman-partitioning/confirm_write_new_label boolean true
1235 d-i partman/choose_partition select finish
1236 d-i partman/confirm boolean true
1237 d-i partman/confirm_nooverwrite boolean true
1238 </screen></informalexample>
1239
1240 </sect3>
1241
1242 <sect3 id="preseed-partman-mount-styles">
1243 <title>Controlling how partitions are mounted</title>
1244 <para>
1245
1246 Normally, filesystems are mounted using a universally unique identifier
1247 (UUID) as a key; this allows them to be mounted properly even if their
1248 device name changes. UUIDs are long and difficult to read, so, if you
1249 prefer, the installer can mount filesystems based on the traditional device
1250 names, or based on a label you assign. If you ask the installer to mount by
1251 label, any filesystems without a label will be mounted using a UUID instead.
1252
1253 </para><para>
1254
1255 Devices with stable names, such as LVM logical volumes, will continue to use
1256 their traditional names rather than UUIDs.
1257
1258 </para>
1259
1260 <warning><para>
1261
1262 Traditional device names may change based on the order in which the kernel
1263 discovers devices at boot, which may cause the wrong filesystem to be
1264 mounted. Similarly, labels are likely to clash if you plug in a new disk or
1265 a USB drive, and if that happens your system's behaviour when started will
1266 be random.
1267
1268 </para></warning>
1269
1270 <informalexample role="example"><screen>
1271 # The default is to mount by UUID, but you can also choose "traditional" to
1272 # use traditional device names, or "label" to try filesystem labels before
1273 # falling back to UUIDs.
1274 #d-i partman/mount_style select uuid
1275 </screen></informalexample>
1276
1277 </sect3>
1278 </sect2>
1279
1280 <sect2 id="preseed-base-installer">
1281 <title>Base system installation</title>
1282 <para>
1283
1284 There is actually not very much that can be preseeded for this stage of the
1285 installation. The only questions asked concern the installation of the kernel.
1286
1287 </para>
1288
1289 <informalexample role="example"><screen>
1290 # Configure APT to not install recommended packages by default. Use of this
1291 # option can result in an incomplete system and should only be used by very
1292 # experienced users.
1293 #d-i base-installer/install-recommends boolean false
1294
1295 # The kernel image (meta) package to be installed; "none" can be used if no
1296 # kernel is to be installed.
1297 #d-i base-installer/kernel/image string &kernelpackage;-2.6-486
1298 </screen></informalexample>
1299
1300 </sect2>
1301
1302 <sect2 id="preseed-apt">
1303 <title>Apt setup</title>
1304 <para>
1305
1306 Setup of the <filename>/etc/apt/sources.list</filename> and basic configuration
1307 options is fully automated based on your installation method and answers to
1308 earlier questions. You can optionally add other (local) repositories.
1309
1310 </para>
1311
1312 <informalexample role="example"><screen>
1313 # You can choose to install non-free and contrib software.
1314 #d-i apt-setup/non-free boolean true
1315 #d-i apt-setup/contrib boolean true
1316 # Uncomment this if you don't want to use a network mirror.
1317 #d-i apt-setup/use_mirror boolean false
1318 # Select which update services to use; define the mirrors to be used.
1319 # Values shown below are the normal defaults.
1320 #d-i apt-setup/services-select multiselect security, volatile
1321 #d-i apt-setup/security_host string security.debian.org
1322 #d-i apt-setup/volatile_host string volatile.debian.org
1323
1324 # Additional repositories, local[0-9] available
1325 #d-i apt-setup/local0/repository string \
1326 # http://local.server/debian stable main
1327 #d-i apt-setup/local0/comment string local server
1328 # Enable deb-src lines
1329 #d-i apt-setup/local0/source boolean true
1330 # URL to the public key of the local repository; you must provide a key or
1331 # apt will complain about the unauthenticated repository and so the
1332 # sources.list line will be left commented out
1333 #d-i apt-setup/local0/key string http://local.server/key
1334
1335 # By default the installer requires that repositories be authenticated
1336 # using a known gpg key. This setting can be used to disable that
1337 # authentication. Warning: Insecure, not recommended.
1338 #d-i debian-installer/allow_unauthenticated boolean true
1339 </screen></informalexample>
1340
1341 </sect2>
1342
1343 <sect2 id="preseed-pkgsel">
1344 <title>Package selection</title>
1345 <para>
1346
1347 You can choose to install any combination of tasks that are available.
1348 Available tasks as of this writing include:
1349
1350 </para>
1351
1352 <itemizedlist>
1353 <listitem><para>
1354 <userinput>standard</userinput>
1355 </para></listitem>
1356 <listitem><para>
1357 <userinput>desktop</userinput>
1358 </para></listitem>
1359 <listitem><para>
1360 <userinput>gnome-desktop</userinput>
1361 </para></listitem>
1362 <listitem><para>
1363 <userinput>kde-desktop</userinput>
1364 </para></listitem>
1365 <listitem><para>
1366 <userinput>web-server</userinput>
1367 </para></listitem>
1368 <listitem><para>
1369 <userinput>print-server</userinput>
1370 </para></listitem>
1371 <listitem><para>
1372 <userinput>dns-server</userinput>
1373 </para></listitem>
1374 <listitem><para>
1375 <userinput>file-server</userinput>
1376 </para></listitem>
1377 <listitem><para>
1378 <userinput>mail-server</userinput>
1379 </para></listitem>
1380 <listitem><para>
1381 <userinput>sql-database</userinput>
1382 </para></listitem>
1383 <listitem><para>
1384 <userinput>laptop</userinput>
1385 </para></listitem>
1386 </itemizedlist>
1387
1388 <para>
1389
1390 You can also choose to install no tasks, and force the installation of a
1391 set of packages in some other way. We recommend always including the
1392 <userinput>standard</userinput> task.
1393
1394 </para><para>
1395
1396 If you want to install some individual packages in addition to packages
1397 installed by tasks, you can use the parameter
1398 <classname>pkgsel/include</classname>. The value of this parameter can be
1399 a list of packages separated by either commas or spaces, which allows it
1400 to be used easily on the kernel command line as well.
1401
1402 </para>
1403
1404 <informalexample role="example"><screen>
1405 #tasksel tasksel/first multiselect standard, web-server
1406 # If the desktop task is selected, install the kde and xfce desktops
1407 # instead of the default gnome desktop.
1408 #tasksel tasksel/desktop multiselect kde, xfce
1409
1410 # Individual additional packages to install
1411 #d-i pkgsel/include string openssh-server build-essential
1412 # Whether to upgrade packages after debootstrap.
1413 # Allowed values: none, safe-upgrade, full-upgrade
1414 #d-i pkgsel/upgrade select none
1415
1416 # Some versions of the installer can report back on what software you have
1417 # installed, and what software you use. The default is not to report back,
1418 # but sending reports helps the project determine what software is most
1419 # popular and include it on CDs.
1420 #popularity-contest popularity-contest/participate boolean false
1421 </screen></informalexample>
1422
1423 </sect2>
1424
1425 <sect2 id="preseed-bootloader" arch="any-x86">
1426 <title>Boot loader installation</title>
1427
1428 <informalexample role="example"><screen>
1429 <phrase arch="linux-any"># Grub is the default boot loader (for x86). If you want lilo installed
1430 # instead, uncomment this:
1431 #d-i grub-installer/skip boolean true
1432 # To also skip installing lilo, and install no bootloader, uncomment this
1433 # too:
1434 #d-i lilo-installer/skip boolean true</phrase>
1435 <phrase arch="kfreebsd-any;hurd-any"># To install no bootloader, uncomment this
1436 #d-i grub-installer/skip boolean true</phrase>
1437
1438 # This is fairly safe to set, it makes grub install automatically to the MBR
1439 # if no other operating system is detected on the machine.
1440 d-i grub-installer/only_debian boolean true
1441
1442 # This one makes grub-installer install to the MBR if it also finds some other
1443 # OS, which is less safe as it might not be able to boot that other OS.
1444 d-i grub-installer/with_other_os boolean true
1445
1446 # Alternatively, if you want to install to a location other than the mbr,
1447 # uncomment and edit these lines:
1448 #d-i grub-installer/only_debian boolean false
1449 #d-i grub-installer/with_other_os boolean false
1450 #d-i grub-installer/bootdev string (hd0,0)
1451 # To install grub to multiple disks:
1452 #d-i grub-installer/bootdev string (hd0,0) (hd1,0) (hd2,0)
1453 # To install to a particular device:
1454 #d-i grub-installer/bootdev string /dev/sda
1455
1456 # Optional password for grub, either in clear text
1457 #d-i grub-installer/password password r00tme
1458 #d-i grub-installer/password-again password r00tme
1459 # or encrypted using an MD5 hash, see grub-md5-crypt(8).
1460 #d-i grub-installer/password-crypted password [MD5 hash]
1461
1462 # Use the following option to add additional boot parameters for the
1463 # installed system (if supported by the bootloader installer).
1464 # Note: options passed to the installer will be added automatically.
1465 #d-i debian-installer/add-kernel-opts string nousb
1466 </screen></informalexample>
1467
1468 <para>
1469
1470 An MD5 hash for a password for <classname>grub</classname> can be generated
1471 using <command>grub-md5-crypt</command>, or using the command from the
1472 example in <xref linkend="preseed-account"/>.
1473
1474 </para>
1475 </sect2>
1476
1477 <sect2 id="preseed-finish">
1478 <title>Finishing up the installation</title>
1479
1480 <informalexample role="example"><screen>
1481 # During installations from serial console, the regular virtual consoles
1482 # (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next
1483 # line to prevent this.
1484 #d-i finish-install/keep-consoles boolean true
1485
1486 # Avoid that last message about the install being complete.
1487 d-i finish-install/reboot_in_progress note
1488
1489 # This will prevent the installer from ejecting the CD during the reboot,
1490 # which is useful in some situations.
1491 #d-i cdrom-detect/eject boolean false
1492
1493 # This is how to make the installer shutdown when finished, but not
1494 # reboot into the installed system.
1495 #d-i debian-installer/exit/halt boolean true
1496 # This will power off the machine instead of just halting it.
1497 #d-i debian-installer/exit/poweroff boolean true
1498 </screen></informalexample>
1499
1500 </sect2>
1501
1502 <sect2 id="preseed-other">
1503 <title>Preseeding other packages</title>
1504
1505 <informalexample role="example"><screen>
1506 # Depending on what software you choose to install, or if things go wrong
1507 # during the installation process, it's possible that other questions may
1508 # be asked. You can preseed those too, of course. To get a list of every
1509 # possible question that could be asked during an install, do an
1510 # installation, and then run these commands:
1511 # debconf-get-selections --installer > file
1512 # debconf-get-selections >> file
1513 </screen></informalexample>
1514
1515 </sect2>
1516 </sect1>
1517
1518
1519 <sect1 id="preseed-advanced">
1520 <title>Advanced options</title>
1521
1522 <sect2 id="preseed-hooks">
1523 <title>Running custom commands during the installation</title>
1524 <para>
1525
1526 A very powerful and flexible option offered by the preconfiguration tools
1527 is the ability to run commands or scripts at certain points in the
1528 installation.
1529
1530 </para>
1531
1532 <informalexample role="example"><screen>
1533 # d-i preseeding is inherently not secure. Nothing in the installer checks
1534 # for attempts at buffer overflows or other exploits of the values of a
1535 # preconfiguration file like this one. Only use preconfiguration files from
1536 # trusted locations! To drive that home, and because it's generally useful,
1537 # here's a way to run any shell command you'd like inside the installer,
1538 # automatically.
1539
1540 # This first command is run as early as possible, just after
1541 # preseeding is read.
1542 #d-i preseed/early_command string anna-install some-udeb
1543 # This command is run immediately before the partitioner starts. It may be
1544 # useful to apply dynamic partitioner preseeding that depends on the state
1545 # of the disks (which may not be visible when preseed/early_command runs).
1546 #d-i partman/early_command \
1547 # string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
1548 # This command is run just before the install finishes, but when there is
1549 # still a usable /target directory. You can chroot to /target and use it
1550 # directly, or use the apt-install and in-target commands to easily install
1551 # packages and run commands in the target system.
1552 #d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
1553 </screen></informalexample>
1554
1555 </sect2>
1556
1557 <sect2 id="preseed-seenflag">
1558 <title>Using preseeding to change default values</title>
1559 <para>
1560
1561 It is possible to use preseeding to change the default answer for a
1562 question, but still have the question asked. To do this the
1563 <firstterm>seen</firstterm> flag must be reset to <quote>false</quote> after
1564 setting the value for a question.
1565
1566 <informalexample><screen>
1567 d-i foo/bar string value
1568 d-i foo/bar seen false
1569 </screen></informalexample>
1570
1571 The same effect can be achieved for <emphasis>all</emphasis> questions by
1572 setting the parameter <classname>preseed/interactive=true</classname> at
1573 the boot prompt. This can also be useful for testing or debugging your
1574 preconfiguration file.
1575
1576 </para><para>
1577
1578 Note that the <quote>d-i</quote> owner should only be used for variables
1579 used in the installer itself. For variables belonging to packages installed
1580 on the target system, you should use the name of that package instead. See
1581 the footnote to <xref linkend="preseed-bootparms"/>.
1582
1583 </para><para>
1584
1585 If you are preseeding using boot parameters, you can make the installer ask
1586 the corresponding question by using the <quote>?=</quote> operator, i.e.
1587 <userinput><replaceable>foo</replaceable>/<replaceable>bar</replaceable>?=<replaceable>value</replaceable></userinput>
1588 (or <userinput><replaceable>owner</replaceable>:<replaceable>foo/bar</replaceable>?=<replaceable>value</replaceable></userinput>).
1589 This will of course only have effect for parameters that correspond to
1590 questions that are actually displayed during an installation and not for
1591 <quote>internal</quote> parameters.
1592
1593 </para>
1594 </sect2>
1595
1596 <sect2 id="preseed-chainload">
1597 <title>Chainloading preconfiguration files</title>
1598 <para>
1599
1600 It is possible to include other preconfiguration files from a preconfiguration
1601 file. Any settings in those files will override pre-existing settings from
1602 files loaded earlier. This makes it possible to put, for example, general
1603 networking settings for your location in one file and more specific
1604 settings for certain configurations in other files.
1605
1606 </para>
1607
1608 <informalexample><screen>
1609 # More than one file can be listed, separated by spaces; all will be
1610 # loaded. The included files can have preseed/include directives of their
1611 # own as well. Note that if the filenames are relative, they are taken from
1612 # the same directory as the preconfiguration file that includes them.
1613 #d-i preseed/include string x.cfg
1614
1615 # The installer can optionally verify checksums of preconfiguration files
1616 # before using them. Currently only md5sums are supported, list the md5sums
1617 # in the same order as the list of files to include.
1618 #d-i preseed/include/checksum string 5da499872becccfeda2c4872f9171c3d
1619
1620 # More flexibly, this runs a shell command and if it outputs the names of
1621 # preconfiguration files, includes those files.
1622 #d-i preseed/include_command \
1623 # string if [ "`hostname`" = bob ]; then echo bob.cfg; fi
1624
1625 # Most flexibly of all, this downloads a program and runs it. The program
1626 # can use commands such as debconf-set to manipulate the debconf database.
1627 # More than one script can be listed, separated by spaces.
1628 # Note that if the filenames are relative, they are taken from the same
1629 # directory as the preconfiguration file that runs them.
1630 #d-i preseed/run string foo.sh
1631 </screen></informalexample>
1632
1633 <para>
1634
1635 It is also possible to chainload from the initrd or file preseeding phase,
1636 into network preseeding by setting preseed/url in the earlier files.
1637 This will cause network preseeding to be performed when the network comes
1638 up. You need to be careful when doing this, since there will be two
1639 distinct runs at preseeding, meaning for example that you get another
1640 chance to run the preseed/early command, the second one happening after the
1641 network comes up.
1642
1643 </para>
1644
1645 </sect2>
1646 </sect1>
1647 </appendix>

Properties

Name Value
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.5