aboutsummaryrefslogtreecommitdiffstats
path: root/boot.ipxe
blob: 217d7b23bdb662af0af9d0a5e388d103f50de5b9 (plain)
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
#!ipxe

set os Alpine Linux
iseq ${ipxe_cloud_config} packet && set provider (Packet.net) ||
iseq ${alpine_loader} true && set img_verify true || set img_verify false
set console tty0 ||
set cmdline_extra none ||
set release latest-stable ||
iseq ${buildarch} arm64 && goto arm64 ||
cpuid --ext 29 && goto x86_64 || goto x86

:arm64
set arch aarch64 ||
set acpi acpi=force ||
set console ttyAMA0 ||
iseq ${ipxe_cloud_config} packet && set console ttyAMA0,115200 ||
goto menu

:x86_64
set arch x86_64 ||
iseq ${ipxe_cloud_config} packet && set console ttyS1,115200n8 ||
goto menu

:x86
set arch x86 ||
goto menu

:menu
set space:hex 20:20
set space ${space:string}
menu ${os} ${provider} [ ${arch} ]
item --gap Boot options
item release ${space} Choose release [ ${release} ]
item console ${space} Set console [ ${console} ]
iseq ${alpine_loader} true && item img_verify ${space} Image verification [ ${img_verify} ] ||
item cmdline_extra ${space} Additional cmdline [ ${cmdline_extra} ]
item boot ${space} Boot with above settings
item --gap Utilities
item shell ${space} iPXE Shell
item reboot ${space} Reboot system
choose item
goto ${item}

:release
menu ${os} [ ${arch} ]
item latest-stable Latest stable
item edge Edge (development)
choose release || goto alpine_exit
goto menu

:console
menu ${os} [ ${arch} ]
item tty0 Console on tty0
item ttyS0 Console on ttyS0
item ttyS1 Console on ttyS1
item ttyAMA0 Console on ttyAMA0 (aarch64)
item custom Enter custom console
choose console || goto menu
iseq ${console} custom && goto custom_console ||
goto menu

:custom_console
clear console
echo -n Enter console: && read console
goto menu

:shell
echo Type "exit" to return to menu.
shell
goto menu

:img_verify
iseq ${img_verify} true && set img_verify false || set img_verify true
goto menu

:cmdline_extra
clear cmdline_extra
echo -n Enter extra cmdline options: && read cmdline_extra
goto menu

:boot
iseq ${cmdline_extra} none && clear cmdline_extra ||
isset ${console} && set console console=${console} ||
set img-url https://boot.alpinelinux.org/images/${release}/${arch}
set repo-url http://dl-cdn.alpinelinux.org/alpine/${release}/main
imgfree
kernel ${img-url}/vmlinuz-vanilla initrd=initramfs-vanilla pkgs=libressl alpine_repo=${repo-url} modules=loop,squashfs modloop=${img-url}/modloop-vanilla nomodeset ${console} ${acpi} ${cmdline_extra}
initrd ${img-url}/initramfs-vanilla
iseq ${img_verify} true && goto verify_img || goto no_img_verify
:verify_img
imgverify vmlinuz-vanilla ${img-url}/vmlinuz-vanilla.sig
imgverify initramfs-vanilla ${img-url}/initramfs-vanilla.sig
:no_img_verify
boot
goto alpine_exit

:reboot
reboot

:poweroff
poweroff

:alpine_exit
clear menu
exit 0