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