upgrade webconverger 5.5 -> 6.2
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 9 Oct 2010 12:14:28 +0000 (12:14 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 9 Oct 2010 12:14:28 +0000 (12:14 +0000)
lib/PXElator/config.pm

index ce56653..010e19e 100644 (file)
@@ -70,10 +70,19 @@ L<http://webconverger.org/>
 
 =cut
 
+sub _glob_first {
+       my ( $dir, $path ) = @_;
+       my @glob = glob "$dir/$path";
+       my $first = $glob[0] || die "no $dir/$path";
+       $dir   =~ s{iso/*$}{};
+       $first =~ s{^\Q$dir\E}{}g;
+       return $first;
+}
+
 sub webconverger {
        my ($ip) = @_;
 
-       $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' );
 
        my $hostname = client::conf( $ip => 'hostname' ) || 'webconverger';
 
@@ -82,12 +91,17 @@ sub webconverger {
        my $fetch    = client::conf( $ip => 'webconverger/fetch'
                , default => "http://$server_ip:7777/webconverger/iso/live/filesystem.squashfs" );
 
+       my $mnt = "$server::base_dir/tftp/webconverger/iso";
+       warn "# mnt: $mnt\n";
+       my $kernel = _glob_first $mnt => 'live/vmlinuz*';
+       my $initrd = _glob_first $mnt => 'live/initrd.img*';
+
        pxelinux::config_for_ip( $ip, qq{
 
 default webconverger
 label webconverger
-       kernel iso/live/vmlinuz-2.6.30-backports.1-486
-       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
+       kernel $kernel
+       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
 
        });