/[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 37282 - (hide annotations) (download) (as text)
Sat May 13 21:58:54 2006 UTC (7 years ago) by holger-guest
File MIME type: text/xml
File size: 38809 byte(s)
fixed typo
1 fjp 32199 <!-- retain these comments for translator revision tracking -->
2 joeyh 32508 <!-- $Id$ -->
3 fjp 32199
4     <!--
5 fjp 32424 Be carefull 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 32501 This appendix explains the intricacies of preseeding answers to questions in
21 fjp 32276 &d-i; to automate your installation.
22    
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     </para>
41    
42     <sect2 id="preseed-methods">
43     <title>Preseeding methods</title>
44     <para>
45    
46     There are three methods that can be used for preseeding:
47     <firstterm>initrd</firstterm>, <firstterm>file</firstterm> and
48     <firstterm>network</firstterm>. Initrd preseeding will work with any
49 joeyh 32501 installation method and supports preseeding of more things, but it requires
50     the most preparation. File and network preseeding each can be used with
51     different installation methods. With file and network preseeding the first
52 fjp 36205 few installer questions cannot be preseeded because the preconfiguration
53 joeyh 32501 file is only loaded after they have been asked.
54 fjp 32424
55     </para><para>
56    
57     The following table shows which preseeding methods can be used with which
58     installation methods.
59    
60     <informaltable>
61     <tgroup cols="4">
62     <thead>
63     <row>
64     <entry>Installation method</entry><entry>initrd</entry>
65     <entry>file</entry><entry>network</entry>
66     </row>
67     </thead>
68    
69     <tbody>
70     <row>
71 joeyh 32501 <entry>CD/DVD</entry>
72 fjp 32424 <entry>yes</entry>
73     <entry>yes</entry>
74     <entry>no</entry>
75     </row><row>
76     <entry>netboot</entry>
77     <entry>yes</entry>
78     <entry>no</entry>
79     <entry>yes</entry>
80     </row><row>
81     <entry>hd-media <phrase condition="bootable-usb">(including usb-stick)</phrase></entry>
82     <entry>yes</entry>
83     <entry>yes</entry>
84     <entry>no</entry>
85     </row><row condition="supports-floppy-boot">
86     <entry>floppy based (cd-drivers)</entry>
87     <entry>yes</entry>
88     <entry>yes</entry>
89     <entry>no</entry>
90     </row><row condition="supports-floppy-boot">
91     <entry>floppy based (net-drivers)</entry>
92     <entry>yes</entry>
93     <entry>no</entry>
94     <entry>yes</entry>
95     </row><row arch="s390">
96     <entry>generic/tape</entry>
97     <entry>yes</entry>
98     <entry>no</entry>
99     <entry>yes</entry>
100     </row>
101     </tbody>
102    
103     </tgroup></informaltable>
104    
105     </para><para>
106    
107     An important difference between the preseeding methods is the point at which
108 fjp 36205 the preconfiguration file is loaded and processed. For initrd preseeding
109 fjp 32424 this is right at the start of the installation, before the first question is
110 joeyh 32501 even asked. For file preseeding this is after the CD or CD image has been
111 fjp 32424 loaded. For network preseeding it is only after the network has been
112     configured.
113    
114     </para><para>
115    
116     In practical terms this means for file and network preseeding that the
117     questions about language, country and keyboard selection will already have
118     been asked. For network preseeding add to that any questions related to
119     network configuration. Some other questions that are only displayed
120     at medium or low priority (like the first hardware detection run) will
121 joeyh 32501 also already have been processed.
122 fjp 32424
123     </para><para>
124    
125     Obviously, any questions that have been processed before the
126 fjp 36205 preconfiguration file is loaded cannot be preseeded.
127 fjp 32424 <xref linkend="preseed-bootparms"/> offers a way to avoid these
128     questions being asked.
129    
130     </para>
131     </sect2>
132    
133     <sect2 id="preseed-limitations">
134     <title>Limitations</title>
135     <para>
136    
137 joeyh 32501 Although most questions used by &d-i; can be preseeded using this method,
138     there are some notable exceptions. You must (re)partition an entire disk
139 fjp 32424 or use available free space on a disk; it is not possible to use existing
140 joeyh 35031 partitions. You currently cannot use preseeding to set up RAID.
141 fjp 32424
142     </para>
143     </sect2>
144    
145 fjp 32504 <!-- Joeyh feels this is too technical, so leave it out for now
146 fjp 32424 <sect2 id="preseed-debconf">
147     <title>Debconf basics</title>
148     <para>
149    
150     Preseeding makes use of the <classname>debconf</classname> framework. This
151     framework is the preferred mechanism used in Debian to interact with the user
152     when configuring packages and also forms the heart of &d-i;.
153     In the <classname>debconf</classname> framework questions or dialogs are
154     based on <firstterm>templates</firstterm>. There are different types of
155     templates for different types of questions. The actual questions are
156     <quote>generated</quote> from templates at runtime; multiple questions can
157     use the same template.
158    
159     </para><para>
160    
161     The following types of templates are relevant for preseeding.
162    
163 fjp 36269 </para>
164    
165 fjp 32199 <itemizedlist>
166     <listitem><para>
167 fjp 32424 string: allows the user to type any value
168 fjp 32199 </para></listitem>
169     <listitem><para>
170 fjp 32424 password: similar to string but the value typed is not displayed
171 fjp 32199 </para></listitem>
172     <listitem><para>
173 fjp 32424 boolean: for yes/no or true/false type of questions
174 fjp 32199 </para></listitem>
175     <listitem><para>
176 fjp 32424 select: allows the user to select one option from a list
177 fjp 32199 </para></listitem>
178     <listitem><para>
179 fjp 32424 multiselect: allows the user to select zero, one or more options from a list
180 fjp 32199 </para></listitem>
181     <listitem><para>
182 fjp 32424 note: used to display a message
183 fjp 32199 </para></listitem>
184     </itemizedlist>
185    
186 fjp 36269 <para>
187 fjp 32424
188     In &d-i; templates are stored in a readable file
189 joeyh 32501 <filename>/var/cache/debconf/templates.dat</filename>. This file contains all fixed
190 fjp 32424 text and all translations. It can also contain a default value for the
191     template. The fixed text can include variables that will be replaced at
192     runtime.
193    
194     </para><para>
195    
196 joeyh 32501 Another readable file <filename>/var/cache/debconf/questions.dat</filename>
197     is used to store the values for variables and the answers given to questions.
198 fjp 32424 A question always refers to the template used to ask it. For obvious
199 joeyh 37231 security reasons the values for questions of type <quote>password</quote>
200 fjp 32424 are stored in a separate, non-readable file in the same directory.
201    
202     </para>
203     </sect2>
204 fjp 32504 -->
205 fjp 32424
206     <sect2 id="preseed-hooks">
207     <title>Running custom commands during the installation</title>
208     <para>
209    
210 fjp 36205 A very powerful and flexible option offered by the preconfiguration tools
211     is the ability to run commands or scripts at certain points in the
212     installation. See <xref linkend="preseed-shell"/> for details.
213 fjp 32424
214     </para>
215    
216     <itemizedlist>
217     <listitem><para>
218 fjp 36214 <userinput>preseed/early_command</userinput>: is run as soon as the
219 fjp 36205 preconfiguration file has been loaded
220 fjp 32424 </para></listitem>
221     <listitem><para>
222     <userinput>preseed/late_command</userinput>: is run just before the reboot
223 joeyh 33719 at the end of the install, but before the <filename>/target</filename>
224     filesystem has been unmounted
225 fjp 32424 </para></listitem>
226     </itemizedlist>
227    
228     </sect2>
229    
230     <sect2 id="preseed-seenflag">
231     <title>Using preseeding to change default values</title>
232     <para>
233    
234     It is possible to use preseeding to change the default answer for a
235     question, but still have the question asked. To do this the
236     <firstterm>seen</firstterm> flag must be reset to <quote>false</quote> after
237 joeyh 37231 setting the value for a question.
238 fjp 32424
239     </para>
240    
241     <informalexample><screen>
242     d-i foo/bar string value
243     d-i foo/bar seen false
244     </screen></informalexample>
245    
246     </sect2>
247 fjp 32276 </sect1>
248 fjp 32199
249 fjp 32276 <sect1 id="preseed-using">
250 fjp 32199 <title>Using preseeding</title>
251 fjp 32424 <para>
252 fjp 32199
253 fjp 36205 Of course you will first need to create a preconfiguration file and place it in
254     the location from where you want to use it. Creating the preconfiguration file
255     is covered later in this appendix. Putting it in the correct location is fairly
256 fjp 32424 straightforward for network preseeding or if you want to read the file off
257     a floppy or usb-stick. If you want to include the file on a CD or DVD, you
258 fjp 36205 will have to remaster the ISO image. How to get the preconfiguration file
259     included in the initrd is outside the scope of this document; please consult
260     the developers documentation for &d-i;.
261 fjp 32424
262 fjp 32504 </para><para>
263    
264 fjp 36205 An example preconfiguration file that you can use as basis for your own
265     preconfiguration file is available from &urlset-example-preseed;. This file is
266     based on the configuration fragments included in this appendix.
267 fjp 32504
268 fjp 32424 </para>
269    
270 fjp 32276 <sect2 id="preseed-loading">
271 fjp 36205 <title>Loading the preconfiguration file</title>
272 fjp 32199 <para>
273    
274 fjp 32424 If you are using initrd preseeding, you only have to make sure a file named
275 fjp 32199 <filename>preseed.cfg</filename> is included in the root directory of the
276     initrd. The installer will automatically check if this file is present and
277     load it.
278    
279     </para><para>
280    
281 joeyh 35032 For the other preseeding methods you need to tell the installer what file
282     to use when you boot it. This is normally done by passing the kernel a boot
283     parameter, either manually at boot time or by editing the bootloader
284     configuration file (e.g. <filename>syslinux.cfg</filename>) and adding the
285     parameter to the end of the append line(s) for the kernel.
286 fjp 32199
287     </para><para>
288    
289 fjp 36205 If you do specify the preconfiguration file in the bootloader configuration,
290     you might change the configuration so you don't need to hit enter to boot the
291     installer. For syslinux this means setting the timeout to <literal>1</literal>
292     in <filename>syslinux.cfg</filename>.
293 fjp 32199
294     </para><para>
295    
296 fjp 36205 To make sure the installer gets the right preconfiguration file, you can
297     optionally specify a checksum for the file. Currently this needs to be a
298     md5sum, and if specified it must match the preconfiguration file or the
299     installer will refuse to use it.
300 fjp 32199
301     </para>
302    
303     <informalexample><screen>
304 fjp 32424 Boot parameters to specify:
305     - if you're netbooting:
306     preseed/url=http://host/path/to/preseed.cfg
307     preseed/url/checksum=5da499872becccfeda2c4872f9171c3d
308    
309     - if you're booting a remastered CD:
310     preseed/file=/cdrom/preseed.cfg
311     preseed/file/checksum=5da499872becccfeda2c4872f9171c3d
312    
313 fjp 36205 - if you're installing from USB media (put the preconfiguration file in the
314 fjp 32424 toplevel directory of the USB stick):
315     preseed/file=/hd-media/preseed.cfg
316     preseed/file/checksum=5da499872becccfeda2c4872f9171c3d
317 fjp 32199 </screen></informalexample>
318    
319     <para>
320    
321     While you're at it, you may want to add a boot parameter
322     <userinput>debconf/priority=critical</userinput>. This will avoid most
323     questions even if the preseeding below misses some.
324    
325     </para>
326 fjp 32276 </sect2>
327 joeyh 35032
328     <sect2 id="preseed-dhcp">
329 fjp 36205 <title>Using a DHCP server to specify preconfiguration files</title>
330 joeyh 35032 <para>
331 fjp 32199
332 fjp 36205 It's also possible to use DHCP to specify a preconfiguration file to download
333     from the network. DHCP allows specifying a filename. Normally this is a file
334     to netboot, but if it appears to be an URL then installation media that
335     support network preseeding will download the file from the URL and use it as a
336     preconfiguration file. Here is an example of how to set it up in the dhcpd.conf
337 joeyh 35032 for version 3 of the ISC DHCP server (the dhcp3-server Debian package).
338    
339     </para>
340    
341     <informalexample><screen>
342     if substring (option vendor-class-identifier, 0, 3) = "d-i" {
343 fjp 36204 filename "http://host/preseed.cfg";
344 joeyh 35032 }
345     </screen></informalexample>
346    
347     <para>
348 fjp 35033
349 joeyh 35032 Note that the above example limits this filename to DHCP clients that identify
350     themselves as "d-i", so it will not affect regular DHCP clients, but only
351     the installer. You can also put the text in a stanza for only one particular
352     host to avoid preseeding all installs on your network.
353    
354     </para><para>
355 fjp 35033
356 joeyh 35032 A good way to use the DHCP preseeding is to only preseed values specific to
357     your network, such as the Debian mirror to use. This way installs on your
358     network will automatically get a good mirror selected, but the rest of the
359     installation can be performed interactively. Using DHCP preseeding to fully
360     automate Debian installs should only be done with care.
361 fjp 35033
362 joeyh 35032 </para>
363 fjp 35051 </sect2>
364 joeyh 35032
365 fjp 32276 <sect2 id="preseed-bootparms">
366 fjp 32199 <title>Using boot parameters to supplement preseeding</title>
367     <para>
368    
369 fjp 32276 Some parts of the installation process cannot be automated using some forms
370 fjp 36205 of preseeding because the questions are asked before the preconfiguration
371     file is loaded. For example, if the preconfiguration file is downloaded over
372     the network, the network setup must be done first. One reason to use initrd
373     preseeding is that it allows preseeding of even these early steps of the
374     installation process.
375 fjp 32199
376     </para><para>
377    
378 fjp 36205 If a preconfiguration file cannot be used to preseed some steps, the install
379     can still be fully automated, since you can pass preseed values to the kernel
380 fjp 32199 on the command line. Just pass <userinput>path/to/var=value</userinput>
381     for any of the preseed variables listed in the examples.
382    
383 fjp 36758 </para><para>
384    
385     A <quote>&ndash;&ndash;</quote> in the boot options has special meaning.
386     Kernel parameters that appear after it will be copied into the installed
387     bootloader configuration (if supported by the installer for the
388     bootloader). Note that the <quote>&ndash;&ndash;</quote> may already be
389     present in the default boot parameters.
390    
391 fjp 32199 </para>
392     <note><para>
393    
394     The 2.4 kernel accepts a maximum of 8 command line options and
395     8 environment options (including any options added by default for the
396     installer). If these numbers are exceeded, 2.4 kernels will drop any
397 fjp 32424 excess options and 2.6 kernels will panic. For kernel 2.6.9 and later,
398 fjp 32199 you can use 32 command line options and 32 environment options.
399    
400     </para></note>
401 fjp 32276 <para>
402    
403     For most installations some of the default options in your bootloader
404 fjp 36204 configuration file, like <literal>vga=normal</literal>, may be safely
405     removed which may allow you to add more options for preseeding.
406 fjp 32276
407     </para>
408 fjp 32199 <note><para>
409    
410 fjp 32276 It may not always be possible to specify values with spaces for boot
411     parameters, even if you delimit them with quotes.
412 fjp 32199
413     </para></note>
414 fjp 32276 </sect2>
415     </sect1>
416 fjp 32199
417 fjp 36204 <sect1 id="preseed-creating">
418 fjp 36205 <title>Creating a preconfiguration file</title>
419 fjp 32424 <para>
420 fjp 32199
421 fjp 32424 The preconfiguration file is in the format used by the
422 fjp 36204 <command>debconf-set-selections</command> command. The general format of
423     a line in a preconfiguration file is:
424 fjp 32424
425 fjp 36204 <informalexample><screen>
426 holger-guest 37282 &lt;owner&gt; &lt;question name&gt; &lt;question type&gt; &lt;value&gt;
427 fjp 36204 </screen></informalexample>
428 fjp 32424
429 fjp 36204 </para><para>
430    
431     There are a few rules to keep in mind when writing a preconfiguration file.
432    
433 fjp 36267 </para>
434    
435 fjp 32199 <itemizedlist>
436 fjp 36267 <listitem><para>
437 fjp 36204 Put only a single space or tab between type and value: any additional
438     whitespace will be interpreted as belonging to the value.
439 fjp 36267 </para></listitem>
440     <listitem><para>
441 fjp 36204 A line can be split into multiple lines by appending a backslash
442 fjp 36214 (<quote><literal>\</literal></quote>) as the line continuation character.
443 joeyh 37231 A good place to split a line is after the question name; a bad place is
444 fjp 36204 between type and value.
445 fjp 36267 </para></listitem>
446     <listitem><para>
447 joeyh 37231 Most questions need to be preseeded using the values valid in English and
448     not the translated values. However, there are some questions (for example
449 fjp 36204 in <classname>partman</classname> where the translated values need to be
450     used.
451 fjp 36267 </para></listitem>
452     <listitem><para>
453 joeyh 37231 Some questions take a code as value instead of the English text that is
454 fjp 36204 shown during installation.
455 fjp 36267 </para></listitem>
456 fjp 32199 </itemizedlist>
457    
458 fjp 36267 <para>
459 fjp 36204
460     The easiest way to create a preconfiguration file is to use the example file
461     linked in <xref linkend="preseed-contents"/> as basis and work from there.
462    
463     </para><para>
464    
465     An alternative method is to do a manual installation and then, after
466     rebooting, use the <command>debconf-get-selections</command> from the
467     <classname>debconf-utils</classname> package to dump both the debconf
468     database and the installer's cdebconf database to a single file:
469    
470     <informalexample><screen>
471     $ debconf-get-selections --installer &gt; <replaceable>file</replaceable>
472     $ debconf-get-selections &gt;&gt; <replaceable>file</replaceable>
473     </screen></informalexample>
474    
475     </para><para>
476    
477     However, a file generated in this manner will have some items that should
478     not be preseeded, and the example file is a better starting place for most
479     users.
480    
481     </para>
482    
483     <note><para>
484    
485     This method relies on the fact that, at the end of the installation, the
486     installer's cdebconf database is saved to the installed system in
487     <filename>/var/log/installer/cdebconf</filename>. However, because the
488     database may contain sensitive information, by default the files are only
489     readable by root.
490    
491     </para><para>
492    
493     The directory <filename>/var/log/installer</filename> and all files in it
494     will be deleted from your system if you purge the package
495     <classname>installation-report</classname>.
496    
497     </para></note>
498    
499 fjp 32199 <para>
500    
501 joeyh 37231 To check possible values for questions, you can use <command>nano</command>
502 fjp 36204 to examine the files in <filename>/var/lib/cdebconf</filename> while an
503     installation is in progress. View <filename>templates.dat</filename> for
504     the raw templates and <filename>questions.dat</filename> for the current
505     values and for the values assigned to variables.
506    
507     </para><para>
508    
509 fjp 36205 To check if the format of your preconfiguration file is valid before performing
510     an install, you can use the command <command>debconf-set-selections -c
511 fjp 32276 <replaceable>preseed.cfg</replaceable></command>.
512    
513 fjp 32199 </para>
514 fjp 32276 </sect1>
515 fjp 32199
516 joeyh 33719 <sect1 id="preseed-contents">
517 fjp 36205 <title>Contents of the preconfiguration file</title>
518 fjp 32199 <para>
519    
520     The configuration fragments used in this appendix are also available as an
521 fjp 36205 example preconfiguration file from &urlset-example-preseed;.
522 fjp 32199
523     </para><para>
524    
525     Note that this example is based on an installation for the Intel x86
526     architecture. If you are installing a different architecture, some of the
527     examples (like keyboard selection and bootloader installation) may not be
528 fjp 36205 relevant and will need to be replaced by debconf settings appropriate for
529     your architecture.
530 fjp 32199
531     </para>
532    
533 fjp 32276 <sect2 id="preseed-l10n">
534 fjp 32199 <title>Localization</title>
535     <para>
536    
537     Setting localization values will only work if you are using initrd preseeding.
538 fjp 36205 With all other methods the preconfiguration file will only be loaded after
539     these questions have been asked.
540 fjp 32199
541     </para><para>
542    
543     The locale can be used to specify both language and country.
544     To specify the locale as a boot parameter, use
545     <userinput>debian-installer/locale=<replaceable>en_US</replaceable></userinput>.
546    
547 fjp 32424 <informalexample role="example"><screen>
548 fjp 32199 # Locale sets language and country.
549     d-i debian-installer/locale string en_US
550     </screen></informalexample>
551    
552     </para><para>
553    
554 fjp 32276 Keyboard configuration consists of selecting a keyboard architecture and a
555     keymap. In most cases the correct keyboard architecture is selected by
556 joeyh 32501 default, so there's normally no need to preseed it. The keymap must
557     be valid for the selected keyboard architecture.
558 fjp 32199
559 fjp 32424 <informalexample role="example"><screen>
560     # Keyboard selection.
561     #d-i console-tools/archs select at
562     d-i console-keymaps-at/keymap select us
563     # Example for a different keyboard architecture
564     #d-i console-keymaps-usb/keymap select mac-usb-us
565     </screen></informalexample>
566    
567 fjp 32276 </para><para>
568    
569 fjp 36205 To skip keyboard configuration, preseed
570 fjp 32276 <classname>console-tools/archs</classname> with
571     <userinput>skip-config</userinput>.
572     This will result in the kernel keymap remaining active.
573    
574     </para>
575    
576     <note><para>
577 fjp 32199
578 fjp 32276 The changes in the input layer for 2.6 kernels have made the keyboard
579     architecture virtually obsolete. For 2.6 kernels normally a <quote>PC</quote>
580     (<userinput>at</userinput>) keymap should be selected.
581    
582     </para></note>
583     </sect2>
584    
585     <sect2 id="preseed-network">
586 fjp 32199 <title>Network configuration</title>
587     <para>
588    
589     Of course, preseeding the network configuration won't work if you're
590 fjp 36205 loading your preconfiguration file from the network. But it's great when
591     you're booting from CD or USB stick. If you are loading preconfiguration
592     files from the network, you can pass network config parameters by using
593     kernel boot parameters.
594 fjp 32199
595 cjwatson 33890 </para><para>
596 fjp 32200
597 cjwatson 33890 If you need to pick a particular interface when netbooting before loading
598 fjp 36205 a preconfiguration file from the network, use a boot parameter such as
599 cjwatson 33890 <userinput>netcfg/choose_interface=<replaceable>eth1</replaceable></userinput>.
600    
601 cjwatson 33891 </para>
602    
603 fjp 32424 <informalexample role="example"><screen>
604 fjp 32199 # netcfg will choose an interface that has link if possible. This makes it
605     # skip displaying a list if there is more than one interface.
606     d-i netcfg/choose_interface select auto
607    
608 cjwatson 33890 # To pick a particular interface instead:
609     #d-i netcfg/choose_interface select eth1
610    
611 fjp 32199 # If you have a slow dhcp server and the installer times out waiting for
612     # it, this might be useful.
613     #d-i netcfg/dhcp_timeout string 60
614    
615 joeyh 34168 # If you prefer to configure the network manually, uncomment this line and
616     # the static network configuration below.
617 fjp 32199 #d-i netcfg/disable_dhcp boolean true
618 joeyh 34168
619 fjp 36205 # If you want the preconfiguration file to work on systems both with and
620     # without a dhcp server, uncomment these lines and the static network
621     # configuration below.
622 joeyh 34168 #d-i netcfg/dhcp_failed note
623     #d-i netcfg/dhcp_options select Configure network manually
624    
625     # Static network configuration.
626 fjp 32199 #d-i netcfg/get_nameservers string 192.168.1.1
627     #d-i netcfg/get_ipaddress string 192.168.1.42
628     #d-i netcfg/get_netmask string 255.255.255.0
629     #d-i netcfg/get_gateway string 192.168.1.1
630     #d-i netcfg/confirm_static boolean true
631    
632     # Any hostname and domain names assigned from dhcp take precedence over
633     # values set here. However, setting the values still prevents the questions
634     # from being shown, even if values come from dhcp.
635     d-i netcfg/get_hostname string unassigned-hostname
636     d-i netcfg/get_domain string unassigned-domain
637    
638     # Disable that annoying WEP key dialog.
639     d-i netcfg/wireless_wep string
640     # The wacky dhcp hostname that some ISPs use as a password of sorts.
641     #d-i netcfg/dhcp_hostname string radish
642     </screen></informalexample>
643    
644 fjp 32276 </sect2>
645 fjp 32199
646 fjp 32276 <sect2 id="preseed-mirror">
647 fjp 32199 <title>Mirror settings</title>
648     <para>
649    
650 cjwatson 33889 Depending on the installation method you use, a mirror may be used both to
651 fjp 32199 download additional components of the installer, the base system and to
652     set up the <filename>/etc/apt/sources.list</filename> for the installed
653     system.
654    
655     </para><para>
656    
657     The parameter <classname>mirror/suite</classname> determines the suite for
658     the installed system.
659    
660     </para><para>
661    
662     The parameter <classname>mirror/udeb/suite</classname> determines the suite
663     for additional components for the installer. It is only useful to set this
664     if components are actually downloaded over the network and should match the
665     suite that was used to build the initrd for the installation method used for
666     the installation.
667 fjp 36205 By default the value for <classname>mirror/udeb/suite</classname> is the
668     same as <classname>mirror/suite</classname>.
669 fjp 32199
670     </para>
671    
672 fjp 32424 <informalexample role="example"><screen>
673 fjp 32199 d-i mirror/country string enter information manually
674     d-i mirror/http/hostname string http.us.debian.org
675     d-i mirror/http/directory string /debian
676     d-i mirror/http/proxy string
677    
678     # Suite to install.
679     #d-i mirror/suite string testing
680     # Suite to use for loading installer components (optional).
681     #d-i mirror/udeb/suite string testing
682     </screen></informalexample>
683    
684 fjp 32276 </sect2>
685 fjp 32199
686 fjp 32276 <sect2 id="preseed-partman">
687 fjp 32199 <title>Partitioning</title>
688 fjp 32276 <para>
689 fjp 32199
690 fjp 32276 Using preseeding to partition the harddisk is very much limited to what is
691     supported by <classname>partman-auto</classname>. You can choose to either
692     partition existing free space on a disk or a whole disk. The layout of the
693     disk can be determined by using a predefined recipe, a custom recipe from
694 fjp 36205 a recipe file or a recipe included in the preconfiguration file. It is
695     currently not possible to partition multiple disks using preseeding nor to
696     set up RAID.
697 fjp 32276
698     </para>
699    
700     <warning><para>
701    
702     The identification of disks is dependent on the order in which their drivers
703     are loaded. If there are multiple disks in the system, make very sure the
704     correct one will be selected before using preseeding.
705    
706     </para></warning>
707    
708 fjp 32424 <informalexample role="example"><screen>
709 fjp 32199 # If the system has free space you can choose to only partition that space.
710 joeyh 37231 # Note: this must be preseeded with a localized (translated) value.
711 fjp 32199 #d-i partman-auto/init_automatically_partition \
712     # select Use the largest continuous free space
713    
714     # Alternatively, you can specify a disk to partition. The device name can
715     # be given in either devfs or traditional non-devfs format.
716     # For example, to use the first disk devfs knows of:
717     d-i partman-auto/disk string /dev/discs/disc0/disc
718    
719 fjp 35039 # You can choose from any of the predefined partitioning recipes.
720 joeyh 37231 # Note: this must be preseeded with a localized (translated) value.
721 fjp 32199 d-i partman-auto/choose_recipe \
722     select All files in one partition (recommended for new users)
723     #d-i partman-auto/choose_recipe \
724     # select Separate /home partition
725     #d-i partman-auto/choose_recipe \
726     # select Separate /home, /usr, /var, and /tmp partitions
727    
728     # Or provide a recipe of your own...
729     # The recipe format is documented in the file devel/partman-auto-recipe.txt.
730     # If you have a way to get a recipe file into the d-i environment, you can
731     # just point at it.
732     #d-i partman-auto/expert_recipe_file string /hd-media/recipe
733    
734 fjp 36205 # If not, you can put an entire recipe the preconfiguration file in one
735     # (logical) line. This example creates a small /boot partition, suitable
736     # swap, and uses the rest of the space for the root partition:
737 fjp 32199 #d-i partman-auto/expert_recipe string \
738     # boot-root :: \
739     # 40 50 100 ext3 \
740     # $primary{ } $bootable{ } \
741     # method{ format } format{ } \
742     # use_filesystem{ } filesystem{ ext3 } \
743     # mountpoint{ /boot } \
744     # . \
745     # 500 10000 1000000000 ext3 \
746     # method{ format } format{ } \
747     # use_filesystem{ } filesystem{ ext3 } \
748     # mountpoint{ / } \
749     # . \
750     # 64 512 300% linux-swap \
751     # method{ swap } format{ } \
752     # .
753    
754     # This makes partman automatically partition without confirmation.
755     d-i partman/confirm_write_new_label boolean true
756     d-i partman/choose_partition \
757     select Finish partitioning and write changes to disk
758     d-i partman/confirm boolean true
759     </screen></informalexample>
760    
761 fjp 32276 </sect2>
762 fjp 32199
763 fjp 32276 <sect2 id="preseed-time">
764 fjp 32199 <title>Clock and time zone setup</title>
765    
766 fjp 32424 <informalexample role="example"><screen>
767 fjp 32199 # Controls whether or not the hardware clock is set to UTC.
768     d-i clock-setup/utc boolean true
769    
770     # You may set this to any valid setting for $TZ; see the contents of
771     # /usr/share/zoneinfo/ for valid values.
772     d-i time/zone string US/Eastern
773     </screen></informalexample>
774    
775 fjp 32276 </sect2>
776 fjp 32199
777 fjp 32504 <sect2 id="preseed-apt">
778     <title>Apt setup</title>
779     <para>
780    
781     Setup of the <filename>/etc/apt/sources.list</filename> and basic configuration
782     options is fully automated based on your installation method and answers to
783 fjp 35924 earlier questions. You can optionally add other (local) repositories.
784 fjp 32504
785     </para>
786    
787     <informalexample role="example"><screen>
788     # You can choose to install non-free and contrib software.
789     #d-i apt-setup/non-free boolean true
790     #d-i apt-setup/contrib boolean true
791 joeyh 35836 # Uncomment this to avoid adding security sources, or
792     # add a hostname to use a different server than security.debian.org.
793 fjp 35924 #d-i apt-setup/security_host string
794    
795     # Additional repositories, local[0-9] available
796     #d-i apt-setup/local0/comment string local server
797     #d-i apt-setup/local0/repository string \
798     # deb http://local.server/debian stable main
799 fjp 35982 # URL to the public key of the local repository
800 fjp 35924 #d-i apt-setup/local0/key string http://local.server/key
801 fjp 32504 </screen></informalexample>
802    
803     </sect2>
804    
805 fjp 32424 <sect2 id="preseed-account">
806 fjp 32199 <title>Account setup</title>
807     <para>
808    
809     The password for the root account and name and password for a first regular
810     user's account can be preseeded. For the passwords you can use either clear
811     text values or MD5 <emphasis>hashes</emphasis>.
812    
813     </para>
814     <warning><para>
815    
816     Be aware that preseeding passwords is not completely secure as everyone
817 fjp 36205 with access to the preconfiguration file will have the knowledge of these
818     passwords. Using MD5 hashes is considered slightly better in terms of
819     security but it might also give a false sense of security as access to a
820     MD5 hash allows for brute force attacks.
821 fjp 32199
822     </para></warning>
823    
824 fjp 32424 <informalexample role="example"><screen>
825 joeyh 36167 # Skip creation of a root account (normal user account will be able to
826     # use sudo).
827     #d-i passwd/root-login boolean false
828     # Alternatively, to skip creation of a normal user account.
829     #d-i passwd/make-user boolean false
830    
831 fjp 32199 # Root password, either in clear text
832 fjp 33865 #d-i passwd/root-password password r00tme
833     #d-i passwd/root-password-again password r00tme
834 fjp 32199 # or encrypted using an MD5 hash.
835 fjp 33865 #d-i passwd/root-password-crypted password [MD5 hash]
836 fjp 32199
837 joeyh 36167 # To create a normal user account.
838 fjp 33865 #d-i passwd/user-fullname string Debian User
839     #d-i passwd/username string debian
840 fjp 32199 # Normal user's password, either in clear text
841 fjp 33865 #d-i passwd/user-password password insecure
842     #d-i passwd/user-password-again password insecure
843 fjp 32199 # or encrypted using an MD5 hash.
844 fjp 33865 #d-i passwd/user-password-crypted password [MD5 hash]
845 fjp 32199 </screen></informalexample>
846    
847     <para>
848    
849     The <classname>passwd/root-password-crypted</classname> and
850 fjp 36205 <classname>passwd/user-password-crypted</classname> variables can also
851     be preseeded with <quote>!</quote> as their value. In that case, the
852     corresponding account is disabled. This may be convenient for the root
853     account, provided of course that an alternative method is setup to allow
854     administrative activities or root login (for instance by using SSH key
855     authentication or <command>sudo</command>).
856 fjp 32199
857 fjp 32504 </para><para>
858    
859     An MD5 hash for a password can be generated using the following command.
860    
861     <informalexample><screen>
862     $ echo "r00tme" | mkpasswd -s -H MD5
863     </screen></informalexample>
864    
865 fjp 32199 </para>
866 fjp 32276 </sect2>
867 fjp 32199
868 fjp 33825 <sect2 id="preseed-base-installer">
869     <title>Base system installation</title>
870     <para>
871    
872     There is actually not very much that can be preseeded for this stage of the
873     installation. The only questions asked concern the installation of the kernel.
874    
875     </para>
876    
877     <informalexample role="example"><screen>
878     # Select the initramfs generator used to generate the initrd for 2.6 kernels.
879     #d-i base-installer/kernel/linux/initramfs-generators string yaird
880     </screen></informalexample>
881    
882     </sect2>
883    
884 fjp 32276 <sect2 id="preseed-bootloader">
885 fjp 32199 <title>Boot loader installation</title>
886    
887 fjp 32424 <informalexample role="example"><screen>
888 fjp 32199 # Grub is the default boot loader (for x86). If you want lilo installed
889     # instead, uncomment this:
890     #d-i grub-installer/skip boolean true
891    
892     # This is fairly safe to set, it makes grub install automatically to the MBR
893     # if no other operating system is detected on the machine.
894     d-i grub-installer/only_debian boolean true
895    
896     # This one makes grub-installer install to the MBR if if finds some other OS
897     # too, which is less safe as it might not be able to boot that other OS.
898     d-i grub-installer/with_other_os boolean true
899    
900     # Alternatively, if you want to install to a location other than the mbr,
901     # uncomment and edit these lines:
902     #d-i grub-installer/bootdev string (hd0,0)
903     #d-i grub-installer/only_debian boolean false
904     #d-i grub-installer/with_other_os boolean false
905     </screen></informalexample>
906    
907 fjp 32276 </sect2>
908 fjp 32199
909 joeyh 33719 <sect2 id="preseed-pkgsel">
910 fjp 32199 <title>Package selection</title>
911 fjp 32276 <para>
912 fjp 32199
913 fjp 32276 You can choose to install any combination of tasks that are available.
914     Available tasks as of this writing include:
915    
916 fjp 32424 </para>
917    
918 fjp 32276 <itemizedlist>
919     <listitem><para>
920 joeyh 36744 <userinput>standard</userinput>
921 fjp 32276 </para></listitem>
922     <listitem><para>
923 joeyh 36744 <userinput>desktop</userinput>
924 fjp 32276 </para></listitem>
925     <listitem><para>
926 joeyh 36744 <userinput>gnome-desktop</userinput>
927 fjp 32276 </para></listitem>
928     <listitem><para>
929 joeyh 36744 <userinput>kde-desktop</userinput>
930 fjp 32276 </para></listitem>
931     <listitem><para>
932 joeyh 36744 <userinput>web-server</userinput>
933 fjp 32276 </para></listitem>
934     <listitem><para>
935 joeyh 36744 <userinput>print-server</userinput>
936 fjp 32276 </para></listitem>
937     <listitem><para>
938 joeyh 36744 <userinput>dns-server</userinput>
939 fjp 32276 </para></listitem>
940     <listitem><para>
941 joeyh 36744 <userinput>file-server</userinput>
942 fjp 32276 </para></listitem>
943     <listitem><para>
944 joeyh 36744 <userinput>mail-server</userinput>
945 fjp 32276 </para></listitem>
946 joeyh 36744 <listitem><para>
947     <userinput>sql-database</userinput>
948     </para></listitem>
949     <listitem><para>
950     <userinput>laptop</userinput>
951     </para></listitem>
952 fjp 32276 </itemizedlist>
953    
954 fjp 32424 <para>
955    
956 joeyh 33719 You can also choose to install no tasks, and force the installation of a
957     set of packages in some other way. We recommend always including the
958 joeyh 36744 <userinput>standard</userinput> task.
959 fjp 32276
960     </para>
961    
962 fjp 32424 <informalexample role="example"><screen>
963 joeyh 36744 tasksel tasksel/first multiselect standard, desktop
964     #tasksel tasksel/first multiselect standard, web-server
965     #tasksel tasksel/first multiselect standard, kde-desktop
966 joeyh 33719
967     # Some versions of the installer can report back on what software you have
968 fjp 33796 # installed, and what software you use. The default is not to report back,
969 joeyh 33719 # but sending reports helps the project determine what software is most
970     # popular and include it on CDs.
971     #popularity-contest popularity-contest/participate boolean false
972 fjp 32199 </screen></informalexample>
973    
974 fjp 32276 </sect2>
975 fjp 32199
976 joeyh 33719 <sect2 id="preseed-finish">
977     <title>Finishing up the first stage install</title>
978    
979     <informalexample role="example"><screen>
980     # Avoid that last message about the install being complete.
981 joeyh 37253 d-i finish-install/reboot_in_progress note
982 joeyh 33719
983     # This will prevent the installer from ejecting the CD during the reboot,
984     # which is useful in some situations.
985     #d-i cdrom-detect/eject boolean false
986     </screen></informalexample>
987    
988     </sect2>
989    
990 fjp 32276 <sect2 id="preseed-mailer">
991 fjp 32199 <title>Mailer configuration</title>
992 fjp 32276 <para>
993 fjp 32199
994 fjp 32276 During a normal install, exim asks only a few questions. Here's how to
995     avoid even those. More complicated preseeding is possible.
996    
997     </para>
998    
999 fjp 32424 <informalexample role="example"><screen>
1000 fjp 32199 exim4-config exim4/dc_eximconfig_configtype \
1001     select no configuration at this time
1002     exim4-config exim4/no_config boolean true
1003     exim4-config exim4/no_config boolean true
1004     exim4-config exim4/dc_postmaster string
1005     </screen></informalexample>
1006    
1007 fjp 32276 </sect2>
1008 fjp 32199
1009 fjp 32276 <sect2 id="preseed-X">
1010 fjp 32199 <title>X configuration</title>
1011 fjp 32276 <para>
1012 fjp 32199
1013 fjp 32276 Preseeding Debian's X config is possible, but you probably need to know
1014     some details about the video hardware of the machine, since Debian's X
1015     configurator does not do fully automatic configuration of everything.
1016    
1017     </para>
1018    
1019 fjp 32424 <informalexample role="example"><screen>
1020 fjp 32199 # X can detect the right driver for some cards, but if you're preseeding,
1021     # you override whatever it chooses. Still, vesa will work most places.
1022 cjwatson 33887 #xserver-xorg xserver-xorg/config/device/driver select vesa
1023 fjp 32199
1024     # A caveat with mouse autodetection is that if it fails, X will retry it
1025     # over and over. So if it's preseeded to be done, there is a possibility of
1026     # an infinite loop if the mouse is not autodetected.
1027 cjwatson 33887 #xserver-xorg xserver-xorg/autodetect_mouse boolean true
1028 fjp 32199
1029     # Monitor autodetection is recommended.
1030 cjwatson 33887 xserver-xorg xserver-xorg/autodetect_monitor boolean true
1031 fjp 32199 # Uncomment if you have an LCD display.
1032 cjwatson 33887 #xserver-xorg xserver-xorg/config/monitor/lcd boolean true
1033 fjp 32199 # X has three configuration paths for the monitor. Here's how to preseed
1034     # the "medium" path, which is always available. The "simple" path may not
1035     # be available, and the "advanced" path asks too many questions.
1036 cjwatson 33887 xserver-xorg xserver-xorg/config/monitor/selection-method \
1037 fjp 32199 select medium
1038 cjwatson 33887 xserver-xorg xserver-xorg/config/monitor/mode-list \
1039 fjp 32199 select 1024x768 @ 60 Hz
1040     </screen></informalexample>
1041    
1042 fjp 32276 </sect2>
1043 fjp 32199
1044 fjp 32276 <sect2 id="preseed-other">
1045 fjp 32199 <title>Preseeding other packages</title>
1046    
1047 fjp 32424 <informalexample role="example"><screen>
1048 fjp 32199 # Depending on what software you choose to install, or if things go wrong
1049     # during the installation process, it's possible that other questions may
1050     # be asked. You can preseed those too, of course. To get a list of every
1051     # possible question that could be asked during an install, do an
1052     # installation, and then run these commands:
1053     # debconf-get-selections --installer > file
1054     # debconf-get-selections >> file
1055     </screen></informalexample>
1056    
1057 fjp 32276 </sect2>
1058     </sect1>
1059 fjp 32199
1060 fjp 32276 <sect1 id="preseed-advanced">
1061 fjp 32199 <title>Advanced options</title>
1062 fjp 32424
1063     <sect2 id="preseed-shell">
1064     <title>Shell commands</title>
1065    
1066     <informalexample role="example"><screen>
1067     # d-i preseeding is inherently not secure. Nothing in the installer checks
1068     # for attempts at buffer overflows or other exploits of the values of a
1069 fjp 36205 # preconfiguration file like this one. Only use preconfiguration files from
1070     # trusted locations! To drive that home, and because it's generally useful,
1071     # here's a way to run any shell command you'd like inside the installer,
1072 fjp 32424 # automatically.
1073    
1074     # This first command is run as early as possible, just after
1075     # preseeding is read.
1076     #d-i preseed/early_command string anna-install some-udeb
1077    
1078     # This command is run just before the install finishes, but when there is
1079 joeyh 33719 # still a usable /target directory. You can chroot to /target and use it
1080     # directly, or use the apt-install and in-target commands to easily install
1081     # packages and run commands in the target system.
1082     #d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
1083 fjp 32424 </screen></informalexample>
1084    
1085     </sect2>
1086    
1087     <sect2 id="preseed-chainload">
1088 fjp 36205 <title>Chainloading preconfiguration files</title>
1089 fjp 32276 <para>
1090 fjp 32199
1091 fjp 36205 It is possible to include other preconfiguration files from a preconfiguration
1092     file. Any settings in those files will override pre-existing settings from
1093     files loaded earlier. This makes it possible to put, for example, general
1094 fjp 32276 networking settings for your location in one file and more specific
1095     settings for certain configurations in other files.
1096    
1097     </para>
1098    
1099 fjp 32199 <informalexample><screen>
1100 fjp 32276 # More that one file can be listed, separated by spaces; all will be
1101 fjp 32199 # loaded. The included files can have preseed/include directives of their
1102     # own as well. Note that if the filenames are relative, they are taken from
1103 fjp 36205 # the same directory as the preconfiguration file that includes them.
1104 fjp 32199 #d-i preseed/include string x.cfg
1105    
1106 fjp 36205 # The installer can optionally verify checksums of preconfiguration files
1107     # before using them. Currently only md5sums are supported, list the md5sums
1108 fjp 32199 # in the same order as the list of files to include.
1109     #d-i preseed/include/checksum string 5da499872becccfeda2c4872f9171c3d
1110    
1111     # More flexibly, this runs a shell command and if it outputs the names of
1112 fjp 36205 # preconfiguration files, includes those files.
1113 fjp 32199 #d-i preseed/include_command \
1114     # string echo if [ "`hostname`" = bob ]; then echo bob.cfg; fi
1115 joeyh 37224
1116     # Most flexibly of all, this downloads a program and runs it. The program
1117     # can use commands such as debconf-set to manupulate the debconf database.
1118     # Note that if the filenames are relative, they are taken from the same
1119     # directory as the preconfiguration file that runs them.
1120     d-i preseed/run string foo.sh
1121 fjp 32199 </screen></informalexample>
1122    
1123 fjp 32424 </sect2>
1124 fjp 32276 </sect1>
1125 fjp 32199 </appendix>

Properties

Name Value
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.5