/[pxelator]/lib/PXElator/pxe.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/pxe.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 63 by dpavlin, Thu Jul 30 16:16:18 2009 UTC revision 102 by dpavlin, Fri Jul 31 22:36:06 2009 UTC
# Line 15  symlink '/usr/lib/syslinux/gpxelinux.0', Line 15  symlink '/usr/lib/syslinux/gpxelinux.0',
15  warn "file $path ", -s $path;  warn "file $path ", -s $path;
16    
17  my $url = $httpd::url;  my $url = $httpd::url;
18  $url = "tftp://$server::ip/"; # fallback to tftp  #$url = "tftp://$server::ip/"; # fallback to tftp
19  $url = "http://$server::ip/pxelator/";  #$url = "http://$server::ip/pxelator/";
20    
21  my $squash = tftpd::path('debian-live/*squashfs');  use LWP::Simple qw/mirror RC_NOT_MODIFIED/;
22    foreach my $file ( 'vmlinuz1', 'initrd1.img', 'debian-live-501-i386-rescue.squashfs' ) {
23            my $path = "$tftpd::dir/debian-live";
24            mkdir $path unless -e $path;
25    #       next if -e "$path/$file";
26            print STDERR "mirror $file ";
27            mirror( "http://cdimage.debian.org/cdimage/release/current-live/i386/web/$file", "$path/$file")
28                    == RC_NOT_MODIFIED
29                    && warn("not modified\n")
30                    || warn("mirrored ", -s "$path/$file", "\n")
31                    ;
32    }
33    
34  sub config_for_ip {  sub config_for_ip {
35    
# Line 29  sub config_for_ip { Line 40  sub config_for_ip {
40          mkdir $config unless -d $config;          mkdir $config unless -d $config;
41          $config .= '/' . $ip;          $config .= '/' . $ip;
42    
43            my $squash = $url . tftpd::path('debian-live/*squashfs');
44          write_file $config, qq{          write_file $config, qq{
45    
46          default linux          default linux
47          label linux          label linux
48                  kernel $url/debian-live/vmlinuz1                  kernel $url/debian-live/vmlinuz1
49                  append initrd=$url/debian-live/initrd1.img boot=live union=aufs noswap noprompt vga=normal fetch=$url/$squash                  append initrd=$url/debian-live/initrd1.img boot=live union=aufs noswap noprompt vga=normal fetch=$squash
50    
51          };          };
52    
53          warn "config $config ", -s $config;          warn "config $config ", -s $config if $server::debug;
54    
55  }  }
56    

Legend:
Removed from v.63  
changed lines
  Added in v.102

  ViewVC Help
Powered by ViewVC 1.1.26