1
<!-- retain these comments for translator revision tracking -->
2
<!-- original version: 23389 untranslated -->
4
<sect1 id="example-preseed">
5
<title>Preconfiguration File Example</title>
9
This is a complete working example of a preconfiguration file for an automated
10
install. Its use is explained in <xref linkend="automatic-install"/>. You
11
may want to uncomment some of the lines before using the file.
15
<informalexample><screen>
16
#### Modifying syslinux.cfg.
18
# Edit the syslinux.cfg (or similar) file, and add parameters to the end
19
# of the append line(s) for the kernel.
21
# You'll at least want to add a parameter telling the installer where to
22
# get its preseed file from.
23
# If you're installing from USB media, use this, and put the preseed file
24
# in the toplevel directory of the USB stick.
25
# preseed/file=/hd-media/preseed
26
# If you're netbooting, use this instead:
27
# preseed/url=http://host/path/to/preseed
28
# If you're remastering a CD, you could use this:
29
# preseed/file=/cdrom/preseed
30
# Be sure to copy this file to the location you specify.
32
# While you're at it, you may want to throw a debconf/priority=critical in
33
# there, to avoid most questions even if the preseeding below misses some.
34
# And you might set the timeout to 1 in syslinux.cfg to avoid needing to hit
35
# enter to boot the installer.
37
# Language, country, and keyboard selection cannot be preseeded from a file,
38
# because the questions are asked before the preseed file can be loaded.
39
# Instead, to avoid these questions, pass some more parameters to the kernel:
41
# languagechooser/language-name=English
42
# countrychooser/shortlist=US
43
# console-keymaps-at/keymap=us
45
# Note that the kernel accepts a maximum of 8 command line options and
46
# 8 environment options (including any options added by default for the
47
# installer). If these numbers are exceeded, 2.4 kernels will drop any
48
# excess options and 2.6 kernels will panic.
49
# Some of the default options, like 'vga=normal' and 'devfs=mount' may be
50
# safely removed for most installations, which may allow you to add more
51
# options for preseeding.
55
# d-i preseeding is inherently not secure. Nothing in the installer checks
56
# for attempts at buffer overflows or other exploits of the values of a
57
# preseed file like this one. Only use preseed files from trusted
58
# locations! To drive that home, and because it's generally useful, here's
59
# a way to run any shell command you'd like inside the installer,
62
# This first command is run as early as possible, just after
64
#d-i preseed/early_command string wget http://url/to/my.udeb -O /tmp/my.udeb ; udpkg -i /tmp/my.udeb
65
# This command is run just before the install finishes, but when there is
66
# still a usable /target directory.
67
#d-i preseed/late_command string for deb in /hd-media/*.deb; do cp $deb /target/tmp; chroot /target dpkg -i /tmp/$(basename $deb); done
68
# This command is run just as base-config is starting up.
69
#base-config base-config/early_command string echo hi mom
70
# This command is run after base-config is done, just before the login:
71
# prompt. This is a good way to install a set of packages you want, or to
72
# tweak the configuration of the system.
73
#base-config base-config/late_command string apt-get install zsh; chsh -s /bin/zsh
75
#### Network configuration.
77
# Of course, this won't work if you're loading your preseed file from the
78
# network! But it's great if you're booting from CD or USB stick. You can
79
# also pass network config parameters in on the kernel params if you are
80
# loading preseed files from the network.
82
# netcfg will choose an interface that has link if possible. This makes it
83
# skip displaying a list if there is more than one interface.
84
d-i netcfg/choose_interface select auto
86
# If you prefer to configure the network manually, here's how:
87
#d-i netcfg/disable_dhcp boolean true
88
#d-i netcfg/get_nameservers string 192.168.1.1
89
#d-i netcfg/get_ipaddress string 192.168.1.42
90
#d-i netcfg/get_netmask string 255.255.255.0
91
#d-i netcfg/get_gateway string 192.168.1.1
92
#d-i netcfg/confirm_static boolean true
94
# Note that any hostname and domain names assigned from dhcp take
95
# precidence over values set here. However, setting the values still
96
# prevents the questions from being shown even if values come from dhcp.
97
d-i netcfg/get_hostname string unassigned-hostname
98
d-i netcfg/get_domain string unassigned-domain
100
# Disable that annoying WEP key dialog.
101
d-i netcfg/wireless_wep string
102
# The wacky dhcp hostname that some ISPs use as a password of sorts.
103
#d-i netcfg/dhcp_hostname string radish
105
#### Mirror settings.
107
d-i mirror/country string enter information manually
108
d-i mirror/http/hostname string http.us.debian.org
109
d-i mirror/http/directory string /debian
110
d-i mirror/suite string testing
111
d-i mirror/http/proxy string
115
# If the system has free space you can choose to only partition that space.
116
#d-i partman-auto/init_automatically_partition select Use the largest continuous free space
117
# Alternatively, you can specify a disk to partition. The device name can
118
# be given in either devfs or traditional non-devfs format.
119
# For example, to use the first disk devfs knows of:
120
d-i partman-auto/disk string /dev/discs/disc0/disc
122
# You can choose from any of the predefined partitioning recipes:
123
d-i partman-auto/choose_recipe select All files in one partition (recommended for new users)
124
#d-i partman-auto/choose_recipe select Desktop machine
125
#d-i partman-auto/choose_recipe select Multi-user workstation
126
# Or provide a recipe of your own...
127
# The recipe format is documented in the file devel/partman-auto-recipe.txt.
128
# If you have a way to get a recipe file into the d-i environment, you can
130
#d-i partman-auto/expert_recipe_file string /hd-media/recipe
131
# If not, you can put an entire recipe in one line. This example creates
132
# a small /boot partition, suitable swap, and uses the rest of the space
133
# for the root partition:
134
#d-i partman-auto/expert_recipe string boot-root :: 20 50 100 ext3 $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ /boot } . 500 10000 1000000000 ext3 method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ / } . 64 512 300% linux-swap method{ swap } format{ } .
135
# For reference, here is that same recipe in a more readable form:
138
# $primary{ } $bootable{ }
139
# method{ format } format{ }
140
# use_filesystem{ } filesystem{ ext3 }
141
# mountpoint{ /boot }
143
# 500 10000 1000000000 ext3
144
# method{ format } format{ }
145
# use_filesystem{ } filesystem{ ext3 }
148
# 64 512 300% linux-swap
149
# method{ swap } format{ }
152
# This makes partman automatically partition without confirmation.
153
d-i partman/choose_partition select Finish partitioning and write changes to disk
154
d-i partman/confirm boolean true
156
#### Boot loader installation.
158
# Grub is the default boot loader (for x86). If you want lilo installed
159
# instead, uncomment this:
160
#d-i grub-installer/skip boolean true
162
# This is fairly safe to set, it makes grub install automatically to the MBR
163
# if no other operating system is detected on the machine.
164
d-i grub-installer/only_debian boolean true
165
# This one makes grub-installer install to the MBR if if finds some other OS
166
# too, which is less safe as it might not be able to boot that other OS.
167
d-i grub-installer/with_other_os boolean true
168
# Alternatively, if you want to install to a location other than the mbr,
169
# uncomment and edit these lines:
170
#d-i grub-installer/bootdev string (hd0,0)
171
#d-i grub-installer/only-debian boolean false
172
#d-i grub-installer/with_other_os boolean false
174
##### Finishing up the first stage install.
176
# Avoid that last message about the install being complete.
177
d-i prebaseconfig/reboot_in_progress note
180
##### Preseeding base-config.
181
# XXX: Note that most of this will not work right until base-config 2.40.4
184
# Avoid the introductory message.
185
base-config base-config/intro note
187
# Avoid the final message.
188
base-config base-config/login note
190
# If you installed a display manager, but don't want to start it immediately
191
# after base-config finishes.
192
#base-config base-config/start-display-manager boolean false
194
###### Time zone setup.
196
# Controls whether or not the hardware clock is set to GMT.
197
base-config tzconfig/gmt boolean true
199
# If you told the installer that you're in the United States, then you
200
# can set the time zone using this variable.
201
# (Choices are: Eastern, Central, Mountain, Pacific, Alaska, Hawaii,
202
# Aleutian, Arizona East-Indiana, Indiana-Starke, Michigan, Samoa, other)
203
base-config tzconfig/choose_country_zone/US select Eastern
204
# If you told it you're in Canada.
205
# (Choices are: Newfoundland, Atlantic, Eastern, Central,
206
# East-Saskatchewan, Saskatchewan, Mountain, Pacific, Yukon, other)
207
base-config tzconfig/choose_country_zone/CA select Eastern
208
# If you told it you're in Brazil. (Choices are: East, West, Acre,
210
base-config tzconfig/choose_country_zone/BR select East
211
# Many countries have only one time zone. If you told the installer you're
212
# in one of those countries, you can choose its standard time zone via this
214
base-config tzconfig/choose_country_zone_single boolean true
215
# This question is asked as a fallback for countries other than those
216
# listed above, which have more than one time zone. You can preseed one of
217
# the time zones, or "other".
218
#base-config tzconfig/choose_country_zone_multiple select
220
###### Account setup.
222
# To preseed the root password, you have to put it in the clear in this
223
# file. That is not a very good idea, use caution!
224
#passwd passwd/root-password password r00tme
225
#passwd passwd/root-password-again password r00tme
227
# If you want to skip creation of a normal user account.
228
#passwd passwd/make-user boolean false
229
# Alternatively, you can preseed the user's name and login.
230
#passwd passwd/user-fullname string Debian User
231
#passwd passwd/username string debian
232
# And their password, but use caution!
233
#passwd passwd/user-password password insecure
234
#passwd passwd/user-password-again password insecure
238
# This question controls what source the second stage installation uses
239
# for packages. Choices are cdrom, http, ftp, filesystem, edit sources list
241
base-config apt-setup/uri_type select http
243
# If you choose ftp or http, you'll be asked for a country and a mirror.
244
base-config apt-setup/country select enter information manually
245
base-config apt-setup/hostname string http.us.debian.org
246
base-config apt-setup/directory string /debian
247
# Stop after choosing one mirror.
248
base-config apt-setup/another boolean false
250
# You can choose to install non-free and contrib software.
251
#base-config apt-setup/non-free boolean true
252
#base-config apt-setup/contrib boolean true
254
# Do enable security updates.
255
base-config apt-setup/security-updates boolean true
257
###### Package selection.
259
# You can choose to install any combination of tasks that are available.
260
# Available tasks as of this writing include: Desktop environment,
261
# Web server, Print server, DNS server, File server, Mail server,
262
# SQL database, manual package selection. The last of those will run
263
# aptitude. You can also choose to install no tasks, and force the
264
# installation of a set of packages in some other way.
265
# XXX: this will not work until tasksel 2.12 is available
266
tasksel tasksel/first multiselect Desktop environment
267
#tasksel tasksel/first multiselect Web server, Mail server, DNS server
269
###### Mailer configuration.
271
# During a normal install, exim asks only two questions. Here's how to
272
# avoid even those. More complicated preseeding is possible.
273
exim4-config exim4/dc_eximconfig_configtype select no configuration at this time
274
# It's a good idea to set this to whatever user account you choose to
275
# create. Leaving the value blank results in postmaster mail going to
277
exim4-config exim4/dc_postmaster string
279
###### X Configuration.
281
# Preseeding Debian's X config is possible, but you probably need to know
282
# some details about the video hardware of the machine, since Debian's X
283
# configurator does not do fully automatic configuration of everything.
285
# X can detect the right driver for some cards, but if you're preseeding,
286
# you override whatever it chooses. Still, vesa will work most places.
287
#xserver-xfree86 xserver-xfree86/config/device/driver select vesa
289
# A caveat with mouse autodetection is that if it fails, X will retry it
290
# over and over. So if it's preseeded to be done, there is a possibility of
291
# an infinite loop if the mouse is not autodetected.
292
#xserver-xfree86 xserver-xfree86/autodetect_mouse boolean true
294
# Monitor autodetection is recommended.
295
xserver-xfree86 xserver-xfree86/autodetect_monitor boolean true
296
# Uncomment if you have a LCD display.
297
#xserver-xfree86 xserver-xfree86/config/monitor/lcd boolean true
298
# X has three configuration paths for the monitor. Here's how to preseed
299
# the "medium" path, which is always available. The "simple" path may not
300
# be available, and the "advanced" path asks too many questions.
301
xserver-xfree86 xserver-xfree86/config/monitor/selection-method select medium
302
xserver-xfree86 xserver-xfree86/config/monitor/mode-list select 1024x768 @ 60 Hz
304
###### Everything else.
306
# Depending on what software you choose to install, or if things go wrong
307
# during the installation process, it's possible that other questions may
308
# be asked. You can preseed those too, of course. To get a list of every
309
# possible question that could be asked during an install, do an
310
# installation, and then run these commands:
311
# debconf-get-selections --installer > file
312
# debconf-get-selections >> file
314
# If you like, you can include other preseed files into this one.
315
# Any settings in those files will override pre-existing settings from this
316
# file. More that one file can be listed, separated by spaces; all will be
317
# loaded. The included files can have preseed/include directives of their
318
# own as well. Note that if the filenames are relative, they are taken from
319
# the same directory as the preseed file that includes them.
320
#d-i preseed/include string x.cfg
321
# More flexably, this runs a shell command and if it outputs the names of
322
# preseed files, includes those files. For example, to switch configs based
323
# on a particular usb storage device (in this case, a built-in card reader):
324
#d-i preseed/include_command string if $(grep -q "GUID: 0aec3050aec305000001a003" /proc/scsi/usb-storage-*/*); then echo kraken.cfg; else echo otherusb.cfg; fi
325
</screen></informalexample>