|
| 1 | +#!ipxe |
| 2 | + |
| 3 | +# CentOS Stream CoreOS |
| 4 | +# https://www.centos.org/cloud/ |
| 5 | +# https://github.com/coreos/coreos-installer/blob/master/README.md#installing-from-pxe |
| 6 | + |
| 7 | +goto ${menu} |
| 8 | + |
| 9 | +:scos |
| 10 | +set os {{ releases.centos-coreos.name }} |
| 11 | +set os_arch ${arch} |
| 12 | +iseq ${os_arch} x86_64 && set os_arch x86_64 || |
| 13 | +iseq ${os_arch} arm64 && set os_arch aarch64 || |
| 14 | +isset ${install_device} || set install_device /dev/sda |
| 15 | +isset ${ignition_url} || set ignition_url skip |
| 16 | +menu ${os} - ${os_arch} |
| 17 | +item --gap ${os}: |
| 18 | +{% for item in releases.centos-coreos.versions %} |
| 19 | +item {{ item.code_name }} ${space} ${os} {{ item.name }} |
| 20 | +{% endfor %} |
| 21 | +item install_dev ${space} Set install device (e.g. /dev/sda): ${install_device} |
| 22 | +item ignition_config ${space} Set ignition config url: ${ignition_url} |
| 23 | +choose --default ${scos_version} scos_version || goto scos_exit |
| 24 | +echo ${cls} |
| 25 | +iseq ${scos_version} ignition_config && goto ignition_config || |
| 26 | +iseq ${scos_version} install_dev && goto install_dev || |
| 27 | +goto scos_boot || |
| 28 | +goto scos_exit |
| 29 | + |
| 30 | +:scos_boot |
| 31 | +{% for item in releases.centos-coreos.versions %} |
| 32 | +iseq ${centos-core_version} {{ item.code_name }} && set scos_major_version {{ item.major_version }} || |
| 33 | +{% endfor %} |
| 34 | +set base_url ${centos-coreos_mirror}/${centos-coreos_base_dir}/${scos_major_version}/prod/streams |
| 35 | +set build_version ${scos_version} |
| 36 | +imgfree |
| 37 | +kernel ${base_url}/${build_version}/${os_arch}/scos-${build_version}-live-kernel.${os_arch} ip=dhcp rd.neednet=1 coreos.inst.install_dev=${install_device} coreos.inst.ignition_url=${ignition_url} coreos.live.rootfs_url=${base_url}/${build_version}/${os_arch}/scos-${build_version}-live-rootfs.${os_arch}.img initrd=initrd.magic ${cmdline} |
| 38 | +initrd ${base_url}/${build_version}/${os_arch}/scos-${build_version}-live-initramfs.${os_arch}.img |
| 39 | +boot |
| 40 | +goto scos_exit |
| 41 | + |
| 42 | +:install_dev |
| 43 | +echo -n Selected install device will be overwritten, |
| 44 | +echo -n please ensure you know what are you doing... |
| 45 | +echo -n Please set desired install device: && read install_device |
| 46 | +clear menu |
| 47 | +goto scos |
| 48 | + |
| 49 | +:ignition_config |
| 50 | +echo -n Please set Ignition Configuration URL: && read ignition_url |
| 51 | +clear menu |
| 52 | +goto scos |
| 53 | + |
| 54 | +:scos_exit |
| 55 | +clear menu |
| 56 | +exit 0 |
0 commit comments