diff --git a/README.md b/README.md index 527aacd2bd..15ba9fa5e4 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,7 @@ In addition to being able to host netboot.xyz locally, you can also create your | OpenBSD | https://openbsd.org | Yes | No | | openEuler | https://openeuler.org | Yes | No | | OpenSUSE | https://opensuse.org | Yes | No | +| FAI | https://fai-project.org | Yes | No | | Oracle Linux | https://www.oracle.com/linux/ | Yes | Installer | | Parrot Security | https://www.parrotsec.org | No | Yes | | Peppermint | https://peppermintos.com | No | Yes | diff --git a/endpoints.yml b/endpoints.yml index 7c0bd1ae9c..6ee06eddbe 100644 --- a/endpoints.yml +++ b/endpoints.yml @@ -434,6 +434,14 @@ endpoints: - squashfs.img os: oracle version: '7' + fai: + path: /asset-mirror/releases/download/2022-04-15-67ed5e2e/ + files: + - vmlinuz + - initrd.img + - filesystem.squashfs + os: fai + version: 2022-04-15 kodachi-6: path: /ubuntu-squash/releases/download/6.2-2a23039c/ files: diff --git a/roles/netbootxyz/defaults/main.yml b/roles/netbootxyz/defaults/main.yml index b6ff00d75e..ff6f726e68 100644 --- a/roles/netbootxyz/defaults/main.yml +++ b/roles/netbootxyz/defaults/main.yml @@ -225,6 +225,14 @@ releases: testing: - code_name: daedalus name: Daedalus (testing) + fai: + enabled: true + menu: linux + mirror: https://fai-project.org/netboot/ + name: FAI + platforms: + - key: metal + name: Bare Metal fedora: base_dir: fedora enabled: true diff --git a/roles/netbootxyz/templates/menu/fai.ipxe.j2 b/roles/netbootxyz/templates/menu/fai.ipxe.j2 new file mode 100644 index 0000000000..20f5b90903 --- /dev/null +++ b/roles/netbootxyz/templates/menu/fai.ipxe.j2 @@ -0,0 +1,90 @@ +#!ipxe + +# FAI +# https://fai-project.org/netboot/fai.ipxe + +goto ${menu} || + +:fai +set os {{ releases.fai.name }} +set os_arch ${arch} +iseq ${os_arch} x86_64 && set os_arch amd64 || +iseq ${os_arch} arm64 && set os_arch arm64 || +isset ${fai_version} || set fai_version latest +isset ${fai_mirror} || set fai_mirror {{ releases.fai.mirror }} +isset ${fai_platform} || set fai_platform metal +menu ${os} by fai-project.org +menu ${os} install +item --gap FAI: +item fai_boot ${space} Begin install ${os} ${fai_version} +item --gap Parameters: +item fai_version ${space} ${os} version: ${fai_version} +item fai_config_url ${space} Set userdata.yaml URL: ${fai_config_url} +item fai_mirror ${space} Set mirror URL: ${fai_mirror} +item fai_platform ${space} Set platform: ${fai_platform} +choose --default ${menu} menu || goto fai_exit +echo ${cls} +goto ${menu} || +goto fai_exit + +:fai_version +menu ${os} version +item latest ${space} latest +item custom ${space} Set custom version +choose --default ${version} version || goto fai_exit +echo ${cls} +goto fai_version_${version} || +goto fai_exit + +:fai_version_latest +set fai_version latest +set fai_base_url ${fai_mirror}/${os_arch}/latest +goto fai + +:fai_version_custom +clear fai_version +echo -n Please set FAI version manually (in format YYYY-MM-DD): && read fai_version +set fai_base_url ${fai_mirror}/${os_arch}/${fai_version} +clear menu +goto fai + +:fai_mirror +echo -n Set mirror URL: && read fai_mirror +clear menu +goto fai + +:fai_config_url +echo -n Set userdata.yaml URL: && read fai_config_url +clear menu +goto fai + +:fai_config_branch +echo -n Set userdata.yaml URL: && read fai_config_branch +clear menu +goto fai + +:fai_platform +menu ${os} platforms +{% for item in releases.fai.platforms %} +item {{ item.key }} ${space} {{ item.name }} +{% endfor %} +choose --default ${fai_platform} fai_platform +goto fai + +:fai_boot +isset ${fai_base_url} || set fai_base_url ${fai_mirror}/latest/ +set boot_params root=live:${fai_mirror}/${os_arch}/${fai_version}/filesystem.squashfs noswap kernel.sysrq=1 sysrq_always_enabled log_buf_len=1M quickreboot consoleblank=0 keep_bootcon initrd=initrd.img rootwait=120 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,menu,reboot FAI_CONFIG_SRC=git+${fai_config}#${fai_config_branch} FAI_ACTION=install {{ kernel_params }} +imgfree +kernel ${fai_base_url}/vmlinuz ${boot_params} +initrd ${fai_base_url}/initrd.img +echo +echo Booting with the following kernel args: +echo ${boot_params} +echo +echo MD5sums: +md5sum vmlinuz initrd.img +boot + +:fai_exit +clear menu +exit 0