|
发表于 2020-6-2 12:34:54
|
显示全部楼层
有挺简单的
如果你要使用原封不动使用以下菜单 请自行编译ipxe使只能 支持设置poweroff 与 console 命令 或者直接注释以下与poweroff、console的命令
权限不足自行删除下括号中的内容含括号
#!ipxe
##check platform (pcbios or efi)
echo Platform: ${platform}
set menu-timeout 10000 #设置菜单自动选择超时时间
dhcp
isset ${next-server} || set next-server 192.168.2.254 #自行指定服务器ip
set xieyi:string http(权限不足请自行删除这段)://${next-server}
iseq ${platform} pcbios && set start BIOS_MENU || set start EFI_MENU
goto ${start}
:BIOS_MENU
console --x 800 --y 600 --picture ${xieyi}/png/winpe.png #设置背景图片
set menu-default Bootlocaldisk #设置BIOS模式默认引导菜单
menu iPXE BIOS Boot Menu
item --gap -- --------------------------------- PE -------------------------------
item --key 1 Win8.1pe <1> Boot Nruan xiaobai Win8.1
item --key 2 Win10pe20200501 <2> Boot Eu Win10 x64 20200501
item --gap -- --------------------------- Install Linux --------------------------
item --key 3 menu-Linux <3> Linux Install Menu
item --gap -- -------------------------------- TOOL ------------------------------
item maxdos Maxdos Tool...
item menu-disk Disk Tool...
item menu-other Other Tool...
item --gap -- ---------------------------- Advanced options ----------------------
item --key c config <c> Configure settings
item --key d shell <d> Drop to iPXE shell
item --key b Bootlocaldisk <b> Boot Local Disk
item --key r reboot <r> Reboot computer
item --key p poweroff <p> Shutdown Computer
item --key x exit <x> Exit iPXE and continue BIOS boot
choose --timeout ${menu-timeout} --default ${menu-default} selected
goto ${selected}
:shell
echo Type 'exit' to get the back to the menu
shell
goto ${start}
:reboot
reboot
:poweroff
poweroff
:exit
exit
:config
config
goto ${start}
:menu-Linux
menu Linux Install Menu
item --gap -- --------------------------- Local CentOS Install --------------------------
item --key 1 LocalCentos6 <1> Local Install CentOS 6 x86_64
item --key 2 LocalCentos7 <2> Local Install CentOS 7 x86-64
item --key 3 LocalCentos8 <3> Local Install CentOS 8 x86-64
item --key 0x08 back Back to top menu...
choose selected && goto ${selected} || goto ${start}
# Centos Installation
:LocalCentos6
echo Starting CentOS 6 installer
set base ${xieyi}/Linux/CentOS6/x86_64
kernel ${base}/images/pxeboot/vmlinuz initrd=initrd.img repo=${base} || goto retry
initrd ${base}/images/pxeboot/initrd.img || goto retry
boot || goto retry
goto ${start}
:LocalCentos7
echo Starting CentOS 7 installer
set base ${xieyi}/Linux/CentOS7/x86_64
kernel ${base}/images/pxeboot/vmlinuz inst.repo=${base} || goto retry
initrd ${base}/images/pxeboot/initrd.img || goto retry
boot || goto retry
goto ${start}
:LocalCentos8
echo Starting CentOS 8 installer
set base ${xieyi}/Linux/CentOS8/x86_64
kernel ${base}/images/pxeboot/vmlinuz inst.repo=${base} || goto retry
initrd ${base}/images/pxeboot/initrd.img || goto retry
boot || goto retry
goto ${start}
:pxelinux
chain ${xieyi}/pxelinux.0 || goto retry
:grub4dos
chain ${xieyi}/grldr.0 || goto retry
:memtest
chain ${xieyi}/tools/memtest.bin || goto retry
goto ${start}
:maxdos
initrd ${xieyi}/tools/dostools/max9.3.ima
chain ${xieyi}/memdisk || goto retry
:menu-disk
menu Disk Tool
item diskgen DiskGen4.5
item Diskgenius DiskGen4.9.6
item mhdd MHDD
item --key 0x08 back Back to top menu...
choose selected && goto ${selected} || goto ${start}
:diskgen
initrd ${xieyi}/tools/DOSTOOLS/DGDOS.IMG
chain ${xieyi}/memdisk || goto retry
:Diskgenius
initrd ${xieyi}/tools/DOSTOOLS/Diskgenius_4.9.6.iso
chain ${xieyi}/MEMDISK iso raw || goto retry
:mhdd
initrd ${xieyi}/tools/DOSTOOLS/MHDD.ISO
chain ${xieyi}/memdisk iso raw || goto retry
:menu-other
menu
item memtest memtest86+
item test ${xieyi} ---- select change
item --key 0x08 back Back to top menu...
choose selected && goto ${selected} || goto ${start}
:test
iseq ${xieyi} ftp && set xieyi http && goto menu-other ||
iseq ${xieyi} http && set xieyi ftp && goto menu-other ||
:Win10pe20200501
kernel ${xieyi}/boot/wimboot || goto retry
initrd ${xieyi}/boot/bootmgr.exe bootmgr.exe || goto retry
initrd ${xieyi}/boot/bcd BCD || goto retry
initrd ${xieyi}/boot/boot.sdi boot.sdi || goto retry
initrd ${xieyi}/pe/EasyU10PEx64_0501/BOOT.wim BOOT.WIM || goto retry
boot || goto retry
goto ${start}
:Win8.1pe
kernel ${xieyi}/boot/wimboot || goto retry
initrd ${xieyi}/boot/bootmgr.exe bootmgr.exe || goto retry
initrd ${xieyi}/boot/bcd BCD || goto retry
initrd ${xieyi}/boot/boot.sdi boot.sdi || goto retry
initrd ${xieyi}/pe/WIN81X64/BOOT.wim BOOT.WIM || goto retry
boot || goto retry
goto ${start}
:Bootlocaldisk
sanboot --no-describe --drive 0x80
:reboot
reboot
:exit
exit
:EFI_MENU
console --x 800 --y 600 --picture ${xieyi}/png/winpe.png
set menu-default Win10pe20200501EFI #设置EFI模式默认引导菜单
menu iPXE EFI Boot Menu
item --gap -- ------------------------------ EFI PE --------------------------------
item --key 1 Win8.1peEFI <1> EFI Boot Nruan xiaobai Win8.1
item --key 2 Win10pe20200501EFI <2> EFI Boot Eu Win10 x64 20200501
item --gap -- ---------------------------- Advanced options -----------------------
item --key r reboot <r> ReBoot Computer
item --key p poweroff <p> Shutdown Computer
choose --timeout ${menu-timeout} --default ${menu-default} selected
goto ${selected}
:Win8.1peEFI
kernel ${xieyi}/boot/wimboot || goto retry
initrd ${xieyi}/boot/bootx64.efi bootx64.efi || goto retry
initrd ${xieyi}/boot/BCD bcd || goto retry
initrd ${xieyi}/boot/boot.sdi boot.sdi || goto retry
initrd ${xieyi}/pe/WIN81X64/boot.wim boot.wim || goto retry
boot || goto retry
goto ${start}
:Win10pe20200501EFI
kernel ${xieyi}/boot/wimboot || goto retry
initrd ${xieyi}/boot/bootx64.efi bootx64.efi || goto retry
initrd ${xieyi}/boot/BCD bcd || goto retry
initrd ${xieyi}/boot/boot.sdi boot.sdi || goto retry
initrd ${xieyi}/pe/EasyU10PEx64_0501/boot.wim boot.wim || goto retry
boot || goto retry
goto ${start}
:retry
imgfree
prompt Error! press any key to back menu
goto ${start} |
|