Skip to content

Commit

Permalink
Add initial support for Harvester
Browse files Browse the repository at this point in the history
  • Loading branch information
antonym committed Sep 1, 2021
1 parent c802780 commit f5ff7e0
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file.
## [Unreleased]

## [2.0.48]
#### Added
- Support for Harvester

## [2.0.47] - 2021-08-30
#### Fixes
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ In addition to being able to host netboot.xyz locally, you can also create your
| FreeBSD | https://freebsd.org | Yes, disk image | No |
| FreeDOS | http://www.freedos.org | ISO - Memdisk| No |
| Gentoo | https://gentoo.org | Yes | Yes |
| Harvester | https://harvesterhci.io | Yes | No |
| IPFire | https://www.ipfire.org | Yes | No |
| Kali Linux | https://www.kali.org | Yes | Yes |
| KDE Neon | https://neon.kde.org | No | Yes |
Expand Down
8 changes: 8 additions & 0 deletions roles/netbootxyz/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,14 @@ releases:
enabled: true
menu: linux
name: Gentoo
harvester:
enabled: true
menu: linux
mirror: https://releases.rancher.com/harvester
name: Harvester
versions:
- code_name: v0.2.0
name: v0.2.0
ipfire:
base_dir: releases/ipfire-2.x
enabled: true
Expand Down
67 changes: 67 additions & 0 deletions roles/netbootxyz/templates/menu/harvester.ipxe.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!ipxe

# Harvester
# https://harvesterhci.io/
# https://docs.harvesterhci.io/v0.2/install/pxe-boot-install/

goto ${menu} ||

:harvester
set os {{ releases.harvester.name }}
set os_arch ${arch}
iseq ${os_arch} x86_64 && set os_arch amd64 ||
set harvester_mirror {{ releases.harvester.mirror }}
set harvester_version {{ releases.harvester.versions[0].name }}
isset ${harvester_version} || set harvester_version {{ releases.harvester.versions[0].name }}
menu ${os} - ${os_arch}
item --gap Harvester:
item harvester_boot ${space} Begin install ${os} ${harvester_version}
item --gap Parameters:
item harvester_version ${space} ${os} version: ${harvester_version}
item harvester_config_url ${space} Set config-create or config-join.yaml URL: ${harvester_config_url}
choose --default ${menu} menu || goto harvester_exit
echo ${cls}
goto ${menu} ||
goto harvester_exit

:harvester_version
menu ${os} version
item latest ${space} latest
item custom ${space} Set custom version
choose --default ${version} version || goto harvester_exit
echo ${cls}
goto harvester_version_${version} ||
goto harvester_exit

:harvester_version_latest
set harvester_version {{ releases.harvester.versions[0].name }}
set harvester_base_url ${harvester_mirror}/${harvester_version}
goto harvester

:harvester_version_custom
clear harvester_version
echo -n Please set harvester version manually (in format vX.Y.Z): && read harvester_version
set harvester_base_url ${harvester_mirror}/${harvester_version}
clear menu
goto harvester

:harvester_config_url
echo -n Set config.yaml URL: && read harvester_config_url
clear menu
goto harvester

:harvester_boot
isset ${harvester_base_url} || set harvester_base_url ${harvester_mirror}/${harvester_version}
set install_params k3os.mode=install harvester.install.automatic=true harvester.install.config_url=${harvester_config_url}
set boot_params console=ttyS0 console=tty1
imgfree
kernel ${harvester_base_url}/harvester-vmlinuz-${os_arch} ${install_params} ${boot_params} {{ kernel_params }}
initrd ${harvester_base_url}/harvester-initrd-${os_arch}
echo
echo MD5sums:
md5sum harvester-vmlinuz-${os_arch} harvester-initrd-${os_arch}
boot

:harvester_exit
clear menu
exit 0

0 comments on commit f5ff7e0

Please sign in to comment.