소스 검색

isolate the tftp boot into a sub menu and only run it if DHCP succeeds with server name being set and the filename being ours

thelamer 5 년 전
부모
커밋
6fb4fa3a9a
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      roles/netbootxyz/templates/disks/ipxe-bootloader.j2

+ 5 - 1
roles/netbootxyz/templates/disks/ipxe-bootloader.j2

@@ -19,6 +19,8 @@ prompt --key m --timeout 4000 Hit the ${bold}m${boldoff} key to open failsafe me
 :dhcp
 echo
 dhcp || goto netconfig
+isset ${next-server} && iseq ${filename} netboot.xyz.kpxe && goto tftpmenu
+isset ${next-server} && iseq ${filename} netboot.xyz.efi && goto tftpmenu
 goto menu
 
 :failsafe
@@ -46,8 +48,10 @@ ifopen net${net}
 echo Attempting chainload of ${boot_domain}...
 goto menu || goto failsafe
 
+:tftpmenu
+chain --autofree tftp://${next-server}/menu.ipxe || echo ${TFTP_ERR} && goto menu
+
 :menu
-chain --autofree tftp://${next-server}/menu.ipxe || echo ${TFTP_ERR}
 set conn_type https
 chain --autofree https://${boot_domain}/menu.ipxe || echo ${HTTPS_ERR}
 sleep 5