forked from netbootxyz/netboot.xyz-custom
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcustom.ipxe
86 lines (74 loc) · 3 KB
/
custom.ipxe
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
#!ipxe
# Kairos - Kubernetes-focused, Cloud Native Linux meta-distribution
# https://kairos.io/
# For further info on:
# iPXE and Kairos: https://kairos.io/docs/installation/netboot/
# Kairos Config: https://kairos.io/docs/reference/configuration/
# 64-bit only
isset ${dhcp-server} && set ipparam ip=dhcp || set ipparam ip=${ip}::${gateway}:${netmask}:::none nameserver=${dns}
set ipparam BOOTIF=${netX/mac} ${ipparam}
goto ${menu} ||
:kairos
set os Kairos
isset ${kairos_mirror} || set kairos_mirror kairos-io/provider-kairos
isset ${kairos_version} || set kairos_version v2.3.1
isset ${kairos_provider_version} || set kairos_provider_version k3sv1.27.3+k3s1
isset ${kairos_flavor} || set kairos_flavor alpine-opensuse-leap
isset ${kairos_image} || set kairos_image standard
menu ${os}
menu ${os} install
item --gap Kairos:
item kairos_boot ${space} Begin install ${os} ${kairos_version}
item --gap Parameters:
item kairos_version_custom ${space} ${os} version: ${kairos_version}
item kairos_provider_version ${space} Set provider version: ${kairos_provider_version}
item kairos_flavor ${space} Select Flavor (default: ${kairos_flavor})
item kairos_image ${space} Select Image (default: ${kairos_image})
item kairos_config_url ${space} Set config URL: ${kairos_config_url}
item kairos_mirror ${space} Set Kairos Github repo: ${kairos_mirror}
choose --default ${menu} menu || goto kairos_exit
echo ${cls}
goto ${menu} ||
goto kairos_exit
:kairos_flavor
echo -n Set flavor: && read kairos_flavor
clear menu
goto kairos
:kairos_image
echo -n Set image: && read kairos_image
clear menu
goto kairos
:kairos_mirror
echo -n Set mirror Github repo: && read kairos_mirror
clear menu
goto kairos
:kairos_provider_version
echo -n Set provider version: && read kairos_provider_version
clear menu
goto kairos
:kairos_version_custom
clear kairos_version
echo -n Please set Kairos version manually (in format vX.Y.Z): && read kairos_version
set kairos_base_url ${kairos_mirror}/download/${kairos_version}
clear menu
goto kairos
:kairos_config_url
echo -n Set config_url: && read kairos_config_url
set kairos_params config_url=${kairos_config_url}
clear menu
goto kairos
:kairos_boot
set kairos_image_name ${kairos_image}
iseq ${kairos_image_name} standard && set kairos_image_name kairos ||
isset ${kairos_provider_version} && set kairos_provider_version -${kairos_provider_version} || set kairos_provider_version
set base-url https://github.com/${kairos_mirror}/releases/download/${kairos_version}
set kernel ${kairos_image_name}-${kairos_flavor}-${kairos_version}${kairos_provider_version}-kernel
set initrd ${kairos_image_name}-${kairos_flavor}-${kairos_version}${kairos_provider_version}-initrd
set rootfs ${kairos_image_name}-${kairos_flavor}-${kairos_version}${kairos_provider_version}.squashfs
imgfree
kernel ${base-url}/${kernel} initrd=${initrd} rd.neednet=1 rd.cos.disable ${ipparam} root=live:${base-url}/${rootfs} netboot nodepair.enable ${kairos_params} console=tty1 console=ttyS0 ${cmdline}
initrd ${base-url}/${initrd}
boot
:kairos_exit
clear menu
exit 0