/[fai]/trunk/doc/fai-guide.sgml
ViewVC logotype

Contents of /trunk/doc/fai-guide.sgml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 704 - (show annotations) (download) (as text)
Tue Jul 17 15:25:25 2001 UTC (11 years, 11 months ago) by lange
File MIME type: text/x-sgml
File size: 75034 byte(s)
added createvt flag documentation
1 <!DOCTYPE debiandoc PUBLIC "-//DebianDoc//DTD DebianDoc//EN" [
2 <!-- include version information so we don't have to hard code it
3 within the document -->
4 <!-- common, language independant entities -->
5 <!entity % commondata SYSTEM "common.ent" > %commondata;
6 <!-- CVS revision of this document -->
7 <!entity cvs-rev "$Id$">
8
9 <!entity version "1.1">
10 <!entity date "XX july 2001">
11
12 ]>
13
14 <debiandoc>
15 <book>
16 <title>FAI Guide (Fully Automatic Installation)
17
18 <author>Thomas Lange <email>lange@informatik.uni-koeln.de</email>
19 <version>Version &version for FAI version 2.1, &date
20
21 <abstract>
22 This manual describes the fully automatic installation package for
23 &dgl;. This includes the installation of the package, the planing and
24 creating of the configuration and how to deal with errors.
25
26 <copyright>
27 <copyrightsummary>
28 Copyright &copy; 2000-2001 Thomas Lange
29 </copyrightsummary>
30 <p>
31 This manual is free software; you may redistribute it and/or modify it
32 under the terms of the GNU General Public License as published by the
33 Free Software Foundation; either version 2, or (at your option) any
34 later version.
35 <p>
36 This is distributed in the hope that it will be useful, but
37 <em>without any warranty</em>; without even the implied warranty of
38 merchantability or fitness for a particular purpose. See the GNU
39 General Public License for more details.
40 <p>
41 A copy of the GNU General Public License is available as &file-GPL; in
42 the &dgl distribution or on the World Wide Web at <url id="&url-gpl;"
43 name="the GNU website">. You can also obtain it by
44 writing to the &fsf-addr;.
45
46 <toc detail="sect2">
47
48 <chapt id="intro">Introduction<p>
49 The homepage of FAI is
50 <httpsite>http://www.informatik.uni-koeln.de</httpsite><httppath>/fai</httppath>.
51
52 There you will find any information about FAI, for e.g. the mailing
53 list archive. The FAI package is available as a Debian package from
54 &faidownload;. It's an official Debian package and is available from
55 all Debian mirrors. Send any bug or comment to
56 <email>fai@informatik.uni-koeln.de</email>. You can also use the
57 Debian bug tracking system (BTS)
58 <httpsite>http://www.debian.org</httpsite><httppath>/Bugs</httppath>
59 for reporting errors.
60 <p>
61 You can access the CVS repository from a bourne shell using the
62 following commands. The login password is blank (press enter).
63 <example>
64 > CVSROOT=:pserver:anonymous@cvs.debian.org:/cvs/debian-boot
65 > cvs login
66 > cvs co -P fai-kernels
67 > cvs co -P fai
68 </example>
69
70 You can also use the WWW interface for the CVS repository at:
71 <httpsite>http://cvs.debian.org/</httpsite><httppath>fai/</httppath>
72 (and <package>fai-kernels</package>).
73 <p>
74 Now read this manual then enjoy the fully automatic installation and
75 your saved time.
76
77
78 <sect id="motivation">Motivation<p> Have you ever performed identical
79 installations of an operating system several times? Would you like to
80 be able to install a Linux cluster with dozens of nodes single
81 handedly?
82
83 <p>
84 Repeating the same task time and again is boring -- and will surely
85 lead to mistakes. Also a whole lot of time could be saved, if the
86 installation were done automatically. An installation process with
87 manual interaction does not scale. But clusters have the habit of
88 growing over the years. Think long-term rather than plan only just a
89 few months into the future.
90
91 <p>
92 In 1999, I had to organize an installation of a Linux cluster with one
93 server and 16 clients. Since I had much experience doing automatic
94 installation of Solaris operating system on SUN SPARC hardware, the
95 idea to build an automatic installation for Debian was born. Solaris
96 has an automatic installation feature called JumpStart<footnote> <p>
97 Solaris 8 Advanced Installation Guide at
98 <httpsite>docs.sun.com</httpsite></p> </footnote> . In conjunction
99 with the auto-install scripts from Casper Dik<footnote><p><url
100 id="ftp://ftp.fwi.uva.nl:/pub/solaris/auto-install/"></p> </footnote>,
101 I could save a lot of time not only for every new SUN computer, but
102 also for reinstallation of existing workstations. For example, I had
103 to build a temporary LAN with four SUN workstations for a conference,
104 lasting only a few days. I took these workstations out of our normal
105 research network and set up a new installation for the conference.
106 When it was over, I simply integrated the workstation back into the
107 research network, rebooted just once, and after half an hour,
108 everything was up and running as before. The configuration of all
109 workstations was exactly the same as before the conference, because
110 everything was performed by the same installation process. I also use
111 the automatic installation for reinstalling a workstation after a
112 damaged hard disk had been replaced. It took two weeks until I
113 received the new hard disk but only a few minutes after the new disk
114 was installed, the workstation was running as before. And this is why
115 I chose to adapt this technique to a PC cluster running Linux.
116
117
118
119 <sect id="overview">Overview and concepts<p>
120 <p>
121 FAI is a non interactive system to install a &dgl operating system on
122 a single computer or a whole cluster. You can take one or more virgin
123 PC's, turn on the power and after a few minutes Linux is installed,
124 configured and running on the whole cluster, without any interaction
125 necessary. Thus, it's a scalable method for installing and updating a
126 cluster unattended with little effort involved. FAI uses the &dgl;
127 distribution and a collection of shell and perl scripts for the
128 installation process. Changes to the configuration files of the
129 operating system can be made by cfengine, shell, perl and expect scripts.
130
131 <p>
132 FAI's target group are system administrators how have to install
133 Debian onto one or even hundreds of computers. Because it's a general
134 purpose installation tool, it can be used for installing a beowulf
135 cluster, a rendering farm or a linux laboratory or a classroom. Also
136 large-scale linux networks with different hardware or different installation
137 requirements are easy to establish using FAI. But don't forget to plan
138 your installation. <ref id="plan"> has some useful hints for this topic.
139 <p>
140 First, some terms used in this manual, are described.
141
142 <taglist>
143 <tag> install server : <item> <p>The host, where the package FAI
144 is installed. It provides several services for all install
145 clients. In the examples of this manual this host is called
146 <tt>kueppers</tt>.
147
148 <tag>install client : <item> A host, which will be installed using
149 FAI and a configuration from the install server. Also called
150 client for short. In this manual the example hosts are
151 called <tt>bigfoot, ant01, ant02,...</tt></p> </item>
152 <tag> configuration : <item> The details, how the installation
153 of the clients should be performed. This includes information about:
154 <list>
155 <item> <p>Hard disk layout</p> </item>
156 <item> <p>Local filesystems</p> </item>
157 <item> <p>Software packages</p> </item>
158 <item> <p>Keyboard layout, time zone, NIS,
159 X11 configuration, remote filesystems, user accounts,
160 printers ...</p> </item>
161 </list>
162 <tag> nfsroot : <item> A filesystem located on the install
163 server. It's the complete filesystem for the install
164 clients during the installation process. All clients share the
165 same nfsroot, which they mount read only.</item>
166 </taglist>
167
168 <sect id="work">How does FAI work ?<p>
169
170 The install client which will be installed using FAI, is
171 booted from floppy disk or via network card. It gets an IP address and
172 boots a linux kernel which mounts its root filesystem via NFS from the install
173 server. After the operating system is running, the FAI startup script
174 performs the automatic installation which doesn't need any
175 interaction. First, the hard disks will be partitioned, filesystems are
176 created and then software packages are installed. After that, the new
177 installed operating system is configured to your local needs using
178 some scripts. Finally the new operating system will be booted from the local
179 disk.
180 <p>
181 The details, of how to install the computer (the configuration), are
182 stored in the configuration space on the install server. Configuration
183 files are shared among groups of computers if they are similar using the
184 class concept. So you need not to create a configuration for every new
185 host. Hence, FAI is a scalable method to install a big cluster with a
186 great number of nodes.
187
188 <p>
189 FAI can also be used as an network rescue system. You can boot your
190 computer, but it will not perform an installation. Instead it will run a
191 fully functional &dgl without using the local hard disks. Then you can
192 do a remote login and backup or restore a disk partition, check a filesystem,
193 inspect the hardware or do any other task.
194
195 <sect id="features">Features<p>
196 <list>
197 <item> <p> </p> </item>
198
199 <item> <p>A fully automated installation can be perfomed</p> </item>
200 <item> <p>Very quick unattended installation</p> </item>
201 <item> <p>Hosts can boot from floppy or from network card </p> </item>
202 <item> <p>BOOTP and DHCP protocol are supported</p> </item>
203 <item> <p>No initial ramdisk is needed, 8MB RAM suffice</p> </item>
204 <item> <p>Runs even on a 386 CPU </p> </item>
205 <item> <p>The installation kernel can use modules</p> </item>
206 <item> <p>Remote login via ssh during installation process
207 possible</p> </item>
208 <item> <p>Two additional virtual terminals available
209 during installation</p> </item>
210 <item> <p>All similar configuration are shared among
211 all install clients</p> </item>
212 <item> <p>Log files are saved on to the installation server</p> </item>
213 <item> <p>Shell, perl, expect and cfengine scripts are
214 supported for the configuration setup</p> </item>
215 <item> <p>Access to a Debian mirror via NFS, FTP or HTTP</p> </item>
216 <item> <p>Easy creation of the common boot floppy</p> </item>
217 <item> <p>Keyboard layout selectable</p> </item>
218 <item> <p>Can be used as a rescue system</p> </item>
219 <item> <p>Tested on SUN SPARC hardware</p> </item>
220 <item> <p>Diskless clients support</p> </item>
221 <item> <p>Easily add your own functions via hooks</p> </item>
222
223 </list>
224
225 <chapt id="inst">Installing FAI
226 <sect id="requirements">Requirements<p>
227
228 Following items are required for an installation via FAI.
229
230 <taglist>
231 <tag>A computer: </tag><item> The computer must have a
232 network interface card and a local harddisk. No floppy disk,
233 CD-ROM, keyboard or graphic card is needed.</item>
234 <tag>BOOTP or DHCP server: </tag><item> <p>
235 The clients need one of these daemons to obtain boot information.<footnote>
236 <p>It's also possible without a server, if all
237 information is put on the boot disk.</p>
238 </footnote>
239 </p> </item>
240
241 <tag>TFTP server:<item> The TFTP daemon is used for
242 transfering the kernel to the clients. Only needed when
243 booting from network card with a boot PROM.</item>
244 <tag>Nfsroot:<item> A mountable directory which contains the whole
245 filesystem for the install clients during installation. It will
246 be created during setup of the FAI package.</item>
247 <tag>Debian mirror:<item> Access to a Debian
248 mirror is needed. A local mirror of all Debian
249 packages is recommended if you install several computers.</item>
250 <tag>Install kernel: <item> A kernel image that supports the
251 network card and mounts its root filesystem via NFS. </item>
252 <tag>Configuration space:<item> A mountable directory which contains the configuration data. </item>
253 </taglist>
254 <p>
255
256 The TFTP daemon and a NFS server will be enabled automatically when
257 installing the FAI package. Different install kernel images for BOOTP
258 and DHCP are available within the package
259 <package>fai-kernels</package>. All clients must have a network card,
260 which is recognized by the install kernel.
261 <p>
262
263
264 <sect id="debian-mirror">How to create a local Debian mirror<p>
265
266 The script <prgn>mkdebmirror</prgn> <footnote> Available in
267 <p><file>/usr/share/doc/fai/utils/</file>.</p> </footnote> can be
268 used for creating your own local Debian mirror. This script uses the
269 script <prgn>debmirror</prgn><footnote> Available at
270 <httpsite>http://cvs.kitenet.net/</httpsite><httppath>joey-cvs/bin/debmirror</httppath>
271 or at the FAI homepage.</footnote> and <manref name="rsync"
272 section="1">.
273
274 A partitial Debian mirror only for i386 architecture for Debian 2.2r3
275 (aka potato) without the source packages needs about 2.4 GB of disk
276 space.
277
278
279 <sect id=faisetup> Setting up FAI
280 <p>
281
282 Before installing FAI, you have to install the package <package>fai-kernels</package>,
283 which contains the install kernels for FAI. <footnote> <p><tt># apt-get
284 install fai</tt> should also work.</p></footnote>
285
286 <example>
287 kueppers[~]# dpkg -i fai-kernels_1.1_i386.deb
288 Selecting previously deselected package fai-kernels.
289 (Reading database ... 40562 files and directories currently installed.)
290 Unpacking fai-kernels (from .../lange/fai-kernels_1.1_i386.deb) ...
291 Setting up fai-kernels (1.1) ...
292 </example>
293
294 Get the newest version of FAI and install it using the
295 <prgn>dpkg</prgn> command:
296
297 <example>
298 kueppers[~]# dpkg -i fai_2.0_all.deb
299 Selecting previously deselected package fai.
300 (Reading database ... 39564 files and directories currently installed.)
301 Unpacking fai (from fai_2.0_all.deb) ...
302 Setting up fai (2.0) ...
303 To set up FAI edit /etc/fai.conf and call fai-setup
304 </example>
305 <p>
306
307 All definitions for the FAI package (not the configuration data) are defined in
308 &fc;. Since FAI doesn't use <prgn>debconf</prgn>
309 yet, edit this file before calling <prgn>fai-setup</prgn>.
310 These are important variables in &fc;:
311
312 <taglist>
313 <tag><var>FAI_DEBOOTSTRAP</var></tag>
314 <item>
315 <p>For building the nfsroot there's a new tool called
316 <manref name="debootstrap" section="8">, which replaces the
317 use of the <var>FAI_BASETGZ</var> variable. The tool needs
318 the location of a Debian mirror and the distribution
319 (potato,woody,stable,unstable) for which the basic Debian
320 system should be build.
321 </p> </item>
322
323
324 <tag><var>FAI_BASETGZ</var></tag>
325 <item>
326 <p>The location, where the the base file is fetched
327 from. For building the nfsroot, the Debian base system
328 is needed. It's a big tar file (&basetgzsize for
329 &basetgz), which is a minimal collection of all required
330 packages for Debian. If a file &basetgz is already
331 available in <file>/tmp</file> this file will be used
332 instead and no file will be fetched from the defined
333 location. Fetching via ftp or http could take much time,
334 if you do not have a fast connection to your Debian
335 mirror. You can find the current version of this archive
336 in the directory
337 <tt>debian/dists/stable/main/disks-i386/current/</tt> of
338 a Debian mirror.</p>
339 </item>
340
341 <tag><var>FAI_SOURCES_LIST</var></tag> <item> <p>This
342 multi line string is the definition for
343 <file>sources.list</file> (used by <manref name="apt-get"
344 section="8">), which defines the location and access
345 method of the Debian mirror. For more information on the
346 file format see <manref name="sources.list" section="5">.
347 </p> </item>
348
349 <tag><var>FAI_DEBMIRROR</var></tag>
350 <item>
351 <p> If you have NFS access to your local Debian mirror,
352 specify the remote filesystem. It will be mounted to
353 <var>$MNTPOINT</var> (defined in
354 <file>fai.conf</file>). It's not needed if you use FTP
355 or HTTP access.</p> </item>
356
357 <tag><var>KERNELPACKAGE</var></tag>
358 <item>
359 <p> You must specify the software package (build with <manref
360 name="make-kpkg" section="8">), which includes
361 the default kernel for booting the install clients. The
362 Debian package <package>fai-kernels</package> contains the
363 default install kernels with BOOTP and DHCP support.</p></item>
364 <tag> <var>NFSROOT_PACKAGES</var></tag>
365 <item>
366 <p> Contains a list of additional software package, that
367 will be added to nfsroot.</p></item>
368 </taglist>
369 <p>
370
371 The variables <var>FAI_SOURCES_LIST</var> and <var>FAI_DEBMIRROR</var>
372 are used by the install server and also by the clients. If your
373 install server has multiple network card and different host names for
374 each card (as for a beowulf server), use the install
375 servers name, which is used by the install clients.<p>
376
377 FAI uses <manref name="apt-get" section="8"> to create the nfsroot
378 filesystem in <file>/usr/lib/fai/nfsroot</file>, which needs about
379 &nfsrootsize of free disk space. Before setting up FAI, you should get
380 the program <prgn>imggen</prgn>,<footnote>Available at the download
381 page <httpsite>http://www.ltsp.org</httpsite> or from the FAI download
382 page &faidownload;.</footnote> if you like to boot from a 3Com network
383 card. This executable converts netboot images (created by <manref
384 name="mknbi-linux" section="8">, so they can be booted by network
385 cards from 3Com. Put that executable in your path
386 (e.g. <file>/usr/local/bin</file>). After editing &fc; call
387 <prgn>fai-setup</prgn>.
388
389 <example>
390 kueppers[~]# fai-setup
391 Adding system user fai...
392 Stopping Name Service Cache Daemon: nscd.
393 Adding new user fai (100) with group nogroup.
394 Starting Name Service Cache Daemon: nscd.
395 Creating home directory /home/fai.
396 /home/fai/.rhosts created.
397 User account fai created.
398 Creating FAI nfsroot can take a long time and will
399 need more than 100MB disk space in /usr/lib/fai/nfsroot.
400 Unpacking /tmp/base2_2.tgz
401 Upgrading /usr/lib/fai/nfsroot
402 Adding additional packages to /usr/lib/fai/nfsroot:
403 perl-5.005 dhcp-client file rdate cfengine bootpc wget rsh-client less dump ext2resize raidtools2 strace expect5.31 hdparm parted dnsutils grub ssh
404 grep: /etc/ssh/sshd_config: No such file or directory
405 grep: /etc/ssh/sshd_config: No such file or directory
406 Not starting OpenBSD Secure Shell server (/etc/ssh/NOSERVER)
407 make-fai-nfsroot finished.
408 Stopping NFS kernel daemon: mountd nfsd.
409 Unexporting directories for NFS kernel daemon...done.
410 Starting NFS kernel daemon: nfsd mountd.
411 Exporting directories for NFS kernel daemon...done.
412 Kernel image file name = /usr/lib/fai/nfsroot/boot/vmlinuz-2.2.19
413 Output file name = /boot/fai/installimage
414 Kernel command line = "auto rw root=/dev/nfs nfsroot=kernel nfsaddrs=kernel"
415
416 Image Creator for MBA ROMs v1.00
417 Usage: imggen [OPTION] inputfile outputfile
418 -a, Add 3Com MBA/BootWare support
419 -r, Remove 3Com MBA/BootWare support from image file
420 -i, Show information on an image
421 -h, Help screen
422
423 In filename: /boot/fai/installimage
424 Out filename: /boot/fai/installimage_3com
425 Adding MBA support...
426 MBA support has been succesfully added
427 You have no FAI configuration. Copy FAI template files with:
428 cp -a /usr/share/fai/templates/* /usr/local/share/fai
429 Then change the configuration files to meet your local needs.
430 FAI setup finished.
431 </example>
432
433 <p>
434 The setup routine adds lines to <file>/etc/exports</file> to export
435 some directories to all hosts that belong to the netgroup
436 <em>faiclients</em>. All install clients must belog to this netgroup,
437 in order to mount these directories succesfully. Netgroups are
438 defined in <file>/etc/netgroup</file> or in the corresponding NIS
439 map. An example for the netgroup file can be found in
440 <file>/usr/share/doc/fai/examples/etc/netgroup</file>. For more
441 information, read the manual pages <manref name="netgroup"
442 section="5"> and the NIS HOWTO. After changing the netgroups , the NFS
443 server has to reload its configuration. Use one of the following
444 commands, depending on which NFS server you are using:
445
446 <example>
447 kueppers[~]# /etc/init.d/nfs-kernel-server reload
448 kueppers[~]# /etc/init.d/nfs-server reload
449 </example>
450
451 <p>
452 The setup also creates the account <tt>fai</tt> ($LOGUSER). The log
453 files of all install clients are saved to the home directory of this
454 account. If you boot from network card, you should change the primary
455 group of this account, so this account has write permissions to
456 <file>/boot/fai</file> in order to change symbolic links to the kernel
457 image, that is booted by a client. See also variable
458 <var>TFTPLINK</var> in <file>class/DEFAULT.var</file>.
459
460
461 <p>
462 After that, FAI is installed successfully on your server, but has no
463 configuration for the install clients. Start with the templates from
464 <tt> /usr/share/fai/templates</tt> using the copy command above
465 and read <ref id="config">. Before you can set up a DHCP or BOOTP
466 daemon, you should collect some network information of all your
467 install clients. This is described in section <ref id="bootfloppy">.
468 <p>
469 When you make changes to &fc; or want to install a new kernel to
470 nfsroot, the nfsroot has to be rebuild by calling <prgn>make-fai-nfsroot</prgn>.
471
472 <chapt id="booting">Preparing booting <p>
473
474 Before booting for the first time, you have to choose which medium you
475 use for booting. You can use the boot floppy or configure the computer
476 to boot via network card using a boot PROM, which is much smarter.
477
478 <sect id="nicboot">Booting from 3Com network card with boot PROM
479 <p>
480 If you have a 3Com network card that is equipped with a boot ROM by
481 Lanworks Technologie or already includes the DynamicAccess Managed PC
482 Boot Agent (MBA) software<footnote> <p><httpsite>http://support.3com.com/</httpsite>
483 <httppath>infodeli/tools/nic/mba.htm</httppath></p></footnote>, you
484 can enter the MBA setup by typing <tt>Ctrl+Alt+B</tt> during boot. The
485 setup will look like this:
486
487 <example>
488 Managed PC Boot Agent (MBA) v4.00
489 (C) Copyright 1999 Lanworks Technologies Co. a subsidiary of 3Com Corporation
490 All rights reserved.
491 ===============================================================================
492 Configuration
493
494 Boot Method: TCP/IP
495 Protocol: BOOTP
496 Default Boot: Network
497 Local Boot: Enabled
498 Config Message: Enabled
499 Message Timeout: 3 Seconds
500 Boot Failure Prompt: Wait for key
501 ===============================================================================
502 Use cursor keys to edit: Up/Down change field, Left/Right change value
503 ESC to quit, F9 restore previous settings, F10 to save
504 </example>
505
506 Set the boot method to <tt>TCP/IP</tt> and the protocol to either
507 <tt>BOOTP</tt> or <tt>DHCP</tt>. I prefer BOOTP because the daemon
508 automaticly reloads its configuration when it's changed.
509 Make a symbolic link from the hostname of your client to the
510 appropriate kernel image in <file>/boot/fai</file>. In the following
511 example the host is called <tt>bigfoot</tt>. The file
512 <file>installimage_3com</file> is created by <prgn>imggen</prgn> and
513 suitable for booting 3Com network cards.
514
515 <example>
516 kueppers[~]# cd /boot/fai
517 kueppers[~]# ln -s installimage_3com bigfoot
518 </example>
519
520
521 <sect id="pxeboot">Booting from network card with a PXE conforming boot ROM
522 <p>
523 Some network cards (e.g. Intel EtherExpress PRO 100) have a fixed
524 configuration for booting using the PXE protocol. This requires a PXE
525 Linux boot loader an a special version of the <tt>TFTP</tt> daemon. See
526 <file>/usr/share/doc/syslinux/pxelinux.doc.gz</file> for more
527 information, how to boot such an environment. There are also some
528 mails in the FAI mailing list archive concerning this topic.
529
530 <sect id="bootfloppy">Creating a boot floppy
531 <p>
532 If your network card can't boot itself, you have to boot via
533 floppy. Use the command <prgn>make-fai-bootfloppy</prgn> to create the
534 boot floppy. Since there's no client specific information on this
535 floppy, it's suitable for all your install clients.
536 You can also specify additional kernel parameters for this boot
537 floppy, if desired. There's more help available.
538 <example># make-fai-bootfloppy -h</example>
539 If you have no BOOTP or DHCP server, supply the network
540 configuration as kernel parameters.
541 <footnote>
542 The format is: <example>ip=&lt;client-ip&gt;:&lt;server-ip&gt;:&lt;gw-ip&gt;:&lt;netmask&gt;:&lt;hostname&gt;:&lt;device&gt;:&lt;autoconf&gt;
543 </example>For additional information see <file>/usr/src/linux/Documentation/nfsroot.txt</file> in the kernel
544 sources.
545 </footnote>
546
547 <sect id="mac">Collecting Ethernet addresses<p>
548
549 Now it's time to boot your install clients for the first time. They
550 will fail to boot completely, because no BOOTP or DHCP daemon is running yet or
551 recognizes the hosts. But you can use this first boot attempt to
552 easily collect all Ethernet addresses of the network cards.
553 <p>
554
555 You have to collect all Ethernet (MAC) addresses of the install clients
556 and assign a hostname and IP address to each client. To collect
557 all MAC addresses, now boot all your install clients. While the
558 install clients are booting, they send broadcast packets to the LAN. You
559 can log the MAC addresses of these hosts, if following
560 command is running simultaneously on the server:
561
562 <example># tcpdump -qte broadcast and port bootpc >/tmp/mac.lis</example>
563
564 <p>
565 After the hosts has been sent some broadcast packets (they will fail
566 to boot because <prgn>bootpd</prgn> isn't running or does not recognize the MAC
567 address yet) abort <prgn>tcpdump</prgn> by typing <tt>ctrl-c</tt>. You get a list
568 of all unique MAC addresses with these commands:
569
570 <example># perl -ane 'print "\U$F[0]\n"' /tmp/mac.lis|sort|uniq</example>
571
572 After that, you only have to assign these MAC addresses to hostnames
573 and IP addresses (<file>/etc/ethers</file> and <file>/etc/hosts</file>
574 or corresponding NIS maps). With these information you can configure
575 your <prgn>BOOTP</prgn> or <prgn>DHCP</prgn> daemon (see the section
576 <ref id="bootptab">). I recommend to write the MAC addresses (last
577 three bytes will suffice if you have network cards from the same
578 vendor) and the hostname in the front of each chassis.
579
580 <sect id=bootptab>Configuration of the BOOTP daemon<p>
581
582 An example configuration for the BOOTP daemon is included in FAI. If
583 you have no <file>/etc/bootptab</file> file you can use
584 <file>/usr/share/doc/fai/examples/etc/bootptab</file> as template.
585
586 <example>
587 # /etc/bootptab example for FAI
588 # replace FAISERVER with the name of your install server
589
590 .faiglobal:\
591 :ms=1024:\
592 :hd=/boot/fai:\
593 :hn:bs=auto:\
594 :rp=/usr/lib/fai/nfsroot:
595 # rp: $NFSROOT
596
597 # your local values
598 #
599 # sa: your tftp server (install server)
600 # ts: your timeserver (time enabled in inetd.conf)
601
602 # these are optional
603 # ys: NIS server
604 # yd: NIS domainname
605 # nt: list of NTP servers
606
607 .failocal:\
608 :tc=.faiglobal:\
609 :sa=FAISERVER:\
610 :ts=FAISERVER:\
611 :T170="FAISERVER:/usr/local/share/fai":\
612 :T171="sysinfo":\
613 :sm=255.255.255.0:\
614 :gw=134.95.9.254:\
615 :dn=informatik.uni-koeln.de:\
616 :ds=134.95.9.136,134.95.100.209,134.95.100.208,134.95.140.208:\
617 :ys=rubens:yd=informatik4711.YP:\
618 :nt=time.rrz.uni-koeln.de,time2.rrz.uni-koeln.de:
619
620 # now one entry for each install client
621 bigfoot:ha=0x00105A240012:bf=bigfoot:tc=.failocal:T171="sysinfo":T172="verbose sshd createvt debug ":
622 ant01:ha=0x00105A000000:bf=ant01:tc=.failocal:T172="sshd":
623 </example>
624
625 Insert one line for each install client at the end of this file as
626 done for <em>bigfoot</em> and <em>ant01</em>. Replace the string
627 <tt>FAISERVER</tt> with the name of your install server. If the
628 install server has multiple network cards and host names, use the host
629 name of the network card to which the install clients are
630 connected. Then adjust the other network tags (<tt>sm, gw, dn,
631 ds</tt>) to your local needs.
632
633 <taglist>
634 <tag>sm</tag> <item> <p>: Subnet mask</p> </item>
635 <tag>gw</tag> <item> <p>: Default gateway / router</p> </item>
636 <tag>dn</tag> <item> <p>: Domain name</p> </item>
637 <tag>ds</tag> <item> <p>: List of DNS server </p> </item>
638 <tag>T170</tag> <item> <p>Location of the FAI configuration directory
639 </p> </item>
640 <tag>T171</tag> <item> <p>FAI_ACTION</p> </item>
641 <tag>T172</tag> <item> <p>List of FAI_FLAGS; e.g. verbose, debug, reboot, createvt, sshd</p> </item>
642 <tag>T173</tag> <item> <p>Reserved for future use</p> </item>
643 <tag>T174</tag> <item> <p>Reserved for backup devices and backup options; NOT YET USED
644 </p> </item>
645 </taglist>
646
647 The tags for NIS and time servers (<tt>yp, yd, nt</tt>) are
648 optional. Tags with prefix <tt>T</tt> (starting from T170) are generic
649 tags which are used to transfer some FAI specific data to the
650 clients. <strong> It is important, that T171 (equivalent to variable
651 <var>FAI_ACTION</var><footnote> <p>Theses names are used in the main
652 installation script <file>rcS_fai</file>. The configuration files for
653 DHCP and BOOTP daemons use other names. Example: <var>FAI_ACTION</var>
654 is equal to <tt>T171</tt> in bootptab or <tt>option-171</tt> in
655 dhcp.conf. </p> </footnote>. is set to <tt>sysinfo</tt> !</strong>
656 Later you can set it to <tt>install</tt>, in order to start the
657 automatic installation. For more information on all tags see <manref
658 name="bootptab" section="5">.
659 <p>
660
661 When you have created your <file>bootptab</file> file, you have to
662 enable the BOOTP daemon once. It's installed but Debian does not enable it
663 by default. Edit <file>/etc/inetd.conf</file> and remove the comment
664 (the hash) in the line containing <tt>#bootps</tt>. Then tell
665 <prgn>inetd</prgn> to reload its configuration.
666
667 <example># /etc/init.d/inetd reload</example>
668
669 I recommend to use the BOOTP daemon and protocol for booting because
670 it automatically reloads the configuration file if any changes are
671 made to it. The daemon for DHCP must always be manually restarted
672 after changes to the configuration file are made <footnote> <p>If you
673 can't use one of these, there's also the possibility to supply all
674 information via a file or compile them into the kernel, but it's
675 easier to use a daemon.
676 </p>
677 </footnote>. Now it's time to boot all install clients again!
678
679
680
681
682
683
684
685
686 FAI can perform several actions when the client is booting. This action
687 is defined in the variable <var>FAI_ACTION</var>
688
689 Be very carefully if you set <var>FAI_ACTION </var> to
690 <em>install</em>. This can destroy all your data on the install
691 client, indeed most time it should do this ;-). It's recommended to change this only
692 on a per client base in the BOOTP configuration. Do not change it in
693 the section <tt>.failocal</tt> in <file>/etc/bootptab</file>, which
694 is a definition for all clients.
695
696 <sect id="bootdhcp">Configuration of the DHCP daemon <p>
697 An example for <manref name="dhcp.conf" section="5"> is available in
698 <file>/usr/share/doc/fai/examples/etc</file>. If you make any changes
699 to this configuration, you must restart the daemon.
700
701
702 <sect id="bootmesg">Boot messages <p>
703
704 These are the messages, when booting from floppy.
705 <example>
706 LILO Loading FAI-BOOTP.
707 Uncompressing Linux... OK, booting the Kernel.
708 Linux version 2.2.19 (root@kueppers) (gcc version 2.95.2 20000220
709 .
710 .
711 .
712 </example>
713 The rest of the boot message will be equal to those when booting from
714 network card. When booting from network card you will see:
715 <example>
716 BOOTP.
717 TFTP....
718 Linux Net Boot Image Loader Version 0.8.1 (netboot)
719 .
720 Uncompressing Linux... OK, booting the Kernel.
721 Linux version 2.2.19 (root@kueppers) (gcc version 2.95.2 20000220
722 .
723 .
724 .
725 Sending BOOTP requests ..... OK
726 IP-Config: Got BOOTP answer from 134.95.9.149
727 IP-Config: Complete:
728 device=eth0, addr=134.95.9.200, mask=255.255.255.0, gw=134.95.9.254,
729 host=ant01, domain=informatik.uni-koeln.de, nis-domain=informatik4711.YP,
730 bootserver=134.95.9.149, rootserver=134.95.9.149, rootpath=/usr/lib/fai/nfsroot
731 .
732 .
733 ------------------------------------------------------
734 FAI 2.0, 15 may, 2001
735 Fully Automatic Installation for Debian GNU/Linux
736
737 Copyright (c) 1999-2001, Thomas Lange
738 lange@informatik.uni-koeln.de
739 ------------------------------------------------------
740 .
741 .
742 /fai mounted from kueppers:/usr/local/share/fai
743 FAI_ACTION: sysinfo
744 .
745 .
746 Press &lt;RETURN&gt; to reboot or ctrl-c to execute a shell
747 </example>
748
749 When the copyright message is shown, the install client has mounted
750 the nfsroot<footnote> <p><file>/usr/lib/fai/nfsroot</file> from the
751 install server</p> </footnote> to the clients root directory <file>/</file>. This
752 is the whole filesystem for the client at this moment. When
753 <file>/fai</file> is mounted, the configuration data from the install
754 server is available on the client.
755 <p>
756
757 Following error message indicates, that your install client doesn't
758 get an answer from a BOOTP server. Check your cables or start the
759 <manref name="bootpd" section="8"> daemon with the debug flag enabled.
760 <example>
761 Sending BOOTP requests ........ timed out!
762 IP-Config: Retrying forever (NFS root)...
763 </example>
764
765 If you get the following error message, the install kernel has
766 no driver compiled in for your network card.
767 <example>
768 IP-Config: No network devices available
769 Partition check:
770 hda: hda1 hda2 < hda5 hda6 hda7 hda8 >
771 Root-NFS: No NFS server available, giving up.
772 VFS: Unable to mount root fs via NFS, trying floppy.
773 VFS: Insert root floppy and press ENTER
774 </example>
775 Then you have to compile a new kernel has a driver compiled in, which
776 supports your network card. This driver must no be a kernel module. To
777 compile the new kernel, start using the default kernel configuration
778 of FAI.
779 <example>
780 kueppers# cd /usr/src/linux
781 kueppers# cp /usr/lib/fai/nfsroot/boot/config-2.2.19 .config
782 kueppers# make menuconfig
783 </example>
784 Call <prgn>make menuconfig</prgn> and add the driver in menu <tt>Network
785 device support/Ethernet</tt> which supports your network card. Then
786 create a Debian package using <manref name="make-kpkg" section="8">:
787 <example>
788 kueppers# make-kpkg clean
789 kueppers# make-kpkg --revision BOOTP2 kernel-image
790 </example>
791
792 This command creates the file
793 <file>/usr/src/kernel-image-2.2.19_BOOTP2_i386.deb</file>. Adjust
794 the variable <var>KERNELPACKAGE</var> in &fc; and rebuild the nfsroot.
795 <example>
796 kueppers# make-fai-nfsroot
797 </example>
798 After that, you have to create a new boot floppy. Now your network
799 card should be recognized and the install kernel should mount
800 the nfsroot successfully. More information how to compile an
801 install kernel can be found in the <file>README</file> of the package <tt>fai-kernels</tt>.
802
803 <sect id="sysinfo">Collecting other system information
804 <p>
805
806 Now the clients have booted with <var>FAI_ACTION</var> set to <em>sysinfo</em>. Type
807 <tt>ctrl-c</tt> to get a shell or use <tt>Alt-F2</tt> or
808 <tt>Alt-F3</tt> and you will get another console terminal, if you have added <tt>createvt</tt>
809 to <var>FAI_FLAGS</var>.
810
811 Remote login is available via the secure shell, if <tt>sshd</tt> if
812 added to <var>FAI_FLAGS</var>. The encrypted password is set with
813 variable <var>FAI_ROOTPW</var> in &fc; and is default to "fai". You
814 can also log in without a password when using <var>
815 SSH_IDENTITY</var>. To log in from your server to the install client
816 (for eg. named ant01) use:
817
818 <example>> ssh -l root ant01
819 Warning: Permanently added 'ant01,134.95.9.200' to the list of known hosts.
820 root@ant01's password:
821 </example>
822
823
824 You have now a running Linux system on the install client
825 without using the local hard disk. Use this as a rescue system, if
826 your local disk is damaged or the computer can't boot properly from
827 hard disk. You will get a shell and can execute various commands
828 (dmesg, lsmod, df, lspci, ...). Look at the log file in
829 <file>/tmp</file>. There you can find much information about the boot
830 process.
831
832 All log files from <file>/tmp </file> are also written to the install server
833 into the directory <tt>~fai/ant01/sysinfo/</tt><footnote>More
834 general: <tt>~$LOGUSER/$HOSTNAME/$FAI_ACTION/</tt>. Examples of log
835 files can be found on the FAI homepage.
836 </footnote>
837
838 <p>
839 A very nice feature is, that FAI mounts all filesystems it finds on
840 the local disks read only. It also tells you on which partition a file
841 <file>/etc/fstab</file> exists. When only one file is found, the
842 partitions are mounted according to this information. Here's an
843 example:
844 <example>
845 ant01:~# df
846 Filesystem 1k-blocks Used Available Use% Mounted on
847 /dev/root 1249132 855648 330032 72% /
848 /dev/ram0 3963 36 3927 1% /tmp
849 kueppers:/usr/local/share/fai
850 1249132 855648 330032 72% /fai
851 /dev/hda1 54447 9859 41777 19% /tmp/target
852 /dev/hda10 1153576 20 1141992 0% /tmp/target/files/install
853 /dev/hda9 711540 20 711520 0% /tmp/target/home
854 /dev/hda8 303336 13 300191 0% /tmp/target/tmp
855 /dev/hda7 1517948 98252 1342588 7% /tmp/target/usr
856 /dev/hda6 202225 8834 182949 5% /tmp/target/var
857 </example>
858
859 <strong>This method can be used as an rescue environment !</strong> In
860 future it will be possible to make backups or restore data to existing
861 filesystems. If you need a filesystem with read-write access use the
862 <prgn>rwmount</prgn> command:
863
864 <example>ant01:~# rwmount /tmp/target/home</example>
865
866
867 <sect id=reboot>Rebooting the computer<p>
868 At any time you can reboot the computer using the command
869 <prgn>faireboot</prgn>, also if logged in from remote. If the
870 installation hasn't finished, use <tt>faireboot -s</tt>, so the log
871 files are also copied to the install server.
872
873 <chapt id=instprocess>Overview of the installation sequence<p>
874
875 Following steps are performed during an installation after the linux kernel
876 has booted on the install clients.
877
878 <enumlist>
879 <item> <p>Set up FAI </p> </item>
880 <item> <p>Load kernel modules</p> </item>
881 <item> <p>Define classes</p> </item>
882 <item> <p>Define variables</p> </item>
883 <item> <p>Partition local disks</p> </item>
884 <item> <p>Create and mount local filesystems</p> </item>
885 <item> <p>Install software packages</p> </item>
886 <item> <p>Call site specific configuration scripts</p> </item>
887 <item> <p>Save log files</p> </item>
888 <item> <p>Reboot the new installed system</p> </item>
889 </enumlist>
890
891 You can also define additional programs, that will be run on particular
892 occasions. They are called <tt>hooks</tt>. So it's very easy to
893 customize the whole installation process. Hooks are explained in
894 detail in <ref id="hooks">.
895
896 <p>
897 The installation time is mainly determined by the amount of software
898 that will be installed. A dual Pentium II, 400 MHZ with 128 MB RAM and
899 a 10 Mbit network card needs about 11 min when installing 520 MB of
900 software to local disk. An installation with 90 MB software (a
901 dataless client) only needs two minutes. The checking for bad blocks
902 on a 4 GB partition needs additional 6 minutes. Using a 100 Mbit LAN does
903 not decrease the installation time considerable, so the network will
904 not be the bottleneck when installing multiple clients simultaneously.
905
906 <sect id=isetup>Set up FAI<p>
907
908 After the install client has booted, only the program
909 <file>/sbin/rcS_fai</file><footnote><p>Since the root filesystem on
910 the clients is mounted via NFS, <prgn>rcS_fai</prgn> is located in
911 <file>/usr/lib/fai/nfsroot/sbin</file> on the install server.</p>
912 </footnote> is executed. This is the main script, that controls the
913 sequence of tasks for FAI. No other scripts in
914 <file>/etc/init.d/</file> are executed.
915 <p>
916 A ramdisk is created and mounted to <file>/tmp</file>, which is the
917 only writable directory, until local filesystems are
918 mounted. Additional parameters are received from the BOOTP or DHCP
919 daemon and the configuration space if
920 mounted via NFS from the install server to <file>/fai</file>. The
921 setup is finished after additional virtual terminals are created and
922 the secure shell daemon for remote access is started on demand.
923
924 <sect id=iclass>Defining classes, variables and loading kernel modules<p>
925
926 Now scripts in <file>/fai/class/</file> are executed to define classes
927 and variables that are later used in the site specific configuration
928 scripts. All scripts matching <tt>S[0-9]*.{sh,pl}</tt> are executed
929 in alphabetical order. Every word that these scripts print to the
930 standard output are interpreted as class names. These classes are
931 defined for this install client. You can also say this client belongs
932 to these classes. A class is defined or undefined and has no
933 value. Only defined classes are of interest for an install client. A
934 description of all classes can be found in
935 <file>/usr/share/doc/fai/classes_description.txt</file>. It is
936 advisable to document the task a new class performs. Then, this
937 documentation is the base for composing a configuration from classes.
938
939 <p>
940 The scripts <prgn>S05modules.sh</prgn> loads kernel modules
941 on demand. So you can use classes when loading modules and also define
942 more classes after the kernel has loaded modules and recognized new hardware.
943 A complete description of all these scripts can be found in <ref id="cscripts">.
944 <p>
945
946 After defining the classes, every file
947 matching <tt>*.var</tt>, which prefix is a defined class, is executed
948 to define variables.
949
950 <sect id=ipartition>Partitioning local disks, creating filesystems<p>
951
952 Then one (only one) disk configuration file from
953 <file>/fai/disk_config</file> is selected using classes. It's the
954 description how all the local disks will be partitioned, which
955 filesystems should be created and how they are mounted. It's also
956 possible to preserve the disk layout or to preserve the data on a
957 partition. It's done by the command <prgn>setup_harddisks</prgn>
958 <footnote> <p>If <prgn>/usr/local/bin/my-fdisk</prgn> exists, this
959 command is used instead. In future, this script will be completely
960 rewritten. Plans are to use <prgn>parted</prgn> or <prgn>fdisk</prgn>
961 and the device filesystems <tt>devfs</tt>. </footnote>, which uses
962 <prgn>sfdisk</prgn> for obtaining disk information and for
963 partitioning. The format of the configuration file is described in
964 <file>/usr/share/doc/fai/README.disk_config</file>.
965 <p>
966 During the installation process all local filesystems are mounted
967 relative to <file>/tmp/target</file> . So, for
968 e.g. <file>/tmp/target/home</file> will become <file>/home</file>
969 in the new installed system.
970
971 <sect id=ipackages>Installing software packages<p>
972
973 When local filesystems are created, they are all empty (except for
974 preserved partitions). Now the Debian base system and all requested
975 software packages are installed on the new filesystems. First the
976 base archive is unpacked, then the command
977 <prgn>install_packages</prgn> installs all packages using <manref
978 name="apt-get" section="8"> without any manually interaction needed. If
979 a packages requires an other packages it resolves
980 this dependency by installing the required package.
981 <p>
982
983 Classes are also used when selecting the configuration files in
984 <file>/fai/package_config/</file> for software installation. The
985 format of the configuration files is described in <ref
986 id="packageconfig">.
987
988 <sect id=icscripts>Site specific configuration<p>
989
990 After all requested software packages are installed, the system is
991 nearly ready to go. But not all default configurations of the software
992 packages will meet your site specific needs. So you can call arbitrary
993 scripts, which adjust the system configuration. Therefore scripts, that match
994 a class name in <file>/fai/scripts</file><footnote>
995 <p><file>/usr/local/share/fai/scripts</file> on the install
996 server.</p> </footnote> will be executed. FAI comes with some
997 templates for these scripts, but you can write your own bourne, bash,
998 perl, cfengine or expect scripts.
999 <p>
1000 These important scripts are described in detail in <ref
1001 id="cscripts">.
1002
1003 <sect id=isavelog>Save log files<p> When all installation tasks are
1004 finished, the log files are written to
1005 <tt>/var/log/fai/$HOSTNAME/install/</tt> <footnote>
1006 <p><file>/var/log/fai/localhost/install/</file> is a link to this
1007 directory.</p> </footnote> on the new system and to
1008 the a account on the install
1009 server, if <var>$LOGUSER</var> is defined in &fc;.
1010
1011 <sect id=ireboot>Reboot the new installed system<p>
1012
1013 At least the system is automatically rebooted if the flag
1014 <var>reboot</var> is set <footnote><p>Add "reboot" to
1015 <var>FAI_FLAGS</var> (= T172).</p> </footnote>. This is only useful
1016 if booting from network card or if you can change the boot device
1017 using the command <prgn>bootsector</prgn>. Otherwise, you have to
1018 remove the floppy disk and type return or call <prgn>faireboot</prgn>
1019 from a remote login. You must change the boot device, to boot the new
1020 installed system otherwise the installation would be performed
1021 again. Read <ref id="changeboot"> how to change the boot device.
1022
1023 <chapt id=plan>How to plan your installation<p>
1024 <em>Plan your installation, and FAI installs your plans.</em>
1025 <p>
1026 Before starting your installation, you should spend much time in
1027 planing your installation. When you're happy with your installation
1028 concept, FAI can do all the boring, repeating tasks to put your plans
1029 into practice. FAI can't do good installations, if your concept is
1030 imperfect or lacks some important details. Start planing the
1031 installations by answering yourself following
1032 questions:
1033
1034 <taglist>
1035 <tag></tag> <item> <p>Will I create a Beowulf cluster, or do I
1036 have multiple workstations, each only used by a single user ?</p> </item>
1037 <tag></tag> <item> <p>How does my LAN topology looks like ?</p> </item>
1038 <tag></tag> <item> <p>Do I have uniform hardware ?</p> </item>
1039 <tag></tag> <item> <p>Will the hardware stay uniform in the future ?</p> </item>
1040 <tag></tag> <item> <p>How should the hosts be named ?</p> </item>
1041 <tag></tag> <item> <p>How should the local harddisks be partitioned ?</p> </item>
1042 <tag></tag> <item> <p>Which software should be installed ?</p> </item>
1043 <tag></tag> <item> <p>Which daemons should be started, and how
1044 should the configuration for these looks like ?</p> </item>
1045 <tag></tag> <item> <p>Which remote filesystems should be mounted ?</p> </item>
1046 <tag></tag> <item> <p>Does the hardware needs a special kernel ?</p> </item>
1047 <tag></tag> <item> <p></p> </item>
1048 </taglist>
1049
1050 You have also to think about user accounts, printing, mail, cron jobs,
1051 graphic cards, dual boot, NIS, NTP, timezone, keyboard layout,
1052 exporting and mounting directories via NFS and many other things. So,
1053 there's a lot to do before starting an installation. And remember
1054 that knowledge is power, and it's up to you to use it. Installation
1055 and administration is a process, not a product. FAI can't do things
1056 you don't tell it to do.
1057 <p>
1058 But you need not to start from scratch. Look at all files and scripts
1059 in the configuration space. There are a lot of things you can use for
1060 your own installation.
1061
1062 A good paper with more aspects of building an infrastructure is
1063 <url id="http://www.infrastructures.org/papers/bootstrap/">
1064 "Bootstrapping an Infrastructure".
1065
1066 <chapt id=config>Installation details<p>
1067
1068 <sect id=c3>Configuration space<p>
1069
1070 The configuration is the collection of information how exactly to
1071 install a computer. The central configuration space for all install
1072 clients is located on the server in <file>/usr/local/share/fai</file>
1073 and its subdirectories. This will be mounted by the install clients to
1074 <file>/fai</file>. Following subdirectories are available:
1075
1076 <taglist>
1077 <tag><tt>class/</tt></tag> <item> <p>Scripts and files to
1078 load kernel modules and define classes and variables</p> </item>
1079 <tag><tt>disk_config/</tt></tag> <item> <p>Configuration
1080 files for disk partitioning and file system creation</p> </item>
1081 <tag><tt>package_config/</tt></tag> <item> <p>Software
1082 packages to be installed or removed</p> </item>
1083 <tag><tt>scripts/</tt></tag> <item> <p>Script for customization</p> </item>
1084 <tag><tt>files/</tt></tag> <item> <p>Files used by
1085 customization scripts</p> </item>
1086 </taglist>
1087
1088 The main installation script <prgn>rcS_fai</prgn> uses these
1089 subdirectories in the order listed. Copy the configuration templates
1090 to the configuration space and start an installation.
1091
1092 <example>
1093 > cp -a /usr/share/fai/templates/* /usr/local/share/fai
1094 </example>
1095
1096 These files contain configuration for some example hosts.
1097
1098 <taglist>
1099 <tag>bigfoot</tag> <item> <p>Is a server with much software. It
1100 provides the home directory and all programs for its NFS clients. Also some
1101 daemons are installed and activated by default.</p> </item>
1102 <tag>ant01,...</tag> <item> <p>Are dataless clients, which
1103 mounts <file>/usr</file> and <file>/home</file> from bigfoot. Most of
1104 the disk space is spend for a scratch partition, which is exported
1105 to a netgroup of hosts.</p> </item>
1106 </taglist>
1107 Start looking at these examples and study them. Then change or add
1108 things to these examples. But don't forget to plan your own
1109 installation !
1110
1111 <sect id=s1> Set up FAI<p>
1112
1113 Since only the ramdisk is writable in the beginning, all log
1114 files are written to <file>/tmp</file>. The main script
1115 <prgn>rcS_fai</prgn> logs its messages to
1116 <file>/tmp/rcS.log</file>. If you have any problems during
1117 installation, look for errors there. You can find examples of the log files for
1118 some hosts in the download directory of the FAI homepage.<p>
1119
1120 When the kernel has booted and the network interface is set up, the
1121 BOOTP (or DHCP) server is inquired a second time to get the additional
1122 information for FAI. The command <manref name="bootpc" section="8"> is
1123 called and its output is used to define the corresponding global
1124 variables.
1125
1126 <example>
1127 /tmp/bootpc.log:
1128
1129 SERVER='134.95.9.149'
1130 IPADDR='134.95.9.200'
1131 BOOTFILE='/boot/fai/bigfoot'
1132 NETMASK='255.255.255.0'
1133 NETWORK='134.95.9.0'
1134 BROADCAST='134.95.9.255'
1135 GATEWAYS_1='134.95.9.254'
1136 GATEWAYS='134.95.9.254'
1137 ROOT_PATH='/usr/lib/fai/nfsroot'
1138 DNSSRVS_1='134.95.9.136'
1139 DNSSRVS_2='134.95.100.209'
1140 DNSSRVS_3='134.95.100.208'
1141 DNSSRVS_4='134.95.140.208'
1142 DNSSRVS='134.95.9.136 134.95.100.209 134.95.100.208 134.95.140.208'
1143 DOMAIN='informatik.uni-koeln.de'
1144 SEARCH='informatik.uni-koeln.de uni-koeln.de'
1145 YPSRVR_1='134.95.9.10'
1146 YPSRVR='134.95.9.10'
1147 YPDOMAIN='informatik4711.YP'
1148 TIMESRVS_1='134.95.9.10'
1149 TIMESRVS='134.95.9.10'
1150 NTPSRVS_1='134.95.81.172'
1151 NTPSRVS_2='134.95.140.172'
1152 NTPSRVS='134.95.81.172 134.95.140.172'
1153 HOSTNAME='bigfoot'
1154 T170='kueppers:/usr/local/share/fai'
1155 T171='sysinfo'
1156 T171='install'
1157 T172='sshd'
1158 </example>
1159
1160 It's not a bug, if a variable (T171 in the example above) is defined
1161 twice. The second definition supersedes the first.
1162
1163
1164 <p>
1165 Following <var>FAI_FLAGS</var> (T172) are known:
1166 <taglist>
1167 <tag>verbose</tag> <item> <p>Create verbose output during
1168 installation. This should be alsway the first flag, so consecutive
1169 definitions of flags will be verbosely displayed.</p> </item>
1170
1171 <tag>debug</tag> <item> <p>Create debug output. No interactive
1172 installation is performed. During package installation you have to
1173 answer all questions of the postinstall scripts from the
1174 console. </p> </item>
1175
1176 <tag>sshd</tag> <item> <p>Start ssh daemon to enable remote logins.</p> </item>
1177
1178 <tag>createvt</tag> <item> <p>Create two virtual terminals and execute a bash if <tt>ctrl-c</tt> it typed. The terminals can be accessed by typing <tt>Alt-F2</tt> or <tt>Alt-F3</tt>. Otherwiese no terminals are available and typing <tt>ctrl-c</tt> will reboot the install client. Useful for installation which should not be interruptible.</p> </item>
1179
1180 <tag>reboot</tag> <item> <p>Reboot after installation is finished
1181 without typing RETURN on the console. Only useful if you can change
1182 the boot image or boot device automatically (Can your assembly robot remove the
1183 boot floppy via remote control ?). Currently useful if you boot from network card and use
1184 <var>$TFTPLINK</var>. or change the boot device with the command
1185 <prgn>bootsector</prgn>.</p> </item>
1186 </taglist>
1187
1188
1189 <sect id=classc> The class concept<p>
1190
1191 The idea of using classes in general and using certain files matching
1192 a class name for a configuration is adopted from the installation
1193 scripts by Casper Dik for Solaris. This technique proved to be very
1194 useful for the SUN workstations, so I also use it for the fully
1195 automatic installation of Linux. One simple and very efficient feature
1196 of Casper's scripts is to call a command with all files, whose file
1197 names are also a class. The following loop may implement this function
1198 in a shell script:
1199
1200 <example>
1201 for class in $all_classes
1202 do
1203 if [ -r $config_dir/$class ]; then
1204 command $config_dir/$class
1205 # exit, if only the first matching file is needed
1206 fi
1207 done
1208 </example>
1209 A variation would be to call the command only for the first file that
1210 matches a class name. Therefore it is possible to add a new file to
1211 the configuration without changing the script. This is because the
1212 loop automaticly detects new configurations files that should be
1213 used. Unfortunately cfengine does not support this nice feature, so
1214 all classes being used in cfengine need also to be specified inside
1215 the cfengine scripts. Classes are very important for the fully
1216 automatic installation. If a client belongs to class <tt>A</tt>, we
1217 say the class <tt>A</tt> is defined. A class has no value, it is just
1218 defined or undefined. Within scripts, the variable <var>$classes</var>
1219 holds a space separated list with the names of all defined classes.
1220 Classes determine how the installation is performed. For example, an
1221 install client is configured to become a FTP server by default.
1222
1223 Mostly a configuration is created by only changing or appending the
1224 classes to which a client belongs, making the installation of a new
1225 client very easy. Thus no additional information needs to be added to
1226 the configuration files if the existing classes suffice your needs.
1227 There are different possibilities to define classes:
1228 <enumlist>
1229 <item><p>Some default classes are defined for every host:
1230 DEFAULT, LAST and its hostname.</p> </item>
1231 <item><p>Classes may listed within a file.</p> </item>
1232 <item><p>Classes may be defined by scripts.</p> </item>
1233 </enumlist>
1234
1235 The last option is a very nice feature, since these scripts will
1236 define classes automatically. For example, several classes are
1237 defined only if certain hardware is identified. We use Perl and shell
1238 scripts to define classes. All names of classes, except the hostname,
1239 are written in uppercase. They must not contain a hyphen, a hash or a
1240 dot, but may contain underscores. A description of all classes can be
1241 found in <file>/usr/share/doc/fai/classes_description.txt</file>.
1242 <p>
1243
1244 Hostnames should rarely be used for the configuration files in the
1245 configuration space. Instead, a class should defined and this class is
1246 then added to the host.
1247
1248 <sect id=s2> Scripts in <tt>class/</tt><p>
1249
1250 The main FAI script <file>rcS_fai</file> defines the classes
1251 <tt>DEFAULT, LAST, $HOSTNAME</tt> and all classes in the file
1252 <file>/fai/class/</file><tt>$HOSTNAME</tt> for every hosts.
1253 Additionally, all files that are executable and match the shell
1254 regular expression <tt>S[0-9]*.{sh,pl}</tt> are called in alphabetical
1255 order. Every output from these scripts is used to define
1256 classes. Multiple classes in one line must be space separated. The
1257 list of all defined classes is stored in the variable
1258 <var>$classes</var> and in <file>/tmp/FAI_CLASSES</file>. The list of
1259 all classes is transfered to <prgn>cfengine</prgn>, so it can use them
1260 too. Script <file>S01alias.sh</file> (see below) is used to define
1261 classes for groups of hosts. All hosts with prefix <var>ant</var> use
1262 all classes in the file <file>anthill</file>. Hosts, which have an IP
1263 address in subnet <var>134.95.9.0</var> also belongs to class
1264 <tt>NET_9</tt>. Finally this scripts defines the class with the name
1265 of the hardware architecture in uppercase letters.
1266
1267 <example>
1268 S01alias.sh:
1269
1270 # all hosts named ant?? are using the classes in file anthill
1271 case $HOSTNAME in
1272
1273 ant??)
1274 cat anthill ;;
1275 esac
1276
1277 # if host belongs to class C subnet 134.95.9.0 use class NET_9
1278 case $IPADDR in
1279 134.95.9.*)
1280 echo NET_9 ;;
1281 esac
1282
1283
1284 # echo architecture
1285 dpkg --print-installation-architecture | tr /a-z/ /A-Z/
1286 </example>
1287
1288 Script <file>S07disk.pl</file> can be used to define classes depending
1289 on the number of local disks or the size of these scripts<footnote>
1290 <p>It uses the library <file>Fai.pm</file>, which includes some useful
1291 subroutines, e.g. <tt>class</tt>, <tt>classes</tt>,
1292 <tt>read_memory_info</tt>, <tt>read_ethernet_info</tt>.</p>
1293 </footnote>. But you can also use a range of partition size in the
1294 disk configuration file (in <file>disk_config</file>), so you may not
1295 need a class for every different disk size. The script
1296 <file>S24nis.sh</file> automatically defines classes corresponding to
1297 NIS. The name of the NIS domain (defined via BOOTP or DHCP) will also
1298 become a class (only uppercase letters and minus is replaced by
1299 underscore). Depending on several partition names,
1300 <file>S90partitions.pl</file> defines classes. For eg., if a partition
1301 <file>/files/scratch</file> exists, the install client will export
1302 this directory via NFS therefore installs a NFS server packages.
1303
1304 <p>
1305 The script <prgn>S05modules.sh</prgn> does not define any class, but
1306 is responsible for loading kernel modules. Kernel modules are
1307 important for detecting hardware. The script calls the script
1308 <tt>$HOSTNAME.mod</tt> and all scripts that have the format
1309 <tt>&lt;classname&gt;.mod</tt> and those class names are already
1310 defined. Classes, that are used for loading modules must be defined
1311 before this script is called. For e.g., if class <tt>DEFAULT</tt> is
1312 defined (this class is always defined) and a file
1313 <file>DEFAULT.mod</file> exists, this script is executed. These
1314 scripts should contain all command for loading kernel modules:
1315
1316 <example>
1317 DEFAULT.mod:
1318
1319 modprobe parport_probe
1320 modprobe serial
1321 </example>
1322
1323 You can find messages from modprobe in <file>/tmp/dmesg.log</file> and
1324 the on the fourth console terminal (pressing <tt>Alt-F4</tt>).<p>
1325
1326 <sect id=classvariables> Variables in <tt>class/*.var</tt><p>
1327
1328 All variables can be set global in <file>DEFAULT.var</file>. For
1329 certain groups of hosts use a class file or for a single host use
1330 the file <tt>$</tt><file>HOSTNAME.var</file>.
1331
1332 <taglist>
1333 <tag>hdparm</tag> <item> <p>Multi line commands to tune the
1334 harddisks. They are executed during installation and also creates the
1335 script <file>/etc/init.d/S61hdparm</file>.</p> </item>
1336
1337 <tag>UTC</tag> <item> <p>Set hardware clock to UTC if
1338 <tt>$UTC=yes</tt>. Otherwise set clock to locatime. (See <manref
1339 name="clock" section="8"> for more information.</p> </item>
1340
1341 <tag>time_zone</tag> <item> <p>File relative to
1342 <file>/usr/share/zoneinfo/</file> which indicates your time
1343 zone.</p> </item>
1344
1345 <tag>FAI_CONSOLEFONT</tag> <item> <p>Font, that is loaded during
1346 installation by <manref name="consolechars" section="8">.</p> </item>
1347
1348 <tag>FAI_KEYMAP</tag> <item> <p>Keyboard map file in
1349 <file>/usr/share/keymaps</file>. You need not specify the complete
1350 path, since this file will be located automatically.</p> </item>
1351
1352 <tag>kernelimage</tag> <item> <p>The kernel that is installed to
1353 the new system. If a Debian package
1354 <file>/fai/files/packages/</file><tt>$kernelimage</tt> exists use
1355 this as kernel package. Otherwise try installing the package
1356 <tt>$kernelimage</tt>. If <var>$kernelimage</var> is
1357 <tt>2.2.19</tt> the default kernel (package kernel-image-2.2.19)
1358 will be installed. To install the a special kernel for host
1359 bigfoot, set
1360 <tt>kernelimage=kernel-image-2.2.19_bigfoot1_i386.deb</tt>.</p></item>
1361
1362 <tag>liloappend</tag> <item> <p>Append parameters for the kernel of
1363 the new system (written to <file>/etc/lilo.conf</file>).</p> </item>
1364
1365 <tag>moduleslist</tag> <item> <p>Multi line definition. List of modules (including kernel
1366 parameters), that are loaded during boot of the new system (written to /etc/modules).</p> </item>
1367
1368 <tag>rootpw</tag> <item> <p>The root password for the new
1369 system. Additionally, FAI creates an root account with the same
1370 password called <tt>roott</tt>, which uses the <manref name="tcsh"
1371 section="1">.</p> </item>
1372
1373 <tag>TFTPLINK</tag> <item> <p>Link to the TFTP kernel image, that boots
1374 using the root file system from the local disk. </p> </item>
1375
1376 <tag>hserver, bserver</tag> <item> <p>Name of NFS servers for
1377 <file>/home</file> and <file>/usr</file>.</p> </item>
1378
1379 <tag>printers</tag> <item> <p>List of printer, for which a spool
1380 directory is created. Does not set up <file>/etc/printcap</file>.</p> </item>
1381 <tag></tag> <item> <p></p> </item>
1382 </taglist>
1383
1384
1385
1386 <sect id=diskconfig>Hard disk configuration<p> The format of the hard
1387 disk configuration files is described in
1388 <file>/usr/share/doc/fai/README.disk_config.gz</file>. The config
1389 file <file>/fai/disk_config/CS_KOELN</file> is a generic description
1390 for one IDE hard disk, which should be OK for most installations. If
1391 you can't partition your harddisk using this configuration and script
1392 <footnote><p>Currently this script uses the command
1393 <tt>sfdisk(8)</tt>, which isn't available on SUN SPARC. There could
1394 also be problems when using raid controllers or the new devfs
1395 filesystem.</p> </footnote> , you can create a script
1396 <file>/usr/local/bin/my-fdisk</file>, which will be used instead. This
1397 script should write the new partition table, create the file systems
1398 and create the file <file>/tmp/fstab</file> and
1399 <file>/tmp/disk_var.sh</file>, which contains definitions of boot and
1400 root partitions.
1401
1402 <sect id=packageconfig>Software package configuration<p>
1403 The script <prgn>install_packages</prgn> installs the selected software
1404 packages. It uses all configuration files in <file>/fai/package_config/</file>,
1405 which file name is also defined as a class. The syntax is very
1406 simple.
1407
1408 <example>
1409 # an example package class
1410
1411 PRELOADRM http://www.location.org/rp8_linux20_libc6_i386_cs1_rpm /root
1412
1413 PACKAGES install
1414 adduser netstd ae
1415 less passwd
1416 task-x-window-system
1417 realplayer
1418
1419 PACKAGES remove
1420 gpm xdm
1421
1422 PACKAGES dselect-upgrade
1423 ddd install
1424 a2ps install
1425 </example>
1426
1427 Comments are starting with a hash (#) and are ending at the end of
1428 the line. Every command begins with the word <tt>PACKAGES</tt>
1429 followed by a command name. The command name is similar to those of
1430 <prgn>apt-get</prgn>. Here's the list of supported command names:
1431
1432
1433 <taglist>
1434 <tag>install:</tag> <item> <p>Install all packages that are specified
1435 in the following lines. If a hyphen is appended to the package name
1436 (with no intervening space), the package will be removed, not
1437 installed.</p> </item>
1438
1439 <tag>remove:</tag> <item> <p>Remove all packages that are specified in
1440 the following lines. Append a + to the package name, if the package
1441 should be installed.</p> </item>
1442
1443 <tag>dselect-upgrade</tag> <item> <p> Set package selections using the
1444 following lines. The following lines must be the output of the commands
1445 <prgn>dpkg --get-selections</prgn>.
1446 </taglist>
1447
1448
1449 Multiple lines with lists of space separated names of packages follows
1450 the commands install and remove. All dependencies are resolved and <prgn>apt-get</prgn>
1451 is used to perform the installation or removal of packages. The order of the
1452 packages is of no matter.
1453 <p>
1454 A line, that contains the <tt>PRELOADRM</tt> token, loads a file into a
1455 directory before installing the packages. For examples the package
1456 <prgn>realplayer</prgn> needs an archive to install the software, so
1457 this archive is downloaded to the directory
1458 <file>/root</file>. After installing the packages this file will be
1459 removed. If the file shouldn't be removed, use the the command
1460 <tt>PRELOAD</tt> instead.
1461
1462 <p>
1463 If you specify a package that does not exists (e.g. you made a typo),
1464 the the whole installation of software package will not be started.
1465 This could happen when the command <manref name="xviddetect"
1466 section="1"> does not recognize the video card, because the
1467 configuration file <file>SERVER</file> contains following line:
1468
1469 <example>
1470 xserver-`xviddetect -q`
1471 </example>
1472
1473 If the video card isn't detected, the software installation tries to
1474 install the package <tt>xserver-unknown</tt>. It will not start
1475 because this package doesn't exist.
1476
1477 <sect id=cscripts>Scripts in <tt>/fai/scripts</tt><p>
1478
1479 The default set of scripts in this directory is only an example. But
1480 they should do a reasonable jobs for your installation. You can edit them
1481 or add new scripts to match your local needs.
1482
1483
1484
1485 <sect1 id=shell>Shell scripts<p>
1486
1487 Most script are Bourne shell script. Shell scripts are good, if the
1488 configuration task only needs to call some shell commands or create a
1489 file from scratch. In order not to write much short script, it's
1490 possible to distinguish classes within a script using the command
1491 <tt>ifclass</tt>. For copying files with classes, use the command
1492 <manref name="fcopy" section="8">. If you like to extract an archive
1493 using classes, use <manref name="ftar" section="8">.
1494 But now have a look at the scripts and see what they are doing.
1495
1496 <sect1 id=perl>Perl scripts<p>
1497 Currently no Perl scripts are used for modifying the system
1498 configuration.
1499
1500 <sect1 id=expect>Expect scripts<p>
1501 Currently no expect scripts are used for modifying the system
1502 configuration.
1503
1504 <sect1 id=cfengine>Cfengine scripts<p>
1505
1506 Cfengine has a rich set of functions to edit existing configuration
1507 files, e.g <tt>LocateLineMatching, ReplaceAll, InsertLine,
1508 AppendIfNoSuchLine, HashCommentLinesContaining</tt>. But it can't
1509 handle variables, that are undefined. If a variables is undefined,
1510 the whole cfengine script will abort.
1511
1512 More information can be found at in the manual page <manref
1513 name="cfengine" section="8"> or at the homepage for cfengine
1514 <httpsite>http://www.iu.hioslo.no</httpsite><httppath>/cfengine</httppath>.
1515
1516
1517 <sect id=changeboot>Changing the boot device<p>
1518
1519 Changing the boot sequence is normally done in your BIOS setup. But
1520 you can't change the BIOS from a running Linux system (If you know how
1521 to perform this, send me an email). But there's another way of swapping
1522 the boot device of a running Linux system.
1523
1524 <p>
1525 Change the boot sequence in your BIOS, so the first boot device is the
1526 local disk, where the master boot record is located. The second boot
1527 device should be set to LAN or floppy disk, depending from which media
1528 you boot when the installation process is performed.
1529 <p>
1530 After the installation is performed, <manref name="lilo" section="8">
1531 will write a valid boot sector to the local disk. Since it's the first
1532 boot device, the computer will boot the new installed system. If you
1533 like to perform an installation again, you have to disable this boot
1534 sector using the command <prgn>bootsector</prgn><footnote><p>The
1535 command <tt>bootsector</tt> is part og the package
1536 <package>fai</package> and will be installed to
1537 <file>/usr/local/sbin</file> on the install clients.</p></footnote>
1538 . For more information use: <example># bootsector -h
1539 </example>
1540
1541
1542 This is how to set up the a 3Com network card as second boot device,
1543 even if the BIOS doesn't support this. Enable LAN as first boot device
1544 in the BIOS.
1545
1546 <example>
1547 Boot From LAN First: Enabled
1548 Boot Sequence : C only
1549 </example>
1550
1551 Then enter the MBA setup of the 3Com network card and change it as follows:
1552 <example>
1553 Default Boot Local
1554 Local Boot Enabled
1555 Message Timeout 3 Seconds
1556 Boot Failure Prompt Wait for timeout
1557 Boot Failure Next boot device
1558 </example>
1559
1560 This will enable the first IDE hard disk as first boot device. It the
1561 boot sector of the hard disk is invalid, the computer will use the
1562 network interface as second boot device.
1563
1564 <sect id=hooks>Hooks<p>
1565
1566 Hooks let you specify functions or programs, that are run at certain
1567 steps of the installation process. FAI provides many locations, where
1568 hooks are called. As you might expect, classes are also used when
1569 calling hooks. In Emacs, every hook has to be defined and created if
1570 it should be executed. In FAI, a hook is called if a certain class is
1571 defined. So you only have to create the hook with the name of the
1572 desired class and it will be used. Hooks are executed for every
1573 defined class. If <tt>debug</tt> is included in <var>$FAI_FLAG</var>
1574 the option <tt>-d</tt> is passed to all hooks.
1575 <p>
1576 The directory <file>/usr/local/share/fai/hooks/</file> contains the
1577 hooks. The file name of a hook consists of a hook prefix and a class
1578 name, chained by a dot. The prefix describes the time when the hook is
1579 called, if the class if defined for the install client. For example,
1580 the hook <file>partition.DISKLESS</file> is called for every client
1581 belonging to the class <tt>DISKLESS</tt> before the local disks would
1582 be partitioned. Since it should become a diskless client, this hook
1583 can mount remote filesystems via NFS and create a <tt>/tmp/fstab</tt>.
1584 After that, the installation process will not try to partition and
1585 format a local hard disk, because a file <file>/tmp/fstab</file>
1586 already exists.
1587 <p>
1588 A hook of the form <tt>hookprefix.classname</tt> can't define
1589 variables for the installation script, because it's a subprocess. But
1590 you can use any binary executable or any script you wrote. Hook which
1591 has a suffix <tt>.sh</tt> (eg. <file>partition.DEFAULT.sh</file>) must
1592 be bourne shell scripts and will be sourced. So it's possible to
1593 redefine variables for the installation script.
1594 <p>
1595 This is the complete list of hooks and when they will be called.
1596
1597 <taglist>
1598 <tag>first</tag> <item><p>After some basic initialization, all
1599 hooks with prefix <tt>first</tt> are called. Since the configuration directory
1600 <file>/fai</file> is not yet mount on the install client, these
1601 hooks are located in <file>$nfsroot/fai/hooks</file> on the server. </p> </item>
1602
1603 <tag>setup</tag> <item><p>These hooks are immediately called
1604 after the configuration directory is mounted. </p> </item>
1605
1606 <tag>action</tag> <item><p>Hooks called before the variable
1607 <var>FAI_ACTION</var> is evaluated.</p> </item>
1608
1609 <tag>sysinfo</tag> <item><p>Called when no installation is
1610 performed but the action is <tt>sysinfo</tt>.</p>
1611 </item>
1612
1613 <tag>backup</tag> <item><p>Called when action is
1614 <tt>backup</tt>. Here you can define your own backup taks.</p> </item>
1615
1616 <tag>devclass</tag> <item><p>Called before defining classes.</p> </item>
1617
1618 <tag>defvar</tag> <item><p>Called before defining variables.</p> </item>
1619 <tag>partition</tag> <item><p>Called before partitioning the
1620 local hard disks.</p> </item>
1621
1622 <tag>mountdiks</tag> <item><p>Called before the local disks are
1623 mounted to <var>$FAI_ROOT</var>.</p> </item>
1624
1625 <tag>extrbase</tag> <item><p>Called before the base archive
1626 <file>base.tgz</file> in unpacked.</p> </item>
1627
1628 <tag>mirror</tag> <item><p>Called before the Debian mirror would
1629 be mounted.</p> </item>
1630
1631 <tag>updatebase</tag> <item><p>Called before the base system is upgraded.</p> </item>
1632
1633 <tag>instsoft</tag> <item><p>Called before the software packages
1634 are installed.</p> </item>
1635
1636 <tag>configure</tag> <item><p>Called before the local
1637 customisation of the new installed system is performed.</p> </item>
1638
1639 <tag>chboot</tag> <item><p>Called before the boot devices should
1640 be changed.</p> </item>
1641
1642 <tag>savelog</tag> <item><p>Called before are log files are save
1643 to local disk an to the install server.</p> </item>
1644
1645 <tag>faiend</tag> <item><p>Called when the installation has
1646 finished, before the automatic reboot is performed.</p> </item>
1647
1648 </taglist>
1649
1650 Some examples what hooks could be used for:
1651
1652 <list>
1653 <item> <p>Use <prgn>ssh</prgn> in the very beginning to verify that
1654 you mounted the configuration from the correct server.</p></item>
1655
1656 <item> <p>Pop up a little menu and ask the user, which kind of installation should be performed (eg. CAD
1657 workstation, scientific workstation, workgroup server, Gnome desktop...). Keep in
1658 mind that this won't lead to a fully automatic installation.
1659 </p></item>
1660
1661 <item> <p>Do not mount the configuration, instead get a compressed archive
1662 and extract it into a ram disk, then redefine <var>$FAI_LOCATION</var>.</p></item>
1663
1664 <item> <p>Load kernel modules before classes are defined
1665 in <file>/fai/class</file>. </p></item>
1666
1667 <item> <p>Send an email to the administrator, if the installation is finished.</p></item>
1668
1669 <item> <p></p></item>
1670 </list>
1671
1672 <sect id=errors>Looking for errors<p>
1673 If the installation process stops or even it finishes, parse all log files for errors using:
1674 <example>
1675 # egrep "no such variable|bad variable|E:|ERROR" *.log
1676 </example>
1677
1678 Sometimes the installation seems to stop, but there's only a
1679 postinstall script of a software package that requires manual input
1680 from the console. Change to another virtual terminal and look which
1681 process is running (<manref name="top" section="1">, <manref
1682 name="pstree" section="1">). You can add <tt>debug</tt> to <tt>FAI_FLAGS</tt>,
1683 so the installation process will show all output from the postinst
1684 scripts on the console. Don't hesitate to send an email to the
1685 mailing list or to <email>fai@informatik.uni-koeln.de</email> if you
1686 have any questions. Sample log files from successful
1687 installed computers are available on the FAI homepage.
1688
1689 <chapt id=sparc>FAI on SUN SPARC<p>
1690 Even FAI is architecture independent, there are some packages, that
1691 are only available for certain architectures (eg. silo, sparc-utils).
1692
1693 SUN can boot from their boot prompt and don't need a boot floppy. To boot a SUN you must use:
1694 <example>boot net</example>
1695
1696 Read the FAQ at <httpsite>http://www.ultralinux.org</httpsite> for
1697 more information. You have to convert the kernel image from ELF format
1698 to a.out format. Therefore use the program <prgn>elftoaout</prgn>
1699 (mentioned in the FAQ). The symlink to the kernel image to be booted
1700 is not the host name. Look at the FAQ for more information.
1701
1702
1703 <!--
1704 <chapt id=hints>Various Hints<p>
1705
1706 check for bad blocks:
1707
1708 $ROOTCMD dpkg -l
1709
1710 One of the most important feature of FAI are the classes. Using
1711 classes you can share configuration data among multiple
1712 clients. Details are described in <ref id="classes">.
1713 All defined classes are listed in <file>/tmp/FAI_CLASSES</file>.
1714
1715 The only task, which has to be done manually for new hardware, is to
1716 assign the MAC address to a hostname and to an IP address and to
1717 define classes for this host, or all host which match a certain name
1718 (look at <file>class/S01alias.sh</file>).
1719
1720
1721 Using cfengine, you can easily edit any existing text file or remove
1722 files, create links or directories. It has a rich set of editing
1723 commands (AppendIfNoSuchLine, ReplaceAll, LocateLineMatching,
1724 InsertLine, HashCommentLinesContaining,...) and support the use of
1725 classes.
1726
1727 <p>If you have to create a new file or append many line to an exiting
1728 one, it's better to use perl or a shell script. Cfengine is also
1729 sensitive to undefined variables. A cfengine script does not get
1730 executed, if any of the used variables is undefinded. Hence, it's not
1731 useful if you have a variable number of parameters in your
1732 configuration (a famous example are the DNS server for
1733 <file>/etc/resolv.conf</file>).
1734
1735
1736 There's a tradeoff between writing a few large script, which
1737 use definitions by cases or to write a single script for each
1738 class. It may also be useful to write two scripts, that together
1739 perform one task. Try to find the right way, and let us participate in
1740 your scripts.
1741
1742 general hints:
1743
1744 all in one config file, or multiple small config files. Ypou can
1745 choose !
1746
1747 FAI-BOOTPART
1748 -->
1749 </book>
1750 </debiandoc>
1751
1752
1753 <!-- Keep this comment at the end of the file
1754 Local variables:
1755 mode: sgml
1756 sgml-omittag:t
1757 sgml-shorttag:t
1758 sgml-minimize-attributes:nil
1759 sgml-always-quote-attributes:t
1760 sgml-indent-step:2
1761 sgml-indent-data:nil
1762 sgml-parent-document:nil
1763 sgml-exposed-tags:nil
1764 sgml-declaration:nil
1765 sgml-local-catalogs:nil
1766 sgml-local-ecat-files:nil
1767 End:
1768 -->

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.5