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

Properties

Name Value
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.5