--- lib/PXElator/config.pm 2009/08/27 17:43:05 310 +++ lib/PXElator/config.pm 2010/01/02 17:20:40 457 @@ -8,12 +8,13 @@ use pxelinux; use client; use file; +use ssh; use File::Slurp; our $mounted; -sub available { qw/debian_live webconverger debirf tinycore nfsroot openvz_host openvz_ve printer/ }; +sub available { qw/katalog debian_live webconverger debirf tinycore nfsroot openvz printer wrt/ }; sub debian_live { my ($ip) = @_; @@ -32,7 +33,7 @@ default debian_live label debian_live kernel vmlinuz1 - append initrd=initrd1.img fetch=http://${server::ip}:7777/debian_live/debian-live-501-i386-standard.squashfs boot=live nopersistent hostname=$hostname union=aufs + append initrd=initrd1.img fetch=http://${server::ip}:7777/debian_live/debian-live-501-i386-standard.squashfs boot=live nopersistent hostname=$hostname union=aufs noprompt }); } @@ -50,22 +51,43 @@ sub webconverger { my ($ip) = @_; - $mounted->{"webconverger/$ip"} ||= upstream::iso( 'http://download.webconverger.com/webc-5.2.iso' ); + $mounted->{"webconverger/$ip"} ||= upstream::iso( 'http://download.webconverger.com/webc-5.5.iso' ); - my $homepage = client::conf( $ip => 'homepage', default => "http://${server::ip}:7777/client" ); my $hostname = client::conf( $ip => 'hostname' ) || 'webconverger'; + my $homepage = client::conf( $ip => 'webconverger/homepage' + , default => "http://${server::ip}:7777/client" ); + my $fetch = client::conf( $ip => 'webconverger/fetch' + , default => "http://${server::ip}:7777/webconverger/iso/live/filesystem.squashfs" ); + 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=http://${server::ip}:7777/webconverger/iso/live/filesystem.squashfs boot=live quiet nosudo splash video=vesa:ywrap,mtrr vga=788 nopersistent username=webc hostname=$hostname union=aufs homepage=$homepage locale=hr + 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 }); } +sub katalog { + my ($ip) = @_; + $mounted->{"webconverger/$ip"} ||= upstream::iso( 'http://download.webconverger.com/webc-5.5.iso' ); + my $hostname = client::conf( $ip => 'hostname' ) || 'katalog'; + my $homepage = client::conf( $ip => 'webconverger/homepage' => "http://koha.ffzg.hr" ); + my $fetch = client::conf( $ip => 'webconverger/fetch' => "http://${server::ip}:7777/webconverger/custom.squashfs" ); + + pxelinux::config_for_ip( $ip, qq{ + +default katalog +label katalog + 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 + + }); + +} =head1 debirf debirf is a system that will create diskless, all-in-ram images (kernel and initramfs) that boot entirely into ram and leave the user in a fully functional Debian system. @@ -125,8 +147,11 @@ system "sudo debootstrap --arch i386 lenny $debootstrap $debian_mirror"; - file::append "$debootstrap/etc/kernel-img.conf", "do_initrd = Yes\n" && - in_chroot $debootstrap => 'apt-get install -y --force-yes atl2-modules-2.6-686'; + file::append "$debootstrap/etc/apt/sources.list.d/non-free.list", "deb $debian_mirror lenny non-free\n"; + in_chroot $debootstrap => 'apt-get update'; + + file::append "$debootstrap/etc/kernel-img.conf", "do_initrd = Yes\n"; + in_chroot $debootstrap => 'apt-get install -y --force-yes atl2-modules-2.6-686 firmware-bnx2'; in_chroot $debootstrap => 'apt-get -f install -y --force-yes locales'; # linux-image-2.6-686 file::append "$debootstrap/etc/initramfs-tools/modules", "atl2\n"; @@ -183,14 +208,17 @@ }); } -sub openvz_host {} -sub openvz_ve {} +sub openvz { + my $ip = shift; + ssh::shell( $ip, 'cat /proc/vz/veinfo', 'vzlist -a', 'uptime', 'free', 'df', 'zfs list' ); +} sub printer {} +sub wrt {} sub for_ip { my $ip = shift || return; - my $deploy = client::conf( $ip => 'deploy' ) || return; - eval $deploy . '($ip)'; + my $config = client::conf( $ip => 'config' ) || return; + eval $config . '($ip)'; # $tftp::dir = "$server::base_dir/tftp/$pxelinux::path_prefix"; }