147 |
|
|
148 |
system "sudo debootstrap --arch i386 lenny $debootstrap $debian_mirror"; |
system "sudo debootstrap --arch i386 lenny $debootstrap $debian_mirror"; |
149 |
|
|
150 |
file::append "$debootstrap/etc/kernel-img.conf", "do_initrd = Yes\n" && |
file::append "$debootstrap/etc/apt/sources.list.d/non-free.list", "deb $debian_mirror lenny non-free\n"; |
151 |
in_chroot $debootstrap => 'apt-get install -y --force-yes atl2-modules-2.6-686'; |
in_chroot $debootstrap => 'apt-get update'; |
152 |
|
|
153 |
|
file::append "$debootstrap/etc/kernel-img.conf", "do_initrd = Yes\n"; |
154 |
|
in_chroot $debootstrap => 'apt-get install -y --force-yes atl2-modules-2.6-686 firmware-bnx2'; |
155 |
in_chroot $debootstrap => 'apt-get -f install -y --force-yes locales'; # linux-image-2.6-686 |
in_chroot $debootstrap => 'apt-get -f install -y --force-yes locales'; # linux-image-2.6-686 |
156 |
|
|
157 |
file::append "$debootstrap/etc/initramfs-tools/modules", "atl2\n"; |
file::append "$debootstrap/etc/initramfs-tools/modules", "atl2\n"; |
177 |
|
|
178 |
} |
} |
179 |
|
|
180 |
|
my $server = server::as_hash_for $ip; |
181 |
|
|
182 |
my $hostname = client::conf( $ip => 'hostname' ) || 'nfsroot'; |
my $hostname = client::conf( $ip => 'hostname' ) || 'nfsroot'; |
183 |
file::replace "$export/etc/hostname", $hostname; |
file::replace "$export/etc/hostname", $hostname; |
184 |
file::replace "$export/etc/hosts", "127.0.0.1\tlocalhost $hostname\n"; |
file::replace "$export/etc/hosts", "127.0.0.1\tlocalhost $hostname\n"; |
185 |
file::replace "$export/etc/resolv.conf", "domain $server::domain_name\nnameserver $server::ip\n"; |
file::replace "$export/etc/resolv.conf", "domain $server->{domain}\nnameserver $server->{ip}\n"; |
186 |
file::replace "$export/etc/rsyslog.d/pxelator.conf", "*.*\t\@$server::ip\n"; |
file::replace "$export/etc/rsyslog.d/pxelator.conf", "*.*\t\@$server->{ip}\n"; |
187 |
|
|
188 |
file::append "$debootstrap/etc/network/interfaces", qq{ |
file::append "$debootstrap/etc/network/interfaces", qq{ |
189 |
|
|
205 |
default nfsroot |
default nfsroot |
206 |
label nfsroot |
label nfsroot |
207 |
kernel debootstrap/vmlinuz |
kernel debootstrap/vmlinuz |
208 |
append initrd=debootstrap/initrd.img root=/dev/nfs nfsroot=$server::ip:$export ro ip=dhcp |
append initrd=debootstrap/initrd.img root=/dev/nfs nfsroot=$server->{ip}:$export ro ip=dhcp |
209 |
|
|
210 |
}); |
}); |
211 |
} |
} |