--- lib/PXElator/pxe.pm 2009/07/30 15:23:29 60 +++ lib/PXElator/pxe.pm 2009/07/30 22:43:48 68 @@ -15,25 +15,32 @@ warn "file $path ", -s $path; my $url = $httpd::url; -$url = "tftp://$server::ip/"; # fallback to tftp -$url = "http://$server::ip/pxelator/"; +#$url = "tftp://$server::ip/"; # fallback to tftp +#$url = "http://$server::ip/pxelator/"; -my $squash = tftpd::path('debian-live/*squashfs'); -my $config = "$tftpd::dir/pxelinux.cfg"; -mkdir $config unless -d $config; -$config .= '/default'; +sub config_for_ip { -write_file $config, qq{ + my $ip = shift; + $ip = uc sprintf "%02x%02x%02x%02x", split /\./,$ip; -default linux -label linux - kernel $url/debian-live/vmlinuz1 - append initrd=$url/debian-live/initrd1.img boot=live union=aufs noswap noprompt vga=normal fetch=$url/$squash + my $config = "$tftpd::dir/pxelinux.cfg"; + mkdir $config unless -d $config; + $config .= '/' . $ip; -}; + my $squash = $url . tftpd::path('debian-live/*squashfs'); + write_file $config, qq{ -warn "config $config ", -s $config; + default linux + label linux + kernel $url/debian-live/vmlinuz1 + append initrd=$url/debian-live/initrd1.img boot=live union=aufs noswap noprompt vga=normal fetch=$squash + + }; + + warn "config $config ", -s $config; + +} warn "loaded";