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