Pārlūkot izejas kodu

Testing out new version of bootdisk to consolidate other disks

Antony Messerli 9 gadi atpakaļ
vecāks
revīzija
4354fcc3a7
3 mainītis faili ar 68 papildinājumiem un 0 dzēšanām
  1. 66 0
      ipxe/disks/netboot.xyz
  2. 1 0
      ipxe/local/general.h
  3. 1 0
      src/menu.ipxe

+ 66 - 0
ipxe/disks/netboot.xyz

@@ -0,0 +1,66 @@
+#!ipxe
+set esc:hex 1b
+set bold ${esc:string}[1m
+set boldoff ${esc:string}[22m
+set fg_gre ${esc:string}[32m
+set fg_cya ${esc:string}[36m
+set fg_whi ${esc:string}[37m
+set HTTPS_ERR HTTPS appears to have failed... attempting HTTP
+set HTTP_ERR HTTP has failed, localbooting...
+set version 1.04
+
+:start
+echo ${bold}${fg_gre}netboot.xyz ${fg_whi}v${version}${boldoff}
+prompt --key m --timeout 4000 Hit the ${bold}m${boldoff} key to open failsafe menu... && goto failsafe || goto dhcp
+
+:dhcp
+dhcp || goto netconfig
+goto menu
+
+:failsafe
+menu netboot.xyz Failsafe Menu
+item localboot Boot to local drive
+item netconfig Manual network configuration
+item retry Retry boot
+item debug iPXE Debug Shell
+item reboot Reboot System
+choose failsafe_choice || exit
+goto ${failsafe_choice}
+
+:netconfig
+echo Network Configuration:
+echo Available interfaces...
+ifstat
+imgfree
+echo -n Set network interface number [0 for net0, defaults to 0]: ${} && read net
+isset ${net} || set net 0
+echo -n IP: && read net${net}/ip
+echo -n Subnet mask: && read net${net}/netmask
+echo -n Gateway: && read net${net}/gateway
+echo -n DNS: && read dns
+ifopen net${net}
+echo Attempting chainload of netboot.xyz...
+goto menu || goto failsafe
+
+:menu
+set conn_type https
+chain --autofree https://boot.netboot.xyz/menu.ipxe || echo ${HTTPS_ERR}
+sleep 5
+set conn_type http
+chain --autofree http://boot.netboot.xyz/menu.ipxe || echo ${HTTP_ERR}
+goto localboot
+
+:localboot
+exit
+
+:retry
+goto start
+
+:reboot
+reboot
+goto start
+
+:debug
+echo Type "exit" to return to menu
+shell
+goto failsafe

+ 1 - 0
ipxe/local/general.h

@@ -3,4 +3,5 @@
 #define IMAGE_COMBOOT         /* COMBOOT */
 #define IMAGE_TRUST_CMD	      /* Image trust management commands */
 #define NET_PROTO_IPV6        /* IPv6 protocol */
+#define REBOOT_CMD            /* Reboot command */
 #define VLAN_CMD              /* VLAN commands */

+ 1 - 0
src/menu.ipxe

@@ -11,6 +11,7 @@ set cls ${cls:string}
 :version_check
 set latest_version 1.03
 echo ${cls}
+iseq ${version] 1.04 && goto version_up2date ||
 iseq ${version} ${latest_version} && goto version_up2date ||
 echo
 echo Updated version of netboot.xyz is available: