Skip to content

Commit 66386ab

Browse files
author
Juri Grabowski
committed
add fai
1 parent e790d79 commit 66386ab

File tree

4 files changed

+107
-0
lines changed

4 files changed

+107
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ In addition to being able to host netboot.xyz locally, you can also create your
159159
| OpenBSD | https://openbsd.org | Yes | No |
160160
| openEuler | https://openeuler.org | Yes | No |
161161
| OpenSUSE | https://opensuse.org | Yes | No |
162+
| FAI | https://fai-project.org | Yes | No |
162163
| Oracle Linux | https://www.oracle.com/linux/ | Yes | Installer |
163164
| Parrot Security | https://www.parrotsec.org | No | Yes |
164165
| Peppermint | https://peppermintos.com | No | Yes |

endpoints.yml

+8
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,14 @@ endpoints:
434434
- squashfs.img
435435
os: oracle
436436
version: '7'
437+
fai:
438+
path: /asset-mirror/releases/download/2022-04-15-67ed5e2e/
439+
files:
440+
- vmlinuz
441+
- initrd.img
442+
- filesystem.squashfs
443+
os: fai
444+
version: 2022-04-15
437445
kodachi-6:
438446
path: /ubuntu-squash/releases/download/6.2-2a23039c/
439447
files:

roles/netbootxyz/defaults/main.yml

+8
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@ releases:
225225
testing:
226226
- code_name: daedalus
227227
name: Daedalus (testing)
228+
fai:
229+
enabled: true
230+
menu: linux
231+
mirror: https://fai-project.org/netboot/
232+
name: FAI
233+
platforms:
234+
- key: metal
235+
name: Bare Metal
228236
fedora:
229237
base_dir: fedora
230238
enabled: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!ipxe
2+
3+
# FAI
4+
# https://fai-project.org/netboot/fai.ipxe
5+
6+
goto ${menu} ||
7+
8+
:fai
9+
set os {{ releases.fai.name }}
10+
set os_arch ${arch}
11+
iseq ${os_arch} x86_64 && set os_arch amd64 ||
12+
iseq ${os_arch} arm64 && set os_arch arm64 ||
13+
isset ${fai_version} || set fai_version latest
14+
isset ${fai_mirror} || set fai_mirror {{ releases.fai.mirror }}
15+
isset ${fai_platform} || set fai_platform metal
16+
menu ${os} by fai-project.org
17+
menu ${os} install
18+
item --gap FAI:
19+
item fai_boot ${space} Begin install ${os} ${fai_version}
20+
item --gap Parameters:
21+
item fai_version ${space} ${os} version: ${fai_version}
22+
item fai_config_url ${space} Set userdata.yaml URL: ${fai_config_url}
23+
item fai_mirror ${space} Set mirror URL: ${fai_mirror}
24+
item fai_platform ${space} Set platform: ${fai_platform}
25+
choose --default ${menu} menu || goto fai_exit
26+
echo ${cls}
27+
goto ${menu} ||
28+
goto fai_exit
29+
30+
:fai_version
31+
menu ${os} version
32+
item latest ${space} latest
33+
item custom ${space} Set custom version
34+
choose --default ${version} version || goto fai_exit
35+
echo ${cls}
36+
goto fai_version_${version} ||
37+
goto fai_exit
38+
39+
:fai_version_latest
40+
set fai_version latest
41+
set fai_base_url ${fai_mirror}/${os_arch}/latest
42+
goto fai
43+
44+
:fai_version_custom
45+
clear fai_version
46+
echo -n Please set FAI version manually (in format YYYY-MM-DD): && read fai_version
47+
set fai_base_url ${fai_mirror}/${os_arch}/${fai_version}
48+
clear menu
49+
goto fai
50+
51+
:fai_mirror
52+
echo -n Set mirror URL: && read fai_mirror
53+
clear menu
54+
goto fai
55+
56+
:fai_config_url
57+
echo -n Set userdata.yaml URL: && read fai_config_url
58+
clear menu
59+
goto fai
60+
61+
:fai_config_branch
62+
echo -n Set userdata.yaml URL: && read fai_config_branch
63+
clear menu
64+
goto fai
65+
66+
:fai_platform
67+
menu ${os} platforms
68+
{% for item in releases.fai.platforms %}
69+
item {{ item.key }} ${space} {{ item.name }}
70+
{% endfor %}
71+
choose --default ${fai_platform} fai_platform
72+
goto fai
73+
74+
:fai_boot
75+
isset ${fai_base_url} || set fai_base_url ${fai_mirror}/latest/
76+
set boot_params boot=live components root=live:${fai_mirror}/${os_arch}/${fai_version}/filesystem.squashfs noswap live kernel.sysrq=1 sysrq_always_enabled log_buf_len=1M quickreboot consoleblank=0 keep_bootcon initrd=initrd.img rootwait=120 live-config noautologin nox11autologin nottyautologin rd.live.image rd.neednet rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0 rd.driver.pre=loop rd.noverifyssl rd.skipfsck rd.live.overlay.check rd.live.overlay.reset rd.live.ram biosdevname=0 net.ifnames=0 FAI_FLAGS=verbose,sshd,initial,createvt,reboot FAI_CONFIG_SRC=git+${fai_config}#${fai_config_branch} LOGUSER=fai SERVER=fai-project.org FAI_ACTION=install {{ kernel_params }}
77+
imgfree
78+
kernel ${fai_base_url}/vmlinuz ${boot_params}
79+
initrd ${fai_base_url}/initrd.img
80+
echo
81+
echo Booting with the following kernel args:
82+
echo ${boot_params}
83+
echo
84+
echo MD5sums:
85+
md5sum vmlinuz initrd.img
86+
boot
87+
88+
:fai_exit
89+
clear menu
90+
exit 0

0 commit comments

Comments
 (0)