无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 14392|回复: 38
打印 上一主题 下一主题

[发布] 8.4更新。IPXE启动文件,启动快速!!含源码,

  [复制链接]
1#
发表于 2019-8-7 09:22:58 | 显示全部楼层
最近折腾的dnsmasq默认不发送next-server,ipxe里看变量值是空的,是dhcp-server
回复

使用道具 举报

2#
发表于 2019-8-7 09:26:05 | 显示全部楼层
#!ipxe
ifopen net0
ifstat


set getfile tinycore.ipxe

   set menu-timeout 8000
   set menu-default dhcpserver
:boot
dhcp
prompt --key 0x02 --timeout 2000 Press Ctrl-B for the iPXE command line... && shell ||
chain file:/pxeboot/${getfile} || goto netboot

:netboot
set bootfile ${filename}
set serverip ${dhcp-server}|${proxydhcp/dhcp-server}|${proxydhcp/next-server}
chain tftp://${dhcp-server}/${getfile} || chain tftp://${proxydhcp/dhcp-server}/${getfile} ||
goto start


:menu

goto start

:start
  menu Choose An Existing Server!  Serverip:${serverip}  bootfile: ${getfile}
  item --gap --             --------------------------------PXE BOOT-----------------------------
  item dhcpserver        ${dhcp-server}
  item proxydhcp         ${proxydhcp/dhcp-server}
  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}

:dhcpserver
echo ${dhcp-server}/${getfile}
chain tftp://${dhcp-server}/${getfile} || set menu-default proxydhcp ||
goto start

:proxydhcp
echo ${proxydhcp/dhcp-server}/${getfile}
chain tftp://${proxydhcp/dhcp-server}/${getfile} || set menu-default gitcloud ||
goto start

:gitcloud
echo Cloud Boot
chain https://raw.githubusercontent.com/zwj4031/netboot/master/${getfile} || set menu-default retry ||
goto start



:retry
console
echo set Filename
read getfile
set menu-default dhcpserver
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


这是我这几天琢磨的脚本,在研究研究有没有可以改进的。

点评

8.7更新 1.添加next-server完全不能获取时候使用DHCP服务器 2,细微调整,启动不成功添加菜单  详情 回复 发表于 2019-8-7 17:31
回复

使用道具 举报

3#
发表于 2019-8-9 09:01:30 | 显示全部楼层
isset ${next-server} || set next-server ${dhcp-server}
isset ${proxydhcp/next-server} || set proxydhcp/next-server ${proxydhcp/dhcp-server}

这个语法有没有对的,我打算统一用next-server

点评

isset ${proxydhcp/next-server} || set proxydhcp/next-server ${proxydhcp/dhcp-server},这行一看就有问题吧!  详情 回复 发表于 2019-8-9 09:34
回复

使用道具 举报

4#
发表于 2019-8-9 11:03:50 | 显示全部楼层
本帖最后由 江南一根葱 于 2019-8-9 11:06 编辑

我在dnsmasq下默认配置不存在next-server,自然也不存在proxydhcp/next-server,所以不存在就从dhcp-server取了

我目前是不存在就取,不存在就保留next-server变量
存在proxydhcp就优先从proxydhcp上取文件

点评

用原版的IPXE启动文件!在DHCP之前到命令行,然后查看next-server,试试有没有值!  详情 回复 发表于 2019-8-9 12:46
這該是你啟動ipxe腳本時,用了命令「dhcp」更新客戶機網絡設定。導致一部份不是「必須的設定值如pxe next server」經dhcp server 再重設了(不是proxydhcp)。 你再進入iPXE介面時已經覆寫了設定,所以看不見。  详情 回复 发表于 2019-8-9 12:22
回复

使用道具 举报

5#
发表于 2019-8-9 11:34:15 | 显示全部楼层
hkkitlee 发表于 2019-8-9 10:13
PXE NBPs
PXE NBPs such as Windows Deployment Service's wdsnbp.com or pxelinux.0 will attempt to ret ...

这样的话对我来说好像更好,我正愁dnsmasq下ipxe启grldr后不能使用ipxe chain grub2,好像没proxydhcp/next-server就是瓶颈
回复

使用道具 举报

6#
发表于 2019-8-9 11:53:22 | 显示全部楼层
hkkitlee 发表于 2019-8-9 10:13
PXE NBPs
PXE NBPs such as Windows Deployment Service's wdsnbp.com or pxelinux.0 will attempt to ret ...

对了,你帖中dnsmasq的配置好像怎么都启不来efi文件,不知道是不是我vmware版本原因,能列表的是BC_EFI,但启不来,网启后回到固件开机选单页面
但我用另一帖http://bbs.wuyou.net/forum.php?mod=viewthread&tid=368988中7楼的方案可以启动成功,

还有就是kernel ipxe.kkpxe是不是个坑啊,我用生成的ipxe.lkrn才可以这么操做

点评

印象中你加了#在設定檔[關於Arch 9 BC_EFI回應] 改回你的檔名,刪除除#號,重啟dnsmasq應該可以 #0 pxe-service=X86PC, "kkpxe for Legacy BIOS", undionly.kkpxe pxe-service=X86PC, "kpxe for Legacy BIOS  详情 回复 发表于 2019-8-9 12:33
回复

使用道具 举报

7#
发表于 2019-8-9 13:18:04 | 显示全部楼层
hkkitlee 发表于 2019-8-9 12:33
印象中你加了#在設定檔[關於Arch 9 BC_EFI回應]
改回你的檔名,刪除除#號,重啟dnsmasq應該可以

搞定了,我折腾半天果断开启了日志,原来是efi下也是请求xxx.efi.0,郁闷
回复

使用道具 举报

8#
发表于 2019-8-9 13:21:48 | 显示全部楼层
huaqingyuan 发表于 2019-8-9 12:46
用原版的IPXE启动文件!在DHCP之前到命令行,然后查看next-server,试试有没有值!

pxe启动,没有的,不过我给dhcp-option后是有了,但还是加了dhcp-server以防万一
这么一想,tinypxe的next-server原来可以设定成别的值,也就是别的启动器由pxe启动后也许没有这个值

点评

樓主先多包涵,有點偏離了主題,但剛討論到next server才回答蔥師兄的問題。有需要請聯絡刪除。 Dnsmasq指派非預設的tftp作next server: pxe-service=BC_EFI, "Boot BC_EFI", uefi/ipxe64.efi,[machine name],  详情 回复 发表于 2019-8-9 14:40
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-5-13 20:30

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表