-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.ipxe
More file actions
89 lines (75 loc) · 2.29 KB
/
menu.ipxe
File metadata and controls
89 lines (75 loc) · 2.29 KB
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
#!ipxe
:start
chain --autofree boot.cfg ||
iseq ${cls} serial && goto ignore_cls ||
set cls:hex 1b:5b:4a # ANSI clear screen sequence - "^[[J"
set cls ${cls:string}
:ignore_cls
isset ${arch} && goto skip_arch_detect ||
cpuid --ext 29 && set arch x86_64 || set arch i386
iseq ${buildarch} arm64 && set arch arm64 ||
:skip_arch_detect
isset ${menu} && goto ${menu} ||
isset ${ip} || dhcp || echo DHCP failed
:main_menu
clear menu
set space:hex 20:20
set space ${space:string}
iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
menu ${site_name}
item --gap Default:
item local ${space} Boot from local hdd
item --gap Alternative:
item nbxyz ${space} Chain load netboot.xyz
item --gap Distributions:
iseq ${arch} x86_64 && item archlinux ${space} Arch Linux ||
item windows ${space} Windows
item --gap Tools:
iseq ${arch} x86_64 && set bits 64 || set bits 32
item changebits ${space} Architecture: ${arch} (${bits}bit)
item shell ${space} iPXE shell
item uefishell ${space} UEFI shell
item netinfo ${space} Network card info
item --gap Signature Checks:
item sig_check ${space} netboot.lan [ enabled: ${sigs_enabled} ]
item img_sigs_check ${space} Images [ enabled: ${img_sigs_enabled} ]
isset ${menu} && set timeout 0 || set timeout 300000
choose --timeout ${timeout} --default ${menu} menu || goto local
echo ${cls}
goto ${menu} ||
iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
:verify_sigs
imgverify ${menu}.ipxe ${sigs}${menu}.ipxe.sig || goto error
goto change_menu
:change_menu
chain ${menu}.ipxe || goto error
goto main_menu
:error
echo Error occured, press any key to return to menu ...
prompt
goto main_menu
:local
echo Booting from local disks ...
exit 0
:nbxyz
echo Loading from http://boot.netboot.xyz/
chain --autofree http://boot.netboot.xyz/ || goto error
goto start
:uefishell
echo Loading from http://netboot.lan/shellx64_v2.efi
chain http://netboot.lan/shellx64_v2.efi || goto error
goto main_menu
:shell
echo Type "exit" to return to menu.
set menu main_menu
shell
goto main_menu
:changebits
iseq ${arch} x86_64 && set arch i386 || set arch x86_64
goto main_menu
:sig_check
iseq ${sigs_enabled} true && set sigs_enabled false || set sigs_enabled true
goto main_menu
:img_sigs_check
iseq ${img_sigs_enabled} true && set img_sigs_enabled false || set img_sigs_enabled true
goto main_menu