/[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 45 by dpavlin, Wed Jul 29 22:04:58 2009 UTC revision 68 by dpavlin, Thu Jul 30 22:43:48 2009 UTC
# Line 2  package pxe; Line 2  package pxe;
2    
3  use warnings;  use warnings;
4  use strict;  use strict;
5    use autodie;
6    
7  use File::Slurp;  use File::Slurp;
8    
9  use server;  use httpd;
10  use tftpd;  use tftpd;
11    
12  our $file = 'gpxelinux.0';  our $file = 'gpxelinux.0';
# Line 13  my $path = "$tftpd::dir/$file"; Line 14  my $path = "$tftpd::dir/$file";
14  symlink '/usr/lib/syslinux/gpxelinux.0', $path unless -l $path;  symlink '/usr/lib/syslinux/gpxelinux.0', $path unless -l $path;
15  warn "file $path ", -s $path;  warn "file $path ", -s $path;
16    
17  my $url = "http://$server::ip/pxelator/debian-live/";  my $url = $httpd::url;
18  my $squash = tftpd::path('debian-live/*squashfs');  #$url = "tftp://$server::ip/"; # fallback to tftp
19    #$url = "http://$server::ip/pxelator/";
20    
21    
22  my $config = "$ftpd::dir/pxelinux.cfg/default";  sub config_for_ip {
23    
24  write_file $config, qq{          my $ip = shift;
25            $ip = uc sprintf "%02x%02x%02x%02x", split /\./,$ip;
26    
27  default linux          my $config = "$tftpd::dir/pxelinux.cfg";
28  label linux          mkdir $config unless -d $config;
29          kernel $url/vmlinuz1          $config .= '/' . $ip;
         append initrd=$url/initrd1.img boot=live union=aufs noswap noprompt vga=normal fetch=$url/$squash  
30    
31  };          my $squash = $url . tftpd::path('debian-live/*squashfs');
32            write_file $config, qq{
33    
34  warn "config $config ", -s $config;          default linux
35            label linux
36                    kernel $url/debian-live/vmlinuz1
37                    append initrd=$url/debian-live/initrd1.img boot=live union=aufs noswap noprompt vga=normal fetch=$squash
38    
39            };
40    
41            warn "config $config ", -s $config;
42    
43    }
44    
45  warn "loaded";  warn "loaded";
46    

Legend:
Removed from v.45  
changed lines
  Added in v.68

  ViewVC Help
Powered by ViewVC 1.1.26