reorganized Config file
[hdw-linux/hdw-linux.git] / doc / FAI
1 # hdw - linux FAI file
2
3 whats this?
4 -----------
5 explains how to setup a networked computer acting as dhcp/pxeboot/nfsroot fully
6 automated installation server to automate installing your favorite hdw-linux
7 distribution.
8
9 files:
10 ------
11
12 ./scripts/Create-FAI
13 ./fai/*
14 ./doc/FAI
15
16 procedure
17 ---------
18
19         1) install minimal nfsroot binaries
20
21                 vi Config [specify arch* variables]
22
23         note: you dont need to specify fai-server as a target. we are just
24               going to install the nfsroot which will automate the install
25               process. the packages of the fai-server target have to be running
26               on the computer on which you are right now following these
27               instructions.
28
29         note: you might want to fetch hdw binaries from a mirror.
30               edit your /etc/hdw-get.conf file.
31
32                 ./scripts/Create-FAI <nfsroot>
33
34                 where <nfsroot> is the directory to install the fairoot.
35
36         2) adapt the hdw-get.conf file in the fai nfsroot tree
37
38         note: again you might want to use a mirror. edit hdw-get.conf, but make
39               sure it is the one from fairoot.
40
41         3) edit the following files to match your needs, and restart services
42
43                 /etc/dhcpd.conf
44                 /etc/inetd.conf
45                 /etc/exports
46                 /tftpboot/pxelinux.cfg/{default,*}
47
48                 (have a look at chapter "fai server configuration")
49
50         4) adapt configs in ./fai (see chapter "fai config files")
51
52         5) pxeboot your install candidates. this is actually not fully
53            automated. have a look athe bootdisk section if your client does
54            not support pxeboot.
55
56                 - type "fai" on pxeboot prompt
57                 - after first bootup, use cfdisk to partition your harddisk
58                 - touch a disk_ready file in configuration space
59                   (after using cfdisk, sync to disk file!)
60                 - reboot and finaly wathc your target system to get hdw'ed :)
61
62         6) optional: login, build a new kernel or do other modifications.
63
64
65 fai config files
66 ----------------
67
68         config files reside in 1) ./fai/config/<client_ip>/ and 2) ./fai/files/
69         directories.
70
71         config dir:
72
73                 - the files reside in a subdirectory, which is simply the
74                   clients ip address, as different clients may need different
75                   config.
76                 - files:
77                         1) disk
78                         2) packages
79
80                         disk file is used to determine the partition layout and
81                         used harddisk. the format: (example, its intuitive!)
82
83                         # disk /dev/hda
84                         # swap 7
85                         1       /boot   ext3    format
86                         5       /       ext3    format
87                         6       /home   ext3    preserve
88
89                         packages file contains packages to get installed. you
90                         may use ./scripts/Helper -create_dist_files to create
91                         one. make sure that all the packages are available on
92                         the mirror, otherwise the fai install routine will
93                         break. hint: switch the partitions to "preserve" and
94                         hdw-get will not install already installed packages
95                         again.
96                         
97          files dir:
98
99                 - files called DEFAULT in a special directory will be copied to
100                   every client to the file of its dirname.
101                 - files named like a clients ip address will be only copied to
102                   that client (again, the file will be the dirname)
103
104                 example:
105
106                 ./fai/files/etc/X11/XF86Config/DEFAULT will be copied to all
107                 clients as /etc/X11/XF86Config file.
108
109
110 fai server configuration
111 ------------------------
112
113 there are several files you need to hack. here we go:
114
115         - dhcpd:
116
117                 file: /etc/dhcpd.conf
118
119                 examples rule, have a look at the configuration for my fai
120                 client:
121
122                 ...
123                 option routers 192.168.10.10;
124                 option domain-name-servers 192.168.10.50, 194.25.134.203;
125                 host compaq {
126                         fixed-address 192.168.10.80;
127                         hardware ethernet 00:50:8b:cb:8e:d2;
128                         allow booting;
129                         allow bootp;
130                         next-server hackstation; # the fai server
131                         server-name hackstation;
132                         filename "pxelinux.0";
133                 }
134                 ...
135
136         - tftpboot (you will need tftp-hpa as tftpserver)
137
138                 the scripts prepared a working fai config file at
139                 /tftpboot/pxelinux.cfg, just add a symbolic link of your clients
140                 ip address (in hex, use: gethostip) pointing to fai.
141                 ofcourse you need to have the package syslinux installed.
142
143         - nfsd:
144
145                 file: /etc/exports
146
147                 the scripts added export entries. just substitute "foobar" to
148                 the name or ip address of your fai clients.
149
150         - inetd
151
152                 file: /etc/inetd.conf
153
154                 make sure the tftpboot line is uncommented. if you have problems
155                 of tftpd switching to user nobody google for solutions. if you
156                 are too lazy substitute "nobody" by "root in inetd.conf. this
157                 is dangerous though, you have been warned.
158
159 note: restart all the mentioned services.
160
161 bootdisk
162 --------
163
164 for computers old enough to not support pxe but having installed a piece
165 of hardware called floppy disk, you may create a bootdisk containing the
166 install kernel (the pxe stuff is replaced by the bootdisk).
167
168 - compile a customized kernel <= 1.3 mb. do not unset needed features!
169
170         (use ./misc/arch/${hdw_arch}/linux.config as .config + modify)
171
172 - copy bzImage to fai/files/boot/vmlinuz_custom/<ip>
173
174 - create bootfloppy image
175
176         dd if=/dev/zero of=bootdisk.img bs=1024 count=1440
177         yes | mke2fs -q -i 40000 -m 0 bootdisk.img
178         mkdir -p /mnt/tmp ; mount -o loop bootdisk.img /mnt/tmp
179         mkdir -p /mnt/tmp/{boot,etc} ; cp bzImage /mnt/tmp/boot/vmlinuz
180         cp misc/fai/lilo.conf /mnt/tmp/etc/lilo.conf
181         (change boot, disk map and image values)
182         touch /mnt/tmp/boot/map # enough? if not take yours from /boot
183         lilo -C /mnt/tmp/etc/lilo.conf
184         umount /mnt/tmp
185         (you may store bootdisk.img in the clients config space)
186
187         finaly: (create the boot floppy)
188
189         dd if=bootdisk.img of=/dev/floppy/0
190
191 troubleshooting
192 ---------------
193
194 contact me! -> http://www.hackdaworld.dyndns.org/contents/contact/
195 email: hackbard@hackdaworld.dyndns.org
196 irc: irc.hackdaworld.dyndns.org - #hackdaworld
197
198 greets
199 ------
200
201 good luck now, you are own your own! enjoy hdw. :)
202
203 regards, hackbard.