17 |
our $server; |
our $server; |
18 |
our $server_ip; |
our $server_ip; |
19 |
|
|
20 |
sub available { qw/katalog debian_live webconverger debirf tinycore nfsroot openvz printer wrt/ }; |
sub available { qw/katalog debian_live webconverger debirf tinycore nfsroot openvz printer wrt clonezilla/ }; |
21 |
|
|
22 |
sub debian_live { |
sub debian_live { |
23 |
my ($ip) = @_; |
my ($ip) = @_; |
127 |
}); |
}); |
128 |
} |
} |
129 |
|
|
130 |
|
sub clonezilla { |
131 |
|
my $ip = shift; |
132 |
|
upstream::iso( 'http://sourceforge.net/projects/clonezilla/files/clonezilla_live_alternative_testing/clonezilla-live-20100503-lucid.iso/download' ); |
133 |
|
pxelinux::config_for_ip( $ip, qq{ |
134 |
|
|
135 |
|
default linux |
136 |
|
label linux |
137 |
|
kernel iso/live/vmlinuz |
138 |
|
append initrd=iso/live/initrd.img boot=live union=aufs noswap noprompt vga=788 fetch=http://$server_ip:7777/clonezilla/iso/live/filesystem.squashfs |
139 |
|
|
140 |
|
}); |
141 |
|
} |
142 |
sub in_chroot { |
sub in_chroot { |
143 |
my ( $dir, $command ) = @_; |
my ( $dir, $command ) = @_; |
144 |
write_file "$dir/tmp/inside.sh", $command; |
write_file "$dir/tmp/inside.sh", $command; |
197 |
|
|
198 |
} |
} |
199 |
|
|
200 |
|
my $exported = `exportfs | grep $export`; |
201 |
|
if ( $exported ne $export ) { |
202 |
|
warn "exportfs $exported\n"; |
203 |
|
system "sudo exportfs -i -o rw,async,no_root_squash,no_subtree_check,fsid=999 $ip:$export"; |
204 |
|
} |
205 |
|
|
206 |
my $hostname = client::conf( $ip => 'hostname' ) || 'nfsroot'; |
my $hostname = client::conf( $ip => 'hostname' ) || 'nfsroot'; |
207 |
file::replace "$export/etc/hostname", $hostname; |
file::replace "$export/etc/hostname", $hostname; |