linux 单文件4g,[史上最伟大网管]miniLinux网启server撒旦单文件版使用技巧和ipxe脚本解释20190814...

本帖最后由 江南一根葱 于 2019-8-14 19:27 编辑

工具及下载链接:http://bbs.wuyou.net/forum.php?mod=viewthread&tid=415752&page=1&extra=#pid3836856

前炎:向睾手丸家们致敬,睾手就不需要细看帖子享受我的班门弄腐了,本帖适合入门学习党,比如会问“为什么 启不来pe啊?为什么开机执行不了我指定的批处理啊?”这类菜鸟(我是老菜鸟)新手玩家(95后00后叫萌新)

传统bios:直接用我的tftpboot目录,启动时会chain app/config/tinycore.ipxe,对此脚本文件的建议和解释如下:

#!ipxe

#这句脚本是读取本地文件用,不用管

ifopen net0

#同上

ifstat

#设置pe的路径

set pe64wimfile= /boot/pe64.wim

set pe32wimfile= /boot/pe32.wim

#设置efi和bios下环境的不同菜单

iseq ${platform} pcbios && set mainmenu grub4dos ||

iseq ${platform} efi && set mainmenu grub2 ||

#这个我自己调试用的

set getfile /app/config/tinycore.ipxe

#设置菜单超时时间

set menu-timeout 8000

#设置菜单默认选中启动的项

set menu-default netgrubfm

:boot

#找不到next-server变量就把dhcp-server的变量值给它

isset ${next-server} || set next-server ${dhcp-server}

#找不到proxydhcp/next-server变量就把proxydhcp/dhcp-server的变量值给它

isset ${proxydhcp/next-server} || set proxydhcp/next-server ${proxydhcp/dhcp-server}

#如果proxydhcp/next-server变量值存在,那么赋给booturl,不然就使用next-server的变量值

isset ${proxydhcp/next-server} && set booturl ${proxydhcp/next-server} || set booturl ${next-server}

#备用 prompt --key 0x02 --timeout 2000 Press Ctrl-B for the iPXE command line... && shell ||

:menu

goto start

#菜单项我就不解释了

:start

menu Choose An Existing Server!  Serverip:${serverip} bootfile: ${getfile}

item --gap --             --------------------------------PXE BOOT-----------------------------

item ${mainmenu}          ${mainmenu} menu

item win10pex64           win10pe x64

item win10pex32           win10pe x32

item gitcloud                   Cloud Boot

item retry                         set filename

item --gap --             ---------------------------- Advanced options -----------------------

item --key c config       Configure settings                                   -- c

item --key p pxelinux     Load PXELinux menu                                   -- p

item shell                Drop to iPXE shell

item reboot               Reboot computer

item --key x exit         Exit iPXE and continue BIOS boot                     -- x

choose --timeout ${menu-timeout} --default ${menu-default} selected

goto ${selected}

#云启动

:gitcloud

echo Cloud Boot

goto start

#启动bios版grub2文件管理器

:grub4dos

set next-server ${proxydhcp/next-server} && chain tftp://${booturl}/grub4dos/managerpxe ||

goto retryip

:grub2

isset ${proxydhcp/dhcp-server} && imgexec http://${proxydhcp/dhcp-server}/grub2/grubfmx64.efi proxydhcp=${proxydhcp/dhcp-server} ||

imgexec http://${dhcp-server}/grub2/grubfmx64.efi proxydhcp=${dhcp-server}

goto retryip

:wimboot

#假如取文件失败就换个地址

kernel http://${booturl}/app/wimboot/wimboot || goto retryip

#前方高能!这个ghost.bat最终会出现在你所有pe的X:\windows\system32目录下,不要再问来问去怎么启动pxeautorun.txt了!取不到说明你没放,会继续启动

#如果是我提供的pe,进入系统后会自动执行ghost.bat

initrd http://${booturl}/app/bat/ghost.bat ghost.bat || goto nextg

:nextg

#在bios和efi不同环境取相应的文件

iseq ${platform} pcbios && initrd http://${booturl}/app/wimboot/bootmgr  bootmgr ||

iseq ${platform} efi    && initrd http://${booturl}/app/wimboot/bootmgfw.efi bootx64.efi ||

iseq ${platform} pcbios && initrd http://${booturl}/app/wimboot/biosbcd  bcd ||

iseq ${platform} efi    && initrd http://${booturl}/app/wimboot/bcd  bcd ||

initrd http://${booturl}/app/wimboot/boot.sdi   boot.sdi  || goto retry

initrd -n boot.wim http://${booturl}${wimfile} || goto retry

boot || goto retry

#设置选择win10pe x64并启动

:win10pex64

set wimfile ${pe64wimfile=}

goto wimboot

#设置选择win10pe x32并启动

:win10pex32

set wimfile ${pe32wimfile=}

goto wimboot

#我的云启动

:retry

console

echo set Filename

read getfile

set menu-default gitcloud

goto start

#如果当前booturl变量值是proxydhcp/next-server,那么就换成next-server,反之亦然,我瞎写的,不知道语法有没有问题

:retryip

issq ${booturl} ${proxydhcp/next-server} && set booturl ${next-server} && goto start ||

set booturl ${proxydhcp/next-server} && goto start

#下面都是些进入命令行模式,重启,退出,关机之类的,还有些备用项目,不用解释

:shell

echo Type 'exit' to get the back to the menu

shell

goto start

:failed

echo Booting failed, dropping to shell

goto shell

:reboot

reboot

:exit

exit

:config

config

goto start

脚本应该还有些错误,待闲时更新

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值