/[pxelator]/conf/debian-live/config.pl
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 /conf/debian-live/config.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 29 - (hide annotations)
Wed Jul 29 01:00:23 2009 UTC (14 years, 8 months ago) by dpavlin
File MIME type: text/plain
File size: 877 byte(s)
make URLs point to http and it works!

1 dpavlin 26
2     use warnings;
3    
4     $tftp_dir = 'tftp/debian-live';
5     $file = 'gpxelinux.0';
6     symlink '/usr/lib/syslinux/gpxelinux.0', "$tftp_dir/$file" unless -l "$tftp_dir/$file";
7    
8     sub path {
9     my $glob = shift;
10     my $path = glob("$tftp_dir/$glob");
11     die "can't find anything for $tftp_dir/$glob" unless $path;
12     warn $path;
13     $path =~ s{^$tftp_dir}{};
14     return "/$path";
15     }
16    
17     my $pxelinux = "$tftp_dir/pxelinux.cfg";
18    
19     if ( $server_ip ) { # FIXME refresh only from dhcpd
20     mkdir $pxelinux;
21     $pxelinux .= '/default';
22    
23     my $url = "http://$server_ip/pxelator/debian-live/";
24 dpavlin 29 # $url = '';
25 dpavlin 26
26     my $squash = path '*squashfs';
27    
28     use File::Slurp qw/write_file/;
29     write_file $pxelinux, qq{
30     default linux
31     label linux
32     kernel $url/vmlinuz1
33     append initrd=$url/initrd1.img boot=live union=aufs noswap noprompt vga=normal fetch=$url/$squash
34     };
35    
36     warn "created $pxelinux $squash\n";
37     } else {
38     warn "using $pxelinux";
39     }
40    
41     1;

  ViewVC Help
Powered by ViewVC 1.1.26