9 |
use client; |
use client; |
10 |
use file; |
use file; |
11 |
use ssh; |
use ssh; |
12 |
|
use upstream; |
13 |
|
|
14 |
use File::Slurp; |
use File::Slurp; |
15 |
|
|
23 |
sub debian_live { |
sub debian_live { |
24 |
my ($ip) = @_; |
my ($ip) = @_; |
25 |
|
|
26 |
upstream::files( qw{ |
my $from = 'http://cdimage.debian.org/cdimage/release/current-live/i386/web/'; |
27 |
http://cdimage.debian.org/cdimage/release/current-live/i386/web/ |
$from = 'http://cdimage.debian.org/cdimage/squeeze_live_alpha2/i386/web/'; |
28 |
vmlinuz1 |
my $variant = 'standard'; |
29 |
initrd1.img |
|
30 |
debian-live-501-i386-standard.squashfs |
my $dir = upstream::files $from => 'MD5SUMS'; |
31 |
}); |
|
32 |
|
my ( $vmlinuz, $initrd, $squashfs ); |
33 |
|
|
34 |
|
my @md5sum = read_file "$dir/MD5SUMS"; |
35 |
|
|
36 |
|
foreach ( @md5sum ) { |
37 |
|
$vmlinuz = $1 if m/\s+(\S*vmlinuz\S*)/; |
38 |
|
$initrd = $1 if m/\s+(\S*$variant\S*initrd\S*)/; |
39 |
|
$squashfs = $1 if m/\s+(\S*$variant\S*\.squashfs)$/; |
40 |
|
warn "# MD5SUM: $_\n"; |
41 |
|
} |
42 |
|
|
43 |
|
upstream::files $from => $vmlinuz, $initrd, $squashfs; |
44 |
|
|
45 |
my $hostname = client::conf( $ip => 'hostname' ) || 'debian-live'; |
my $hostname = client::conf( $ip => 'hostname' ) || 'debian-live'; |
46 |
|
|
47 |
|
# FIXME drop in shell because we can't create user |
48 |
|
|
49 |
pxelinux::config_for_ip( $ip, qq{ |
pxelinux::config_for_ip( $ip, qq{ |
50 |
|
|
51 |
default debian_live |
default debian_live |
52 |
label debian_live |
label debian_live |
53 |
kernel vmlinuz1 |
kernel $vmlinuz |
54 |
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 |
append initrd=$initrd fetch=http://$server_ip:7777/debian_live/$squashfs boot=live nopersistent hostname=$hostname union=aufs noprompt autologin username=user debug init=/bin/bash |
55 |
}); |
}); |
56 |
|
|
57 |
} |
} |
58 |
|
|
|
use upstream; |
|
|
|
|
59 |
=head1 webconverger |
=head1 webconverger |
60 |
|
|
61 |
Webconverger - the opensource Web Kiosk |
Webconverger - the opensource Web Kiosk |
345 |
$server = server::as_hash_for $ip; |
$server = server::as_hash_for $ip; |
346 |
$server_ip = $server->{ip} || die "no server ip"; |
$server_ip = $server->{ip} || die "no server ip"; |
347 |
my $config = client::conf( $ip => 'config' ) || return; |
my $config = client::conf( $ip => 'config' ) || return; |
348 |
eval $config . '($ip)'; # must be last |
my $ret = eval $config . '($ip)'; # must be last |
349 |
|
if ( $@ ) { |
350 |
|
warn "ERROR in executing $config($ip): $@\n"; |
351 |
|
$ret .= qq{<pre style="color:red">$@</pre>}; |
352 |
|
} |
353 |
|
return $ret; |
354 |
} |
} |
355 |
|
|
356 |
warn 'loaded'; |
warn 'loaded'; |