Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Commit

Permalink
Add support for iPXE
Browse files Browse the repository at this point in the history
  • Loading branch information
a1ive committed Nov 9, 2017
1 parent 266fba0 commit 52ea82c
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 27 deletions.
2 changes: 2 additions & 0 deletions boot/grub/check_type.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ else
file_icon = "cfg"
elseif file_extn == "lst" then
file_type, file_icon = "lst", "cfg"
elseif file_extn == "ipxe" then
file_type, file_icon = "ipxe", "net"
end
end
grub.setenv ("file_type",file_type)
Expand Down
13 changes: 10 additions & 3 deletions boot/grub/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function open{
initrd16 newc:bootmgr:(wimboot)/bootmgr newc:bcd:(wimboot)/bcd newc:boot.sdi:(wimboot)/boot.sdi newc:boot.wim:$file_name;
}
fi;
if regexp '^\([hcf]d[0-9]*.*$' "$file_name"; then
if regexp '^\([hc]d[0-9]*.*$' "$file_name"; then
if search -f /NTBOOT.MOD/NTBOOT.NT6; then
menuentry $"Boot NT6.x WIM (NTBOOT)" --class wim{
set g4d_param="ntboot";
Expand All @@ -213,7 +213,7 @@ function open{
fi;
elif regexp 'wpe' $file_type; then
if regexp 'pc' $grub_platform; then
if regexp '^\([hcf]d[0-9]*.*$' "$file_name"; then
if regexp '^\([hc]d[0-9]*.*$' "$file_name"; then
if search -f /NTBOOT.MOD/NTBOOT.PE1; then
menuentry $"Boot NT5.x PE (NTBOOT)" --class windows{
set g4d_param="peboot";
Expand All @@ -225,7 +225,7 @@ function open{
fi;
elif regexp 'vhd' $file_type; then
if regexp 'pc' $grub_platform; then
if regexp '^\([hcf]d[0-9]*.*$' "$file_name"; then
if regexp '^\(hd[0-9]*.*$' "$file_name"; then
if search -f /NTBOOT.MOD/NTBOOT.NT6; then
menuentry $"Boot Windows NT6.x VHD/VHDX (NTBOOT)" --class img{
set g4d_param="ntboot";
Expand Down Expand Up @@ -272,6 +272,13 @@ function open{
}
fi;
fi;
elif regexp 'ipxe' $file_type; then
if regexp 'pc' $grub_platform; then
menuentry $"Open As iPXE Script" --class net{
linux16 $prefix/ipxe.lkrn;
initrd16 "$file_name";
}
fi;
elif regexp 'pf2' $file_type; then
menuentry $"Open As Font" --class pf2{
loadfont "$file_name";
Expand Down
Binary file added boot/grub/themes/slack/icons/net.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ for /f "tokens=1,*" %%a in ("%modlist%") do (
)
copy legacy\grub.exe build\boot\grub\
copy legacy\memdisk build\boot\grub\
copy legacy\ipxe.lkrn build\boot\grub\
cd build
%~dp0\bin\find.exe ./boot | %~dp0\bin\cpio.exe -o -H newc | %~dp0\bin\gzip.exe -9 > ./fm.loop
cd ..
Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ do
done
cp legacy/grub.exe build/boot/grub/
cp legacy/memdisk build/boot/grub/
cp legacy/ipxe.lkrn build/boot/grub/
cd build
find ./boot | cpio -o -H newc | gzip -9 > ./fm.loop
cd ..
Expand Down
16 changes: 4 additions & 12 deletions lang/zh_CN/fm.po
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ msgstr "按 [ESC] 继续 ..."
msgid "Mount Image"
msgstr "挂载镜像"

#: main.sh:139
msgid "Boot Floppy Image (GRUB4DOS MEM)"
msgstr "使用GRUB4DOS加载为软盘 (复制到内存)"

#: main.sh:144
msgid "Boot Floppy Image (GRUB4DOS)"
msgstr "使用GRUB4DOS加载为软盘"
Expand All @@ -64,10 +60,6 @@ msgstr "使用GRUB4DOS加载为软盘"
msgid "Boot Floppy Image (memdisk)"
msgstr "使用memdisk加载为软盘"

#: main.sh:149
msgid "Boot Hard Drive Image (GRUB4DOS MEM)"
msgstr "使用GRUB4DOS加载为硬盘 (复制到内存)"

#: main.sh:154
msgid "Boot Hard Drive Image (GRUB4DOS)"
msgstr "使用GRUB4DOS加载为硬盘"
Expand Down Expand Up @@ -104,10 +96,6 @@ msgstr "使用NTBOOT加载 Windows NT6.x VHD/VHDX"
msgid "Mount ISO"
msgstr "查看ISO内容"

#: main.sh:173
msgid "Boot ISO (GRUB4DOS MEM)"
msgstr "使用GRUB4DOS加载ISO (复制到内存)"

#: main.sh:178
msgid "Boot ISO (GRUB4DOS)"
msgstr "使用GRUB4DOS加载ISO"
Expand All @@ -124,6 +112,10 @@ msgstr "使用Easy2Boot方式加载ISO"
msgid "Boot EFI Files"
msgstr "仅加载EFI文件"

#: main.sh:277
msgid "Open As iPXE Script"
msgstr "作为iPXE脚本打开"

#: main.sh:196
msgid "Open As Font"
msgstr "加载pf2字库文件"
Expand Down
16 changes: 4 additions & 12 deletions lang/zh_TW/fm.po
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ msgstr "按 [ESC] 繼續 ..."
msgid "Mount Image"
msgstr "掛載映象"

#: main.sh:139
msgid "Boot Floppy Image (GRUB4DOS MEM)"
msgstr "使用GRUB4DOS載入為軟盤 (複製到記憶體)"

#: main.sh:144
msgid "Boot Floppy Image (GRUB4DOS)"
msgstr "使用GRUB4DOS載入為軟盤"
Expand All @@ -64,10 +60,6 @@ msgstr "使用GRUB4DOS載入為軟盤"
msgid "Boot Floppy Image (memdisk)"
msgstr "使用memdisk載入為軟盤"

#: main.sh:149
msgid "Boot Hard Drive Image (GRUB4DOS MEM)"
msgstr "使用GRUB4DOS載入為硬碟 (複製到記憶體)"

#: main.sh:154
msgid "Boot Hard Drive Image (GRUB4DOS)"
msgstr "使用GRUB4DOS載入為硬碟"
Expand Down Expand Up @@ -104,10 +96,6 @@ msgstr "使用NTBOOT載入 Windows NT6.x VHD/VHDX"
msgid "Mount ISO"
msgstr "檢視ISO內容"

#: main.sh:173
msgid "Boot ISO (GRUB4DOS MEM)"
msgstr "使用GRUB4DOS載入ISO (複製到記憶體)"

#: main.sh:178
msgid "Boot ISO (GRUB4DOS)"
msgstr "使用GRUB4DOS載入ISO"
Expand All @@ -124,6 +112,10 @@ msgstr "使用Easy2Boot方式載入ISO"
msgid "Boot EFI Files"
msgstr "僅載入EFI檔案"

#: main.sh:277
msgid "Open As iPXE Script"
msgstr "作為iPXE指令碼載入"

#: main.sh:196
msgid "Open As Font"
msgstr "載入pf2字型檔檔案"
Expand Down
Binary file added legacy/ipxe.lkrn
Binary file not shown.

0 comments on commit 52ea82c

Please sign in to comment.