205e788d481903e5cdf6f4c7224724d8297d1ecd
[grml-debootstrap.git] / grml-debootstrap.8.txt
1 grml-debootstrap(8)
2 ===================
3
4 Name
5 ----
6 grml-debootstrap - wrapper around debootstrap for installing plain Debian
7
8 Synopsis
9 --------
10 grml-debootstrap [ _options_ ]
11
12 image:images/screenshot.png[Screenshot]
13
14 Introduction
15 ------------
16
17 grml-debootstrap is a wrapper suite around debootstrap (and cdebootstrap and mmdebstrap if you
18 want) for installing a plain Debian system very fast and easy.
19
20 All you have to do is adjust a few variables in the configuration file
21 /etc/debootstrap/config or specify some command line options and invoke
22 grml-debootstrap. If invoked without any configuration modifications or command
23 line options a dialog based front end will be available to control some basic
24 configuration options.
25
26 A plain and base Debian system will be installed on the given device, directory
27 or virtual image file then. Customization of this process is possible as well.
28
29 CAUTION: The Grml team does not take responsibility for loss of any data!
30
31 Options and environment variables
32 ---------------------------------
33
34 *--arch* _architecture_::
35
36     Set target architecture you want to install. Defaults to the architecture
37     you are currently running. If you're running an amd64 kernel and want to
38     deploy an i386 system use this option. Note: deploying amd64 from an i386
39     kernel does *not* work. Example: "_--arch i386_"
40
41 *--backportrepos*::
42
43     Enable Debian's Backports repository via the
44     /etc/apt/sources.list.d/backports.list configuration file. This provides the
45     option to install Debian packages from Debian's backports repository.
46
47 *--bootappend* _appendline-for-the-kernel_::
48
49     Specify appendline for the kernel.
50     E.g. "_pci=nomsi_"
51
52 *-c*, *--config* _file_::
53
54     Use specified configuration file, defaults to /etc/debootstrap/config.
55
56 *--chroot-scripts* _directory_::
57
58     Execute chroot scripts from specified directory. This allows customisation
59     of the chroot setup, the executable script(s) present in the given directory
60     are executed at the end of the chroot procedure.
61     Default directory: /etc/debootstrap/chroot-scripts/
62
63 *--contrib*::
64
65     Enable the 'contrib' repository in COMPONENTS. By default only
66     the 'main' repository is enabled.
67
68 *-d*, *--confdir* _path_::
69
70     Place of configuration files for debootstrap, defaults to /etc/debootstrap.
71
72 *--debconf* _file_::
73
74     Use specified file for preseeding Debian packages instead of using
75     the default <confdir>/debconf-selections.
76
77 *--debopt* _params_::
78
79     Extra parameters passed to the debootstrap command.
80
81 *--debug*::
82
83    Execute in very verbose way. Useful for debugging possible problems
84    with grml-debootstrap or identify what's actually executed.
85
86 *--defaultinterfaces*::
87
88    Install a default /etc/network/interfaces file (enabling DHCP for eth0)
89    instead of taking over config from host system.
90
91 *--efi* _device_::
92
93     Partition where EFI boot manager should be installed to. If the
94     specified device doesn't use a FAT filesystem yet grml-debootstrap
95     automatically creates the filesystem. If a FAT filesystem is already
96     present the filesystem creation is skipped. Please ensure that it's
97     a valid FAT32 filesystem and the partition has the 'boot' and 'esp'
98     flags enabled. This option requires EFI support on the running system
99     and the option is NOT supported for Virtual Machine deployments.
100
101 *--filesystem* _filesystem_::
102
103     Filesystem that should be created when installing to a partition.
104     If unset defaults to ext4. Valid values are all filesystems that
105     can be created through mkfs._filesystem_.
106
107 *--force*::
108
109     Skip user acknowledgement and do not prompt for user input.
110
111 *--grmlrepos*::
112
113     Enable Grml.org's Debian repository (http://deb.grml.org/) via the
114     /etc/apt/sources.list.d/grml.list configuration file. This provides the
115     option to install Debian packages from Grml's repository.
116
117 *--grub* _device_::
118
119     Device where grub should be installed to. Note that only the MBR (master
120     boot record) can be used (/dev/sda, /dev/sdb,...). Partitions (like
121     /dev/sda1, /dev/sdb2,...) are NOT supported because grub2 doesn't support
122     installation into the PBR (partition boot record) anymore.  Usage example:
123     '--grub /dev/sda'.  Note: just do not set this option to avoid installation
124     of grub.
125
126 *--help*, *-h*::
127
128     Show summary of options and exit.
129
130 *--hostname* _hostname_::
131
132     Use specified hostname instead of the default (being $HOSTNAME or if unset 'grml').
133
134 *-i*, *--iso* _/mntpoint_::
135
136     Specify mount point where you have a Debian ISO mounted loopback.
137     Using this option instead of the mirror option gives you the possibility
138     to install the base-system without network access. Make sure you
139     mounted the according Debian-ISO to the given _/mntpoint_. See section
140     'Usage examples' for a demonstration.
141
142 *--keep_src_list*::
143
144      Do not overwrite user provided /etc/apt/sources.list.
145
146 *-m*, *--mirror* _URL_::
147
148     Specify mirror which should be used for apt-get/aptitude.
149     Corresponding with configuration variable MIRROR.
150
151 *--nodebootstrap*::
152
153     Skip debootstrap, only do configuration to the target.
154
155 *--nointerfaces*::
156
157     Do not copy /etc/network/interfaces from host system to the target.
158     This option is automatically enabled when using --vm or --vmfile.
159
160 *--nokernel*::
161
162     Skip installation of default kernel images. This option might be
163     interesting for you if you want a Debian system which doesn't
164     need to provide regular boot, e.g. a system which provides
165     ISOs for booting via GRUB using grml-rescueboot.
166
167 *--non-free*::
168
169     Enable the 'non-free' repository in COMPONENTS. By default only
170     the 'main' repository is enabled.
171
172 *--nopackages*::
173
174     Skip installation of packages defined in /etc/debootstrap/packages.
175
176 *--nopassword*::
177
178     Do not prompt for the root password. Note: Use the '--password' option if
179     you want to set the root password during an automatic installation but don't
180     want to use the interactive dialog.
181
182 *-p*, *--mntpoint* _/mntpoint_::
183
184     Specify mount point that should be used for mounting the target system.
185     Corresponding with configuration variable MNTPOINT.
186     Note: this option has no effect if option -t is given and represents a
187     directory.
188
189 *--packages* _file_::
190
191     Use specified file as list for packages that should be installed instead of
192     the default package list file <confdir>/packages.
193
194 *--password* _password_::
195
196     Use specified password as password for user root. Use with caution, as your
197     command line might be visible in the process list and the shell history.
198     It's meant for automatic installation only.
199
200 *--post-scripts* _directory_::
201
202     Execute scripts from specified directory after executing the chroot script.
203     This allows customisation of the system after the chroot has been set up.
204     The environment variable $MNTPOINT is available inside the scripts for
205     direct access of the chroot.
206     Default directory: /etc/debootstrap/post-scripts/
207
208 *--pre-scripts* _directory_::
209
210     Execute scripts from specified directory before executing the chroot
211     script. This allows customisation of the system before the chroot has
212     been set up.  The environment variable $MNTPOINT is available inside the
213     scripts for direct access of the chroot.
214     Default directory: /etc/debootstrap/pre-scripts/
215
216 *-r*, *--release* _releasename_::
217
218     Specify release of new Debian system. Supported releases names: lenny,
219     squeeze, wheezy, jessie, stretch, buster, bullseye and sid. Corresponding with configuration
220     variable RELEASE. Default release: buster
221
222 *--remove-configs*::
223
224     Delete grml-debootstrap configuration files (/etc/debootstrap/*) from installed
225     system. Useful for reproducible builds or if you don't want to leak information.
226
227 *--sshcopyid*::
228
229     Use locally available public keys to authorise root login on the target system.
230     Similar to ssh-copy-id(1) (without the -i option) it checks if `ssh-add -L`
231     provides any output, and if so those keys are appended to
232     _/root/.ssh/authorized_keys_ (creating the file and directory (with mode 0700)).
233
234 *-t*, *--target* _target_::
235
236     Target partition (/dev/...) or directory (anything else without /dev at the
237     beginning).
238
239 *-v*, *--verbose*::
240
241     Increase verbosity.
242
243 *--vm*::
244
245     Set up a Virtual Machine on an existing block device, which will be
246     partitioned.
247     This allows deployment of a Virtual Machine. The options needs to be
248     combined with the --target option.
249     Usage example: --vm --target /dev/mapper/your-vm-disk
250
251 *--vmfile*::
252
253     Set up a Virtual Machine using a regular file instead of installing to a
254     partition/block device or directory. This allows deployment of a Virtual
255     Machine. The options needs to be combined with the --target option
256     ('qemu-img create -f raw ...' is executed on the specified target).
257     Usage example: --vmfile --target /mnt/sda1/qemu.img
258
259 *--vmsize* _size_::
260
261    Use specified size for size of Virtual Machine disk file. If not specified it
262    defaults to 2G (being 2GB). Syntax as supported by qemu-img (see manpage
263    qemu-img(1) for details.
264    Usage example: --vmsize 3G
265
266 *-V*, *--version*::
267
268     Show version of program and exit.
269
270 WARNING: the command line parsing of grml-debootstrap usually does not validate
271 the provided arguments for the command line options. Please be careful and check
272 docs and /etc/debootstrap/config for further information.
273
274 Usage examples
275 ---------------
276
277   grml-debootstrap --target /dev/sda1 --grub /dev/sda
278
279 Install default Debian release (buster) on /dev/sda1 and install bootmanager GRUB in MBR (master boot record) of /dev/sda.
280
281   grml-debootstrap --release stretch --target /dev/sda1 --grub /dev/sda --hostname debian01 --password changeme
282
283 Install Debian release stretch on /dev/sda1 and install bootmanager GRUB in MBR (master boot record) of /dev/sda.
284 Set hostname to 'debian01' and password for user root to 'changeme'.
285
286   grml-debootstrap --target /dev/sda6 --grub /dev/sda --release sid
287
288 Install Debian unstable/sid on /dev/sda6 and install bootmanager GRUB in MBR (master boot record) of /dev/sda.
289
290   DEBOOTSTRAP=mmdebstrap grml-debootstrap --target /dev/sda1 --grub /dev/sda
291
292 Install default Debian release (buster) on /dev/sda1 and install bootmanager GRUB in MBR (master boot record) of /dev/sda.
293 Use mmdebstrap instead of default debootstrap tool for bootstrapping.
294
295   grml-debootstrap --target /dev/mapper/vg0-rootfs --grub /dev/sda
296
297 Install default Debian release (buster) on LVM device /dev/mapper/vg0-rootfs and install bootmanager GRUB in MBR (master boot record) of /dev/sda.
298
299   grml-debootstrap --efi /dev/sda1 --target /dev/sda2 --grub /dev/sda --efi
300
301 Install default Debian release (buster) on /dev/sda2 and install bootmanager GRUB in MBR (master boot record) of /dev/sda.
302 Use /dev/sda1 as EFI partition (requires EFI support in booted system).
303
304   mount /dev/sda1 /data/chroot
305   grml-debootstrap --target /data/chroot
306
307 Install default Debian release (buster) in directory /data/chroot (without any bootloader).
308
309   grml-debootstrap --target /dev/sda3 --grub /dev/sda  --mirror ftp://ftp.tugraz.at/mirror/debian
310
311 Install default Debian release (buster) on /dev/sda3 and install bootmanager GRUB in MBR (master boot record) of /dev/sda.
312 Use specified mirror instead of the default (http://deb.debian.org/debian) one.
313
314   mount /dev/sda1 /mnt/sda1
315   grml-debootstrap --vmfile --vmsize 3G --target /mnt/sda1/qemu.img
316
317 Install default debian release (buster) in a Virtual Machine file with 3GB disk size (including GRUB as bootmanager in MBR of the virtual disk file):
318
319   mount -o loop ./debian-CD-1.iso /media/cdrom
320   grml-debootstrap --target /dev/sda1 --grub /dev/sda --iso /media/cdrom
321
322 Install Debian on /dev/sda1 using the loopback mounted Debian-ISO for the base-system and install bootmanager GRUB in MBR (master boot record) of /dev/sda.
323 Please notice, that the chroot system requires network access for all packages which are not part of the ISO.
324
325 Files
326 -----
327
328   /etc/debootstrap/config
329
330 Main configuration file. Adjust it according to your needs if you want to
331 execute grml-debootstrap in the non-interactive mode without any special command
332 line arguments.
333
334   /etc/debootstrap/chroot-script
335
336 The script executed within the new Debian system as soon as the main system
337 has been installed via [c]debootstrap.
338
339   /etc/debootstrap/locale.gen
340
341 Defines the default locales used for generating locales via locale-gen.
342
343   /etc/debootstrap/packages
344
345 Defines the software packages which should be installed in the new
346 Debian system by default.
347
348   /etc/debootstrap/extrapackages/
349
350 Debian Packages dropped in this directory will be installed into the new Debian
351 system by default (Control variable: EXTRAPACKAGES)
352
353 Customization
354 -------------
355
356 You can control execution of grml-debootstrap via adjusting
357 /etc/debootstrap/config for some main stuff or via setting some selected
358 variables via command line.  The packages which should be installed in the new
359 Debian system can be defined via the file /etc/debootstrap/packages.  If you
360 want to put existing files to the new Debian system you can place them into the
361 (by default non-existing) directories boot, etc, share, usr and var in
362 /etc/debootstrap/. Every existing directory will be copied to the new Debian
363 system then. If you want to install additional packages that are not available
364 via the Grml or Debian mirror drop them into /etc/debootstrap/extrapackages and
365 make sure that EXTRAPACKAGES is set to "yes".
366
367 Automatic installation
368 ----------------------
369
370 If environment variable AUTOINSTALL is set grml-debootstrap can be executed in a
371 full automatic mode. While this mode isn't really useful for interactive
372 execution (just configure /etc/debootstrap/configure or specify the relevant
373 variables on the command line instead) it is meant for use via boot option
374 debian2hd on the Grml live system. The boot option debian2hd (more precise: the
375 kernelname at the bootprompt) supports the following boot options (they
376 correspond with the command line options mentioned above):
377
378   target=...
379
380 The target partition/directory of the new Debian system. Usage example:
381 target=/dev/sda1
382
383   grub=...
384
385 Where do you want to install grub to? Usage example: grub=/dev/sda
386
387   release=...
388
389 Specify release of new Debian system. Defaults to Debian buster. Supported
390 releases: lenny, squeeze, wheezy, jessie, stretch, buster, bullseye and sid. Usage example: release=stretch
391
392   mirror=...
393
394 Specify mirror which should be used for apt-get/aptitude instead
395 of the default one (http://deb.debian.org/debian).
396 Usage example: mirror=ftp://ftp.tugraz.at/mirror/debian
397
398   password=...
399
400 Set password of user root without prompting for it but set it to the given
401 argument. Usage example: password=AiTh5ahn
402
403 Usage example for automatic installation
404 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
405
406   debian2hd target=/dev/sda1 grub=/dev/sda mirror=ftp://ftp.tugraz.at/mirror/debian password=foobar
407
408 You have to enter this command line at the bootprompt of the Grml live system.
409 Please make sure that /dev/sda1 is the partition where you really want to
410 install your new Debian system.
411
412 [NOTE]
413 Automatic installation within booting process is done in grml-autoconfig via
414 setting environment variable AUTOINSTALL and creation of
415 /usr/bin/grml-debootstrap_noninteractive with the available and relevant
416 boot options for grml-debootstrap.
417
418 Supported Releases
419 ------------------
420
421 include::releasetable.txt[]
422
423 [NOTE]
424 .lenny/squeeze/wheezy release
425 ================================================================================
426 [1] Please notice that releases like lenny, squeeze and wheezy are unsupported releases within Debian nowadays.
427 grml-debootstrap can handle the releases but you really should not use them
428 anymore unless you really know what you are doing.
429 Choose the current Debian stable version instead.
430 See https://wiki.debian.org/DebianReleases for the list of supported releases.
431
432 Notice that you need to specify a mirror providing the lenny and squeeze releases, the
433 default (http://deb.debian.org/debian) doesn't provide it any longer nowadays.
434 Set the mirror to e.g. http://archive.debian.org/debian/ if you don't have
435 your own lenny/squeeze mirror.
436
437 Older releases might also fail to install when running on top of recent kernel versions,
438 throwing segfaults during debootstrap. This can be identified by the following messages inside kernel log (check with 'dmesg'):
439
440    dpkg[...] vsyscall attempted with vsyscall=none ip:[...]
441    dpkg[...]: segfault at [...]
442
443 To work around this issue boot your system with the kernel boot option 'vsyscall=emulate'.
444
445 You also need to specify a filesystem that's supported by lenny, e.g.
446 '--filesystem ext3' since grml-debootstrap's current default (ext4) isn't
447 supported by lenny.
448
449 Also when debootstrapping lenny on a live system with a kernel version
450 like "3.16-1-grml-amd64" lenny's libc will fail to install with:
451
452    [...]
453    /var/lib/dpkg/tmp.ci/preinst: line 265: [: 3.16-1-grml-amd64: integery expression expected
454    /var/lib/dpkg/tmp.ci/preinst: line 231: 3.16-1-grml-amd64: syntax error: invalid arithemtic operator (error token is ".16-1-grml-amd64")
455    dpkg: error processing /var/cache/apt/archives/libc6_2.7-18lenny7_amd64.deb (--install):
456    [....]
457
458 To workaround this either debootstrap from a system with an according
459 kernel version or use the "fake uname" workaround (just google for it).
460
461 When installing lenny to a new mdraid, grml-debootstrap will use md metadata
462 format version 0.90. This limits the device to a maximum size of 2TB, but has
463 the advantage of grub-legacy actually being able to boot from it.
464 ================================================================================
465
466 [NOTE]
467 .unstable and testing releases
468 ================================================================================
469 [2] Please notice that Debian/testing and Debian/unstable (sid) might
470 not be always installable due to their nature. What _might_ work instead is
471 deploying a stable release and upgrade it after installation finished.
472 ================================================================================
473
474 Bugs
475 ----
476
477 Please report bugs towards https://github.com/grml/grml-debootstrap/issues
478
479 See also
480 --------
481
482 debootstrap (8), cdebootstrap (1), mmdebstrap(1).
483
484 Author
485 ------
486 Michael Prokop <mika@grml.org>