102 |
my $ip = shift; |
my $ip = shift; |
103 |
|
|
104 |
my $nfsroot = "$server::base_dir/tftp/nfsroot"; |
my $nfsroot = "$server::base_dir/tftp/nfsroot"; |
105 |
|
my $debian_mirror = server::conf_default( 'debian_mirror', 'http://ftp.debian.org/debian' ); |
106 |
|
|
107 |
if ( ! -e $nfsroot ) { |
if ( ! -e $nfsroot ) { |
108 |
system "apt-get install nfs-kernel-server debootstrap"; |
system "apt-get install nfs-kernel-server debootstrap"; |
109 |
|
|
110 |
if ( ! -e $nfsroot ) { |
if ( ! -e $nfsroot ) { |
111 |
mkdir $nfsroot; |
mkdir $nfsroot; |
112 |
system "debootstrap --arch i386 lenny $nfsroot http://ftp.hr.debian.org/debian"; |
system "debootstrap --arch i386 lenny $nfsroot http://ftp.hr.debian.org/debian"; |
126 |
|
|
127 |
}; |
}; |
128 |
|
|
129 |
system "chroot $nfsroot /tmp/configure.sh"; |
system "chroot $nfsroot sh -x /tmp/configure.sh"; |
130 |
|
|
131 |
open(my $exports, '>>', '/etc/exports'); |
open(my $exports, '>>', '/etc/exports'); |
132 |
print $exports "$nfsroot\t$server::ip/$server::netmask(rw,async,no_root_squash,no_subtree_check)\n"; |
print $exports "$nfsroot\t$server::ip/$server::netmask(rw,async,no_root_squash,no_subtree_check)\n"; |