better liveCD support
[os-autoinst:os-autoinst.git] / inst / bootloader.pm
1 #!/usr/bin/perl -w
2 use strict;
3 use bmwqemu;
4 use Time::HiRes qw(sleep);
5
6 # assume bios+grub+anim already waited in start.sh
7 # 1024x768
8 if(1||$ENV{LIVECD}) {
9         # installation (instead of HDDboot on non-live)
10         # installation (instead of live):
11         sendkey "down";
12 }
13 if($ENV{RES1024}) { # default is 800x600
14         sendkey "f3";
15         sendkey "down";
16         sendkey "ret";
17 }
18 # German/Deutsch
19 if($ENV{INSTLANG} eq "de") {
20         sendkey "f2";
21         for(1..3) {
22                 sendkey "up";
23         }
24         sendkey "ret";
25 }
26
27 # set HTTP-source to not use factory-snapshot
28 if($ENV{NETBOOT}) {
29         sendkey "f4";
30         sendkey "ret";
31         #download.opensuse.org
32         if($ENV{GWDG}) {
33                 for(1..22) { sendkey "backspace" }
34                 sendautotype("ftp5.gwdg.de");
35         }
36         sendkey "tab";
37         # change dir
38         # leave /repo/oss/ (10 chars)
39         for(1..10) { sendkey "left"; }
40         for(1..22) { sendkey "backspace"; }
41
42         if($ENV{GWDG}) {
43                 sendautotype("/pub/opensuse/factory");
44         } else {
45                 sendautotype("/factory");
46         }
47
48         sleep(1.5);
49         sendkey "ret";
50 }
51
52 # HTTP-proxy
53 if($ENV{NETBOOT} && $ENV{HTTPPROXY} && $ENV{HTTPPROXY}=~m/([0-9.]+):(\d+)/) {
54         my($proxyhost,$proxyport)=($1,$2);
55         sendkey "f4";
56         for(1..4) {
57                 sendkey "down";
58         }
59         sendkey "ret";
60         sendautotype("$proxyhost\t$proxyport\n");
61         sleep(1.5);
62 }
63
64 # boot
65 sendkey "ret";
66
67 1;