/[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

Annotation of /lib/PXElator/pxe.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 52 - (hide annotations)
Thu Jul 30 11:47:16 2009 UTC (11 years, 9 months ago) by dpavlin
File size: 772 byte(s)
create pxelinux.cfg if it doesn't exist

1 dpavlin 45 package pxe;
2    
3     use warnings;
4     use strict;
5 dpavlin 46 use autodie;
6 dpavlin 45
7     use File::Slurp;
8    
9     use server;
10     use tftpd;
11    
12     our $file = 'gpxelinux.0';
13     my $path = "$tftpd::dir/$file";
14     symlink '/usr/lib/syslinux/gpxelinux.0', $path unless -l $path;
15     warn "file $path ", -s $path;
16    
17 dpavlin 46 my $url = "http://$server::ip/pxelator/";
18     $url = "tftp://$server::ip/"; # fallback to tftp
19    
20 dpavlin 45 my $squash = tftpd::path('debian-live/*squashfs');
21    
22 dpavlin 52 my $config = "$tftpd::dir/pxelinux.cfg";
23     mkdir $config unless -d $config;
24     $config .= '/default';
25 dpavlin 45
26     write_file $config, qq{
27    
28     default linux
29     label linux
30 dpavlin 46 kernel $url/debian-live/vmlinuz1
31     append initrd=$url/debian-live/initrd1.img boot=live union=aufs noswap noprompt vga=normal fetch=http://$server::ip/pxelator/$squash
32 dpavlin 45
33     };
34    
35     warn "config $config ", -s $config;
36    
37     warn "loaded";
38    
39     1;

  ViewVC Help
Powered by ViewVC 1.1.26