--- lib/PXElator/config.pm 2010/01/04 23:19:31 470 +++ lib/PXElator/config.pm 2010/07/10 12:57:38 503 @@ -17,7 +17,7 @@ our $server; our $server_ip; -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 ubuntu/ }; sub debian_live { my ($ip) = @_; @@ -68,7 +68,7 @@ default webconverger label webconverger kernel iso/live/vmlinuz-2.6.30-backports.1-486 - append initrd=iso/live/initrd.img-2.6.30-backports.1-486 fetch=$fetch boot=live quiet nosudo splash video=vesa:ywrap,mtrr vga=788 nopersistent username=webc hostname=$hostname union=aufs homepage=$homepage locale=hr noprompt + append initrd=iso/live/initrd.img-2.6.30-backports.1-486 fetch=$fetch boot=live quiet nosudo splash video=vesa:ywrap,mtrr vga=788 nopersistent username=webc hostname=$hostname union=aufs homepage=$homepage locale=hr noprompt kioskresetstation=10 }); @@ -127,6 +127,39 @@ }); } +sub clonezilla { + my $ip = shift; + upstream::iso( 'http://sourceforge.net/projects/clonezilla/files/clonezilla_live_alternative_testing/clonezilla-live-20100503-lucid.iso/download' ); + pxelinux::config_for_ip( $ip, qq{ + +default linux +label linux + kernel iso/live/vmlinuz + append initrd=iso/live/initrd.img boot=live union=aufs noswap noprompt vga=788 fetch=http://$server_ip:7777/clonezilla/iso/live/filesystem.squashfs + + }); +} + +sub ubuntu { + my $ip = shift; + upstream::iso( 'http://mirrors.us.kernel.org/ubuntu-releases/lucid/ubuntu-10.04-desktop-i386.iso' ); + + my $export = "$server::base_dir/tftp/ubuntu/iso"; + my $exported = `exportfs | grep $export`; + if ( $exported ne $export ) { + warn "exportfs $exported\n"; + system "sudo exportfs -i -o rw,async,no_root_squash,no_subtree_check,fsid=999 $ip:$export"; + } + pxelinux::config_for_ip( $ip, qq{ + +default linux +label linux + kernel iso/casper/vmlinuz + append initrd=iso/casper/initrd.lz boot=casper netboot=nfs nfsroot=$server_ip:$export -- + + }); +} + sub in_chroot { my ( $dir, $command ) = @_; write_file "$dir/tmp/inside.sh", $command; @@ -185,6 +218,11 @@ } + my $exported = `exportfs | grep $export`; + if ( $exported ne $export ) { + warn "exportfs $exported\n"; + system "sudo exportfs -i -o rw,async,no_root_squash,no_subtree_check,fsid=999 $ip:$export"; + } my $hostname = client::conf( $ip => 'hostname' ) || 'nfsroot'; file::replace "$export/etc/hostname", $hostname;