/
mcgi.config
123 lines (104 loc) · 4.24 KB
/
mcgi.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# configuration for menu.cgi
#
# Place this file as ".mcgi.config" in the same folder as menu.cgi
#
# edit as needed
$CONFIG->{LIB_URI} = "http://boot/m/syslinux/lib";
$CONFIG->{CGI_URI} = "http://boot/m.cgi";
1;
# For custom menu template, uncomment below and edit
__DATA__
######################################################################
# Standard Preamble
######################################################################
serial 0 115200
#serial 1 115200
prompt 1
######################################################################
# Menu Configuration
######################################################################
menu title DEMO: Dynamic menu over HTTP (<%= $CGI->param('q') %>)
menu margin 1
label self
menu label . - Reload
kernel <%= $LIB_URI %>/menu.c32
append <%= $CGI_URI %>?<%= $ENV{QUERY_STRING} %>
label prev
menu label .. - Go uplevel
kernel <%= $LIB_URI %>/menu.c32
append <%= $CGI_URI %>?q=<%= $UPLEVEL %>
label main
menu label main - Jump to main menu
kernel <%= $LIB_URI %>/menu.c32
menu separator
######################################################################
# Menu Items
######################################################################
<% foreach my $item (grep { $_->{type} eq ':message' } @$LIST) { %>
say <%= $item->{text} %>
<% } %>
<% foreach my $item (grep { $_->{type} eq ':asis' } @$LIST) { %>
<%= $item->{text} %>
<% } %>
<% foreach my $item (grep { $_->{type} eq ':menu' } @$LIST) { %>
label <%= $item->{name} %>
kernel <%= $LIB_URI %>/menu.c32
append <%= $item->{uri} %>
<% } %>
<% foreach my $item (grep { $_->{type} eq ':dir' } @$LIST) { %>
label <%= $item->{name} %>
menu label <%= $item->{name} %>/
kernel <%= $LIB_URI %>/menu.c32
append <%= $item->{uri} %>
<% } %>
<% foreach my $item (grep { $_->{type} eq ':pxe' } @$LIST) { %>
label <%= $item->{name} %>
<% if ($item->{uri} =~ m|\b(n/[^/]+)|) { %>
pxe <%= $item->{uri} %>;r=s,/pxeroot,/<%= $1 %>,g
<% } else { %>
pxe <%= $item->{uri} %>
<% } %>
<% } %>
<% foreach my $item (grep { $_->{type} eq ':linux' } @$LIST) { %>
<% $item->{opt} = $item->{hint}->{aufs} ?
"aufs=nfs:tcp:$ENV{HTTP_HOST}:/$item->{hint}->{aufs}/rw" : ""; %>
label <%= $item->{name} %>
kernel <%= $item->{uri} %>
initrd <%= $item->{initrd} %>
<% if ($item->{uri} =~ m|\b(n/[^/]+)|) { %>
append panic=30 console=tty0 console=ttyS0,115200 rw root=/dev/nfs ip=dhcp nfsroot=<%= $ENV{HTTP_HOST} %>:/<%= $1 %> <%= $item->{opt} %>
<% } else { %>
append panic=30 console=tty0 console=ttyS0,115200 ro root=/dev/ram
<% } %>
<% } %>
<% foreach my $item (grep { $_->{type} eq ':linux-dracut' } @$LIST) { %>
<% $item->{opt} = $item->{hint}->{aufs} ?
"aufs=nfs:tcp:$ENV{HTTP_HOST}:/$item->{hint}->{aufs}/rw" : ""; %>
label <%= $item->{name} %>
kernel <%= $item->{uri} %>
initrd <%= $item->{initrd} %>
<% if ($item->{uri} =~ m|\b(n/[^/]+)|) { %>
append console=tty0 console=ttyS0,115200 ip=dhcp root=nfs:<%= $ENV{HTTP_HOST} %>:/<%= $1 %>:rw,tcp,soft,intr,vers=3 <%= $item->{opt} %>
<% } else { %>
append console=tty0 console=ttyS0,115200 ro root=/dev/ram
<% } %>
<% } %>
<% foreach my $xen (grep { $_->{type} eq ':xen' } @$LIST) { %>
<% foreach my $item (grep { $_->{type} eq ':linux' } @$LIST) { %>
<% next unless $item->{uri} =~ m|\b(n/[^/]+)|; %>
<% $item->{opt} = $item->{hint}->{aufs} ?
"aufs=nfs:tcp:$ENV{HTTP_HOST}:/$item->{hint}->{aufs}/rw" : ""; %>
label xen-<%= $item->{name} %>
kernel <%= $LIB_URI %>/mboot.c32
append <%= $xen->{uri} %> dom0_mem=512M noreboot com1=115200,8n1 console=com1,vga --- <%= $item->{uri} %> root=/dev/nfs rw ip=dhcp nfsroot=<%= $ENV{HTTP_HOST} %>:/<%= $1 %> panic=30 xencons=xvc console=hvc0 <%= $item->{opt} %> --- <%= $item->{initrd} %><% } %>
<% } %>
<% foreach my $item (grep { $_->{type} eq 'img' } @$LIST) { %>
label <%= $item->{name} %>
kernel <%= $LIB_URI %>/memdisk
append initrd=<%= $item->{uri} %>
<% } %>
<% foreach my $item (grep { $_->{type} eq 'esx' } @$LIST) { %>
label <%= $item->{name} %>
kernel <%= $LIB_URI %>/mboot.c32
append <%= $item->{base_uri} %>/vmkboot.gz SERIALPORT=1 serialPort=1 tty1Port=1 debugLogToSerial=1 ipappend 2 --- <%= $item->{base_uri} %>/vmk.gz --- <%= $item->{base_uri} %>/sys.vgz --- <%= $item->{base_uri} %>/cim.vgz --- <%= $item->{base_uri} %>/mod.tgz --- <%= $item->{uri} %>
<% } %>