/[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 38231 - (hide annotations) (download) (as text)
Mon Jun 19 22:15:58 2006 UTC (6 years, 11 months ago) by joeyh
File MIME type: text/xml
File size: 38973 byte(s)
* Document new aliases added in preseed 1.17 for common debconf boot
  parameters: fb, url, file, locale, interface.
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 joeyh 38231 Note that <filename>preseed/url</filename> can be shortened to just
322     <filename>url</filename> and <filename>preseed/file</filename> to just
323     </filename>file</filename> when they are passed as boot parameters.
324     </para>
325    
326     </para><para>
327    
328 fjp 32199 While you're at it, you may want to add a boot parameter
329 joeyh 38231 <userinput>priority=critical</userinput>. This will avoid most
330 fjp 32199 questions even if the preseeding below misses some.
331    
332     </para>
333 fjp 32276 </sect2>
334 joeyh 35032
335     <sect2 id="preseed-dhcp">
336 fjp 36205 <title>Using a DHCP server to specify preconfiguration files</title>
337 joeyh 35032 <para>
338 fjp 32199
339 fjp 36205 It's also possible to use DHCP to specify a preconfiguration file to download
340     from the network. DHCP allows specifying a filename. Normally this is a file
341     to netboot, but if it appears to be an URL then installation media that
342     support network preseeding will download the file from the URL and use it as a
343     preconfiguration file. Here is an example of how to set it up in the dhcpd.conf
344 joeyh 35032 for version 3 of the ISC DHCP server (the dhcp3-server Debian package).
345    
346     </para>
347    
348     <informalexample><screen>
349     if substring (option vendor-class-identifier, 0, 3) = "d-i" {
350 fjp 36204 filename "http://host/preseed.cfg";
351 joeyh 35032 }
352     </screen></informalexample>
353    
354     <para>
355 fjp 35033
356 joeyh 35032 Note that the above example limits this filename to DHCP clients that identify
357     themselves as "d-i", so it will not affect regular DHCP clients, but only
358     the installer. You can also put the text in a stanza for only one particular
359     host to avoid preseeding all installs on your network.
360    
361     </para><para>
362 fjp 35033
363 joeyh 35032 A good way to use the DHCP preseeding is to only preseed values specific to
364     your network, such as the Debian mirror to use. This way installs on your
365     network will automatically get a good mirror selected, but the rest of the
366     installation can be performed interactively. Using DHCP preseeding to fully
367     automate Debian installs should only be done with care.
368 fjp 35033
369 joeyh 35032 </para>
370 fjp 35051 </sect2>
371 joeyh 35032
372 fjp 32276 <sect2 id="preseed-bootparms">
373 fjp 32199 <title>Using boot parameters to supplement preseeding</title>
374     <para>
375    
376 fjp 32276 Some parts of the installation process cannot be automated using some forms
377 fjp 36205 of preseeding because the questions are asked before the preconfiguration
378     file is loaded. For example, if the preconfiguration file is downloaded over
379     the network, the network setup must be done first. One reason to use initrd
380     preseeding is that it allows preseeding of even these early steps of the
381     installation process.
382 fjp 32199
383     </para><para>
384    
385 fjp 36205 If a preconfiguration file cannot be used to preseed some steps, the install
386     can still be fully automated, since you can pass preseed values to the kernel
387 fjp 32199 on the command line. Just pass <userinput>path/to/var=value</userinput>
388     for any of the preseed variables listed in the examples.
389    
390 fjp 36758 </para><para>
391    
392 fjp 37311 A <quote>--</quote> in the boot options has special meaning.
393 fjp 36758 Kernel parameters that appear after it will be copied into the installed
394     bootloader configuration (if supported by the installer for the
395 fjp 37311 bootloader). Note that the <quote>--</quote> may already be
396 fjp 36758 present in the default boot parameters.
397    
398 fjp 32199 </para>
399     <note><para>
400    
401     The 2.4 kernel accepts a maximum of 8 command line options and
402     8 environment options (including any options added by default for the
403     installer). If these numbers are exceeded, 2.4 kernels will drop any
404 fjp 32424 excess options and 2.6 kernels will panic. For kernel 2.6.9 and later,
405 fjp 32199 you can use 32 command line options and 32 environment options.
406    
407     </para></note>
408 fjp 32276 <para>
409    
410     For most installations some of the default options in your bootloader
411 fjp 36204 configuration file, like <literal>vga=normal</literal>, may be safely
412     removed which may allow you to add more options for preseeding.
413 fjp 32276
414     </para>
415 fjp 32199 <note><para>
416    
417 fjp 32276 It may not always be possible to specify values with spaces for boot
418     parameters, even if you delimit them with quotes.
419 fjp 32199
420     </para></note>
421 fjp 32276 </sect2>
422     </sect1>
423 fjp 32199
424 fjp 36204 <sect1 id="preseed-creating">
425 fjp 36205 <title>Creating a preconfiguration file</title>
426 fjp 32424 <para>
427 fjp 32199
428 fjp 32424 The preconfiguration file is in the format used by the
429 fjp 36204 <command>debconf-set-selections</command> command. The general format of
430     a line in a preconfiguration file is:
431 fjp 32424
432 fjp 36204 <informalexample><screen>
433 holger-guest 37282 &lt;owner&gt; &lt;question name&gt; &lt;question type&gt; &lt;value&gt;
434 fjp 36204 </screen></informalexample>
435 fjp 32424
436 fjp 36204 </para><para>
437    
438     There are a few rules to keep in mind when writing a preconfiguration file.
439    
440 fjp 36267 </para>
441    
442 fjp 32199 <itemizedlist>
443 fjp 36267 <listitem><para>
444 fjp 36204 Put only a single space or tab between type and value: any additional
445     whitespace will be interpreted as belonging to the value.
446 fjp 36267 </para></listitem>
447     <listitem><para>
448 fjp 36204 A line can be split into multiple lines by appending a backslash
449 fjp 36214 (<quote><literal>\</literal></quote>) as the line continuation character.
450 joeyh 37231 A good place to split a line is after the question name; a bad place is
451 fjp 36204 between type and value.
452 fjp 36267 </para></listitem>
453     <listitem><para>
454 joeyh 37231 Most questions need to be preseeded using the values valid in English and
455     not the translated values. However, there are some questions (for example
456 fjp 36204 in <classname>partman</classname> where the translated values need to be
457     used.
458 fjp 36267 </para></listitem>
459     <listitem><para>
460 joeyh 37231 Some questions take a code as value instead of the English text that is
461 fjp 36204 shown during installation.
462 fjp 36267 </para></listitem>
463 fjp 32199 </itemizedlist>
464    
465 fjp 36267 <para>
466 fjp 36204
467     The easiest way to create a preconfiguration file is to use the example file
468     linked in <xref linkend="preseed-contents"/> as basis and work from there.
469    
470     </para><para>
471    
472     An alternative method is to do a manual installation and then, after
473     rebooting, use the <command>debconf-get-selections</command> from the
474     <classname>debconf-utils</classname> package to dump both the debconf
475     database and the installer's cdebconf database to a single file:
476    
477     <informalexample><screen>
478     $ debconf-get-selections --installer &gt; <replaceable>file</replaceable>
479     $ debconf-get-selections &gt;&gt; <replaceable>file</replaceable>
480     </screen></informalexample>
481    
482     </para><para>
483    
484     However, a file generated in this manner will have some items that should
485     not be preseeded, and the example file is a better starting place for most
486     users.
487    
488     </para>
489    
490     <note><para>
491    
492     This method relies on the fact that, at the end of the installation, the
493     installer's cdebconf database is saved to the installed system in
494     <filename>/var/log/installer/cdebconf</filename>. However, because the
495     database may contain sensitive information, by default the files are only
496     readable by root.
497    
498     </para><para>
499    
500     The directory <filename>/var/log/installer</filename> and all files in it
501     will be deleted from your system if you purge the package
502     <classname>installation-report</classname>.
503    
504     </para></note>
505    
506 fjp 32199 <para>
507    
508 joeyh 37231 To check possible values for questions, you can use <command>nano</command>
509 fjp 36204 to examine the files in <filename>/var/lib/cdebconf</filename> while an
510     installation is in progress. View <filename>templates.dat</filename> for
511     the raw templates and <filename>questions.dat</filename> for the current
512     values and for the values assigned to variables.
513    
514     </para><para>
515    
516 fjp 36205 To check if the format of your preconfiguration file is valid before performing
517     an install, you can use the command <command>debconf-set-selections -c
518 fjp 32276 <replaceable>preseed.cfg</replaceable></command>.
519    
520 fjp 32199 </para>
521 fjp 32276 </sect1>
522 fjp 32199
523 joeyh 33719 <sect1 id="preseed-contents">
524 fjp 36205 <title>Contents of the preconfiguration file</title>
525 fjp 32199 <para>
526    
527     The configuration fragments used in this appendix are also available as an
528 fjp 36205 example preconfiguration file from &urlset-example-preseed;.
529 fjp 32199
530     </para><para>
531    
532     Note that this example is based on an installation for the Intel x86
533     architecture. If you are installing a different architecture, some of the
534     examples (like keyboard selection and bootloader installation) may not be
535 fjp 36205 relevant and will need to be replaced by debconf settings appropriate for
536     your architecture.
537 fjp 32199
538     </para>
539    
540 fjp 32276 <sect2 id="preseed-l10n">
541 fjp 32199 <title>Localization</title>
542     <para>
543    
544     Setting localization values will only work if you are using initrd preseeding.
545 fjp 36205 With all other methods the preconfiguration file will only be loaded after
546     these questions have been asked.
547 fjp 32199
548     </para><para>
549    
550     The locale can be used to specify both language and country.
551     To specify the locale as a boot parameter, use
552 joeyh 38231 <userinput>locale=<replaceable>en_US</replaceable></userinput>.
553 fjp 32199
554 fjp 32424 <informalexample role="example"><screen>
555 fjp 32199 # Locale sets language and country.
556     d-i debian-installer/locale string en_US
557     </screen></informalexample>
558    
559     </para><para>
560    
561 fjp 32276 Keyboard configuration consists of selecting a keyboard architecture and a
562     keymap. In most cases the correct keyboard architecture is selected by
563 joeyh 32501 default, so there's normally no need to preseed it. The keymap must
564     be valid for the selected keyboard architecture.
565 fjp 32199
566 fjp 32424 <informalexample role="example"><screen>
567     # Keyboard selection.
568     #d-i console-tools/archs select at
569     d-i console-keymaps-at/keymap select us
570     # Example for a different keyboard architecture
571     #d-i console-keymaps-usb/keymap select mac-usb-us
572     </screen></informalexample>
573    
574 fjp 32276 </para><para>
575    
576 fjp 36205 To skip keyboard configuration, preseed
577 fjp 32276 <classname>console-tools/archs</classname> with
578     <userinput>skip-config</userinput>.
579     This will result in the kernel keymap remaining active.
580    
581     </para>
582    
583     <note><para>
584 fjp 32199
585 fjp 32276 The changes in the input layer for 2.6 kernels have made the keyboard
586     architecture virtually obsolete. For 2.6 kernels normally a <quote>PC</quote>
587     (<userinput>at</userinput>) keymap should be selected.
588    
589     </para></note>
590     </sect2>
591    
592     <sect2 id="preseed-network">
593 fjp 32199 <title>Network configuration</title>
594     <para>
595    
596     Of course, preseeding the network configuration won't work if you're
597 fjp 36205 loading your preconfiguration file from the network. But it's great when
598     you're booting from CD or USB stick. If you are loading preconfiguration
599     files from the network, you can pass network config parameters by using
600     kernel boot parameters.
601 fjp 32199
602 cjwatson 33890 </para><para>
603 fjp 32200
604 cjwatson 33890 If you need to pick a particular interface when netbooting before loading
605 fjp 36205 a preconfiguration file from the network, use a boot parameter such as
606 joeyh 38231 <userinput>interface=<replaceable>eth1</replaceable></userinput>.
607 cjwatson 33890
608 cjwatson 33891 </para>
609    
610 fjp 32424 <informalexample role="example"><screen>
611 fjp 32199 # netcfg will choose an interface that has link if possible. This makes it
612     # skip displaying a list if there is more than one interface.
613     d-i netcfg/choose_interface select auto
614    
615 cjwatson 33890 # To pick a particular interface instead:
616     #d-i netcfg/choose_interface select eth1
617    
618 fjp 32199 # If you have a slow dhcp server and the installer times out waiting for
619     # it, this might be useful.
620     #d-i netcfg/dhcp_timeout string 60
621    
622 joeyh 34168 # If you prefer to configure the network manually, uncomment this line and
623     # the static network configuration below.
624 fjp 32199 #d-i netcfg/disable_dhcp boolean true
625 joeyh 34168
626 fjp 36205 # If you want the preconfiguration file to work on systems both with and
627     # without a dhcp server, uncomment these lines and the static network
628     # configuration below.
629 joeyh 34168 #d-i netcfg/dhcp_failed note
630     #d-i netcfg/dhcp_options select Configure network manually
631    
632     # Static network configuration.
633 fjp 32199 #d-i netcfg/get_nameservers string 192.168.1.1
634     #d-i netcfg/get_ipaddress string 192.168.1.42
635     #d-i netcfg/get_netmask string 255.255.255.0
636     #d-i netcfg/get_gateway string 192.168.1.1
637     #d-i netcfg/confirm_static boolean true
638    
639     # Any hostname and domain names assigned from dhcp take precedence over
640     # values set here. However, setting the values still prevents the questions
641     # from being shown, even if values come from dhcp.
642     d-i netcfg/get_hostname string unassigned-hostname
643     d-i netcfg/get_domain string unassigned-domain
644    
645     # Disable that annoying WEP key dialog.
646     d-i netcfg/wireless_wep string
647     # The wacky dhcp hostname that some ISPs use as a password of sorts.
648     #d-i netcfg/dhcp_hostname string radish
649     </screen></informalexample>
650    
651 fjp 32276 </sect2>
652 fjp 32199
653 fjp 32276 <sect2 id="preseed-mirror">
654 fjp 32199 <title>Mirror settings</title>
655     <para>
656    
657 cjwatson 33889 Depending on the installation method you use, a mirror may be used both to
658 fjp 32199 download additional components of the installer, the base system and to
659     set up the <filename>/etc/apt/sources.list</filename> for the installed
660     system.
661    
662     </para><para>
663    
664     The parameter <classname>mirror/suite</classname> determines the suite for
665     the installed system.
666    
667     </para><para>
668    
669     The parameter <classname>mirror/udeb/suite</classname> determines the suite
670     for additional components for the installer. It is only useful to set this
671     if components are actually downloaded over the network and should match the
672     suite that was used to build the initrd for the installation method used for
673     the installation.
674 fjp 36205 By default the value for <classname>mirror/udeb/suite</classname> is the
675     same as <classname>mirror/suite</classname>.
676 fjp 32199
677     </para>
678    
679 fjp 32424 <informalexample role="example"><screen>
680 fjp 32199 d-i mirror/country string enter information manually
681     d-i mirror/http/hostname string http.us.debian.org
682     d-i mirror/http/directory string /debian
683     d-i mirror/http/proxy string
684    
685     # Suite to install.
686     #d-i mirror/suite string testing
687     # Suite to use for loading installer components (optional).
688     #d-i mirror/udeb/suite string testing
689     </screen></informalexample>
690    
691 fjp 32276 </sect2>
692 fjp 32199
693 fjp 32276 <sect2 id="preseed-partman">
694 fjp 32199 <title>Partitioning</title>
695 fjp 32276 <para>
696 fjp 32199
697 fjp 32276 Using preseeding to partition the harddisk is very much limited to what is
698     supported by <classname>partman-auto</classname>. You can choose to either
699     partition existing free space on a disk or a whole disk. The layout of the
700     disk can be determined by using a predefined recipe, a custom recipe from
701 fjp 36205 a recipe file or a recipe included in the preconfiguration file. It is
702     currently not possible to partition multiple disks using preseeding nor to
703     set up RAID.
704 fjp 32276
705     </para>
706    
707     <warning><para>
708    
709     The identification of disks is dependent on the order in which their drivers
710     are loaded. If there are multiple disks in the system, make very sure the
711     correct one will be selected before using preseeding.
712    
713     </para></warning>
714    
715 fjp 32424 <informalexample role="example"><screen>
716 fjp 32199 # If the system has free space you can choose to only partition that space.
717 joeyh 37231 # Note: this must be preseeded with a localized (translated) value.
718 fjp 32199 #d-i partman-auto/init_automatically_partition \
719     # select Use the largest continuous free space
720    
721     # Alternatively, you can specify a disk to partition. The device name can
722     # be given in either devfs or traditional non-devfs format.
723     # For example, to use the first disk devfs knows of:
724     d-i partman-auto/disk string /dev/discs/disc0/disc
725    
726 fjp 35039 # You can choose from any of the predefined partitioning recipes.
727 joeyh 37231 # Note: this must be preseeded with a localized (translated) value.
728 fjp 32199 d-i partman-auto/choose_recipe \
729     select All files in one partition (recommended for new users)
730     #d-i partman-auto/choose_recipe \
731     # select Separate /home partition
732     #d-i partman-auto/choose_recipe \
733     # select Separate /home, /usr, /var, and /tmp partitions
734    
735     # Or provide a recipe of your own...
736     # The recipe format is documented in the file devel/partman-auto-recipe.txt.
737     # If you have a way to get a recipe file into the d-i environment, you can
738     # just point at it.
739     #d-i partman-auto/expert_recipe_file string /hd-media/recipe
740    
741 fjp 36205 # If not, you can put an entire recipe the preconfiguration file in one
742     # (logical) line. This example creates a small /boot partition, suitable
743     # swap, and uses the rest of the space for the root partition:
744 fjp 32199 #d-i partman-auto/expert_recipe string \
745     # boot-root :: \
746     # 40 50 100 ext3 \
747     # $primary{ } $bootable{ } \
748     # method{ format } format{ } \
749     # use_filesystem{ } filesystem{ ext3 } \
750     # mountpoint{ /boot } \
751     # . \
752     # 500 10000 1000000000 ext3 \
753     # method{ format } format{ } \
754     # use_filesystem{ } filesystem{ ext3 } \
755     # mountpoint{ / } \
756     # . \
757     # 64 512 300% linux-swap \
758     # method{ swap } format{ } \
759     # .
760    
761     # This makes partman automatically partition without confirmation.
762     d-i partman/confirm_write_new_label boolean true
763     d-i partman/choose_partition \
764     select Finish partitioning and write changes to disk
765     d-i partman/confirm boolean true
766     </screen></informalexample>
767    
768 fjp 32276 </sect2>
769 fjp 32199
770 fjp 32276 <sect2 id="preseed-time">
771 fjp 32199 <title>Clock and time zone setup</title>
772    
773 fjp 32424 <informalexample role="example"><screen>
774 fjp 32199 # Controls whether or not the hardware clock is set to UTC.
775     d-i clock-setup/utc boolean true
776    
777     # You may set this to any valid setting for $TZ; see the contents of
778     # /usr/share/zoneinfo/ for valid values.
779     d-i time/zone string US/Eastern
780     </screen></informalexample>
781    
782 fjp 32276 </sect2>
783 fjp 32199
784 fjp 32504 <sect2 id="preseed-apt">
785     <title>Apt setup</title>
786     <para>
787    
788     Setup of the <filename>/etc/apt/sources.list</filename> and basic configuration
789     options is fully automated based on your installation method and answers to
790 fjp 35924 earlier questions. You can optionally add other (local) repositories.
791 fjp 32504
792     </para>
793    
794     <informalexample role="example"><screen>
795     # You can choose to install non-free and contrib software.
796     #d-i apt-setup/non-free boolean true
797     #d-i apt-setup/contrib boolean true
798 joeyh 35836 # Uncomment this to avoid adding security sources, or
799     # add a hostname to use a different server than security.debian.org.
800 fjp 35924 #d-i apt-setup/security_host string
801    
802     # Additional repositories, local[0-9] available
803     #d-i apt-setup/local0/comment string local server
804 joeyh 37512 #d-i apt-setup/local0/source string \
805 fjp 35924 # deb http://local.server/debian stable main
806 fjp 35982 # URL to the public key of the local repository
807 fjp 35924 #d-i apt-setup/local0/key string http://local.server/key
808 fjp 32504 </screen></informalexample>
809    
810     </sect2>
811    
812 fjp 32424 <sect2 id="preseed-account">
813 fjp 32199 <title>Account setup</title>
814     <para>
815    
816     The password for the root account and name and password for a first regular
817     user's account can be preseeded. For the passwords you can use either clear
818     text values or MD5 <emphasis>hashes</emphasis>.
819    
820     </para>
821     <warning><para>
822    
823     Be aware that preseeding passwords is not completely secure as everyone
824 fjp 36205 with access to the preconfiguration file will have the knowledge of these
825     passwords. Using MD5 hashes is considered slightly better in terms of
826     security but it might also give a false sense of security as access to a
827     MD5 hash allows for brute force attacks.
828 fjp 32199
829     </para></warning>
830    
831 fjp 32424 <informalexample role="example"><screen>
832 joeyh 36167 # Skip creation of a root account (normal user account will be able to
833     # use sudo).
834     #d-i passwd/root-login boolean false
835     # Alternatively, to skip creation of a normal user account.
836     #d-i passwd/make-user boolean false
837    
838 fjp 32199 # Root password, either in clear text
839 fjp 33865 #d-i passwd/root-password password r00tme
840     #d-i passwd/root-password-again password r00tme
841 fjp 32199 # or encrypted using an MD5 hash.
842 fjp 33865 #d-i passwd/root-password-crypted password [MD5 hash]
843 fjp 32199
844 joeyh 36167 # To create a normal user account.
845 fjp 33865 #d-i passwd/user-fullname string Debian User
846     #d-i passwd/username string debian
847 fjp 32199 # Normal user's password, either in clear text
848 fjp 33865 #d-i passwd/user-password password insecure
849     #d-i passwd/user-password-again password insecure
850 fjp 32199 # or encrypted using an MD5 hash.
851 fjp 33865 #d-i passwd/user-password-crypted password [MD5 hash]
852 fjp 32199 </screen></informalexample>
853    
854     <para>
855    
856     The <classname>passwd/root-password-crypted</classname> and
857 fjp 36205 <classname>passwd/user-password-crypted</classname> variables can also
858     be preseeded with <quote>!</quote> as their value. In that case, the
859     corresponding account is disabled. This may be convenient for the root
860     account, provided of course that an alternative method is setup to allow
861     administrative activities or root login (for instance by using SSH key
862     authentication or <command>sudo</command>).
863 fjp 32199
864 fjp 32504 </para><para>
865    
866     An MD5 hash for a password can be generated using the following command.
867    
868     <informalexample><screen>
869     $ echo "r00tme" | mkpasswd -s -H MD5
870     </screen></informalexample>
871    
872 fjp 32199 </para>
873 fjp 32276 </sect2>
874 fjp 32199
875 fjp 33825 <sect2 id="preseed-base-installer">
876     <title>Base system installation</title>
877     <para>
878    
879     There is actually not very much that can be preseeded for this stage of the
880     installation. The only questions asked concern the installation of the kernel.
881    
882     </para>
883    
884     <informalexample role="example"><screen>
885     # Select the initramfs generator used to generate the initrd for 2.6 kernels.
886     #d-i base-installer/kernel/linux/initramfs-generators string yaird
887     </screen></informalexample>
888    
889     </sect2>
890    
891 fjp 32276 <sect2 id="preseed-bootloader">
892 fjp 32199 <title>Boot loader installation</title>
893    
894 fjp 32424 <informalexample role="example"><screen>
895 fjp 32199 # Grub is the default boot loader (for x86). If you want lilo installed
896     # instead, uncomment this:
897     #d-i grub-installer/skip boolean true
898    
899     # This is fairly safe to set, it makes grub install automatically to the MBR
900     # if no other operating system is detected on the machine.
901     d-i grub-installer/only_debian boolean true
902    
903     # This one makes grub-installer install to the MBR if if finds some other OS
904     # too, which is less safe as it might not be able to boot that other OS.
905     d-i grub-installer/with_other_os boolean true
906    
907     # Alternatively, if you want to install to a location other than the mbr,
908     # uncomment and edit these lines:
909     #d-i grub-installer/bootdev string (hd0,0)
910     #d-i grub-installer/only_debian boolean false
911     #d-i grub-installer/with_other_os boolean false
912     </screen></informalexample>
913    
914 fjp 32276 </sect2>
915 fjp 32199
916 joeyh 33719 <sect2 id="preseed-pkgsel">
917 fjp 32199 <title>Package selection</title>
918 fjp 32276 <para>
919 fjp 32199
920 fjp 32276 You can choose to install any combination of tasks that are available.
921     Available tasks as of this writing include:
922    
923 fjp 32424 </para>
924    
925 fjp 32276 <itemizedlist>
926     <listitem><para>
927 joeyh 36744 <userinput>standard</userinput>
928 fjp 32276 </para></listitem>
929     <listitem><para>
930 joeyh 36744 <userinput>desktop</userinput>
931 fjp 32276 </para></listitem>
932     <listitem><para>
933 joeyh 36744 <userinput>gnome-desktop</userinput>
934 fjp 32276 </para></listitem>
935     <listitem><para>
936 joeyh 36744 <userinput>kde-desktop</userinput>
937 fjp 32276 </para></listitem>
938     <listitem><para>
939 joeyh 36744 <userinput>web-server</userinput>
940 fjp 32276 </para></listitem>
941     <listitem><para>
942 joeyh 36744 <userinput>print-server</userinput>
943 fjp 32276 </para></listitem>
944     <listitem><para>
945 joeyh 36744 <userinput>dns-server</userinput>
946 fjp 32276 </para></listitem>
947     <listitem><para>
948 joeyh 36744 <userinput>file-server</userinput>
949 fjp 32276 </para></listitem>
950     <listitem><para>
951 joeyh 36744 <userinput>mail-server</userinput>
952 fjp 32276 </para></listitem>
953 joeyh 36744 <listitem><para>
954     <userinput>sql-database</userinput>
955     </para></listitem>
956     <listitem><para>
957     <userinput>laptop</userinput>
958     </para></listitem>
959 fjp 32276 </itemizedlist>
960    
961 fjp 32424 <para>
962    
963 joeyh 33719 You can also choose to install no tasks, and force the installation of a
964     set of packages in some other way. We recommend always including the
965 joeyh 36744 <userinput>standard</userinput> task.
966 fjp 32276
967     </para>
968    
969 fjp 32424 <informalexample role="example"><screen>
970 joeyh 36744 tasksel tasksel/first multiselect standard, desktop
971     #tasksel tasksel/first multiselect standard, web-server
972     #tasksel tasksel/first multiselect standard, kde-desktop
973 joeyh 33719
974     # Some versions of the installer can report back on what software you have
975 fjp 33796 # installed, and what software you use. The default is not to report back,
976 joeyh 33719 # but sending reports helps the project determine what software is most
977     # popular and include it on CDs.
978     #popularity-contest popularity-contest/participate boolean false
979 fjp 32199 </screen></informalexample>
980    
981 fjp 32276 </sect2>
982 fjp 32199
983 joeyh 33719 <sect2 id="preseed-finish">
984     <title>Finishing up the first stage install</title>
985    
986     <informalexample role="example"><screen>
987     # Avoid that last message about the install being complete.
988 joeyh 37253 d-i finish-install/reboot_in_progress note
989 joeyh 33719
990     # This will prevent the installer from ejecting the CD during the reboot,
991     # which is useful in some situations.
992     #d-i cdrom-detect/eject boolean false
993     </screen></informalexample>
994    
995     </sect2>
996    
997 fjp 32276 <sect2 id="preseed-mailer">
998 fjp 32199 <title>Mailer configuration</title>
999 fjp 32276 <para>
1000 fjp 32199
1001 fjp 32276 During a normal install, exim asks only a few questions. Here's how to
1002     avoid even those. More complicated preseeding is possible.
1003    
1004     </para>
1005    
1006 fjp 32424 <informalexample role="example"><screen>
1007 fjp 32199 exim4-config exim4/dc_eximconfig_configtype \
1008     select no configuration at this time
1009     exim4-config exim4/no_config boolean true
1010     exim4-config exim4/no_config boolean true
1011     exim4-config exim4/dc_postmaster string
1012     </screen></informalexample>
1013    
1014 fjp 32276 </sect2>
1015 fjp 32199
1016 fjp 32276 <sect2 id="preseed-X">
1017 fjp 32199 <title>X configuration</title>
1018 fjp 32276 <para>
1019 fjp 32199
1020 fjp 32276 Preseeding Debian's X config is possible, but you probably need to know
1021     some details about the video hardware of the machine, since Debian's X
1022     configurator does not do fully automatic configuration of everything.
1023    
1024     </para>
1025    
1026 fjp 32424 <informalexample role="example"><screen>
1027 fjp 32199 # X can detect the right driver for some cards, but if you're preseeding,
1028     # you override whatever it chooses. Still, vesa will work most places.
1029 cjwatson 33887 #xserver-xorg xserver-xorg/config/device/driver select vesa
1030 fjp 32199
1031     # A caveat with mouse autodetection is that if it fails, X will retry it
1032     # over and over. So if it's preseeded to be done, there is a possibility of
1033     # an infinite loop if the mouse is not autodetected.
1034 cjwatson 33887 #xserver-xorg xserver-xorg/autodetect_mouse boolean true
1035 fjp 32199
1036     # Monitor autodetection is recommended.
1037 cjwatson 33887 xserver-xorg xserver-xorg/autodetect_monitor boolean true
1038 fjp 32199 # Uncomment if you have an LCD display.
1039 cjwatson 33887 #xserver-xorg xserver-xorg/config/monitor/lcd boolean true
1040 fjp 32199 # X has three configuration paths for the monitor. Here's how to preseed
1041     # the "medium" path, which is always available. The "simple" path may not
1042     # be available, and the "advanced" path asks too many questions.
1043 cjwatson 33887 xserver-xorg xserver-xorg/config/monitor/selection-method \
1044 fjp 32199 select medium
1045 cjwatson 33887 xserver-xorg xserver-xorg/config/monitor/mode-list \
1046 fjp 32199 select 1024x768 @ 60 Hz
1047     </screen></informalexample>
1048    
1049 fjp 32276 </sect2>
1050 fjp 32199
1051 fjp 32276 <sect2 id="preseed-other">
1052 fjp 32199 <title>Preseeding other packages</title>
1053    
1054 fjp 32424 <informalexample role="example"><screen>
1055 fjp 32199 # Depending on what software you choose to install, or if things go wrong
1056     # during the installation process, it's possible that other questions may
1057     # be asked. You can preseed those too, of course. To get a list of every
1058     # possible question that could be asked during an install, do an
1059     # installation, and then run these commands:
1060     # debconf-get-selections --installer > file
1061     # debconf-get-selections >> file
1062     </screen></informalexample>
1063    
1064 fjp 32276 </sect2>
1065     </sect1>
1066 fjp 32199
1067 fjp 32276 <sect1 id="preseed-advanced">
1068 fjp 32199 <title>Advanced options</title>
1069 fjp 32424
1070     <sect2 id="preseed-shell">
1071     <title>Shell commands</title>
1072    
1073     <informalexample role="example"><screen>
1074     # d-i preseeding is inherently not secure. Nothing in the installer checks
1075     # for attempts at buffer overflows or other exploits of the values of a
1076 fjp 36205 # preconfiguration file like this one. Only use preconfiguration files from
1077     # trusted locations! To drive that home, and because it's generally useful,
1078     # here's a way to run any shell command you'd like inside the installer,
1079 fjp 32424 # automatically.
1080    
1081     # This first command is run as early as possible, just after
1082     # preseeding is read.
1083     #d-i preseed/early_command string anna-install some-udeb
1084    
1085     # This command is run just before the install finishes, but when there is
1086 joeyh 33719 # still a usable /target directory. You can chroot to /target and use it
1087     # directly, or use the apt-install and in-target commands to easily install
1088     # packages and run commands in the target system.
1089     #d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
1090 fjp 32424 </screen></informalexample>
1091    
1092     </sect2>
1093    
1094     <sect2 id="preseed-chainload">
1095 fjp 36205 <title>Chainloading preconfiguration files</title>
1096 fjp 32276 <para>
1097 fjp 32199
1098 fjp 36205 It is possible to include other preconfiguration files from a preconfiguration
1099     file. Any settings in those files will override pre-existing settings from
1100     files loaded earlier. This makes it possible to put, for example, general
1101 fjp 32276 networking settings for your location in one file and more specific
1102     settings for certain configurations in other files.
1103    
1104     </para>
1105    
1106 fjp 32199 <informalexample><screen>
1107 fjp 32276 # More that one file can be listed, separated by spaces; all will be
1108 fjp 32199 # loaded. The included files can have preseed/include directives of their
1109     # own as well. Note that if the filenames are relative, they are taken from
1110 fjp 36205 # the same directory as the preconfiguration file that includes them.
1111 fjp 32199 #d-i preseed/include string x.cfg
1112    
1113 fjp 36205 # The installer can optionally verify checksums of preconfiguration files
1114     # before using them. Currently only md5sums are supported, list the md5sums
1115 fjp 32199 # in the same order as the list of files to include.
1116     #d-i preseed/include/checksum string 5da499872becccfeda2c4872f9171c3d
1117    
1118     # More flexibly, this runs a shell command and if it outputs the names of
1119 fjp 36205 # preconfiguration files, includes those files.
1120 fjp 32199 #d-i preseed/include_command \
1121     # string echo if [ "`hostname`" = bob ]; then echo bob.cfg; fi
1122 joeyh 37224
1123     # Most flexibly of all, this downloads a program and runs it. The program
1124     # can use commands such as debconf-set to manupulate the debconf database.
1125     # Note that if the filenames are relative, they are taken from the same
1126     # directory as the preconfiguration file that runs them.
1127     d-i preseed/run string foo.sh
1128 fjp 32199 </screen></informalexample>
1129    
1130 fjp 32424 </sect2>
1131 fjp 32276 </sect1>
1132 fjp 32199 </appendix>

Properties

Name Value
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.5