/[pxelator]/lib/PXElator/pxelinux.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/pxelinux.pm

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

revision 462 by dpavlin, Wed Aug 5 23:22:17 2009 UTC revision 463 by dpavlin, Sun Jan 3 01:19:50 2010 UTC
# Line 19  sub config_for_ip { Line 19  sub config_for_ip {
19          confess "$ip not IP" unless $ip =~ m{^\d+\.\d+\.\d+\.\d+$};          confess "$ip not IP" unless $ip =~ m{^\d+\.\d+\.\d+\.\d+$};
20    
21          $path_prefix = (caller(1))[3];          $path_prefix = (caller(1))[3];
22          $path_prefix =~ s{config::}{} || die "caller isn't package config !";          $path_prefix = (caller(2))[3] unless $path_prefix =~ m{config::};
23            $path_prefix =~ s{config::}{} || warn "# caller isn't package config !";
24          $path_prefix .= '/';          $path_prefix .= '/';
25    
26          warn "# $ip $path_prefix";          warn "# $ip $path_prefix";
# Line 44  sub config_for_ip { Line 45  sub config_for_ip {
45          return $config;          return $config;
46  }  }
47    
48    sub config_ip_boot {
49            my ( $ip, $boot, $append ) = @_;
50    
51            my $default;
52            my $config;
53    
54            foreach my $kernel ( glob "$boot/vmlinuz*" ) {
55                    my $ver = $1 if $kernel =~ m{vmlinuz(.+)};
56                    $default ||= $ver;
57    
58                    $config .= qq{
59    
60    label boot$ver
61            kernel $ip/boot/vmlinuz$ver
62            append initrd=$ip/boot/initrd.img$ver $append
63    
64                    };
65            }
66    
67            config_for_ip( $ip, qq{
68    
69    default boot$default
70    prompt 5
71    
72    $config
73    
74            });
75    
76    }
77    
78  1;  1;

Legend:
Removed from v.462  
changed lines
  Added in v.463

  ViewVC Help
Powered by ViewVC 1.1.26