70 |
|
|
71 |
=cut |
=cut |
72 |
|
|
73 |
|
sub _glob_first { |
74 |
|
my ( $dir, $path ) = @_; |
75 |
|
my @glob = glob "$dir/$path"; |
76 |
|
my $first = $glob[0] || die "no $dir/$path"; |
77 |
|
$dir =~ s{iso/*$}{}; |
78 |
|
$first =~ s{^\Q$dir\E}{}g; |
79 |
|
return $first; |
80 |
|
} |
81 |
|
|
82 |
sub webconverger { |
sub webconverger { |
83 |
my ($ip) = @_; |
my ($ip) = @_; |
84 |
|
|
85 |
$mounted->{"webconverger/$ip"} ||= upstream::iso( 'http://download.webconverger.com/webc-5.5.iso' ); |
$mounted->{"webconverger/$ip"} ||= upstream::iso( 'http://download.webconverger.com/webc-6.2.iso' ); |
86 |
|
|
87 |
my $hostname = client::conf( $ip => 'hostname' ) || 'webconverger'; |
my $hostname = client::conf( $ip => 'hostname' ) || 'webconverger'; |
88 |
|
|
91 |
my $fetch = client::conf( $ip => 'webconverger/fetch' |
my $fetch = client::conf( $ip => 'webconverger/fetch' |
92 |
, default => "http://$server_ip:7777/webconverger/iso/live/filesystem.squashfs" ); |
, default => "http://$server_ip:7777/webconverger/iso/live/filesystem.squashfs" ); |
93 |
|
|
94 |
|
my $mnt = "$server::base_dir/tftp/webconverger/iso"; |
95 |
|
warn "# mnt: $mnt\n"; |
96 |
|
my $kernel = _glob_first $mnt => 'live/vmlinuz*'; |
97 |
|
my $initrd = _glob_first $mnt => 'live/initrd.img*'; |
98 |
|
|
99 |
pxelinux::config_for_ip( $ip, qq{ |
pxelinux::config_for_ip( $ip, qq{ |
100 |
|
|
101 |
default webconverger |
default webconverger |
102 |
label webconverger |
label webconverger |
103 |
kernel iso/live/vmlinuz-2.6.30-backports.1-486 |
kernel $kernel |
104 |
append initrd=iso/live/initrd.img-2.6.30-backports.1-486 fetch=$fetch boot=live quiet nosudo splash video=vesa:ywrap,mtrr vga=788 nopersistent username=webc hostname=$hostname union=aufs homepage=$homepage locale=hr noprompt kioskresetstation=10 |
append initrd=$initrd fetch=$fetch boot=live quiet nosudo splash video=vesa:ywrap,mtrr vga=788 nopersistent username=webc hostname=$hostname union=aufs homepage=$homepage locale=hr noprompt kioskresetstation=10 |
105 |
|
|
106 |
}); |
}); |
107 |
|
|