制作支持安装Windows和Linux系统并带PE的U启动盘

仅仅制作需要安装Windows系统的启动盘,使用老毛桃、大白菜之类的U盘启动工具制作就好了,安装Linux也可以直接将镜像写入U盘,但如果需要带PE系统的启动盘,既能安装Windows系统又能安装Linux系统,则需要花点功夫。

首先使用老毛桃、大白菜之类的U盘启动工具制作启动盘,这类工具的功能大多数是一样的,甚至连界面都差不多,我使用的是大白菜,你可以选择自己喜欢的工具。

大白菜PE界面

然后下载grldr编辑器,我使用的是FbinstTool,编辑MENU.LST

MENU.LST的内容如下:

timeout 300
default 0
gfxmenu /IDBC/GRUB/MESSAGE

title      【01】 从本地硬盘启动
set /a bn=%bn%+1
if "%bn%"=="1" && command /IDBC/GRUB/BOOTHARD
set sw=No
map --unmap=0xfe
checkrange 0x80 read 0x8280 && if exist (hd0)/fb.cfg && set sw=yes
checkrange 0x23 read 0x8280 && if not exist (fd0)/fb.cfg && set sw=yes
set /a hdn=*0x475&0xff
if %hdn%>=2 && if "%sw%"=="yes" && map (hd1) (hd0)  && map (hd0) (hd1)
map /IDBC/IMGS/BOOTFIX.ISO (0xfe) || map --mem /IDBC/IMGS/BOOTFIX.ISO (0xfe)
map --rehook
chainloader (0xfe)
boot

title      【02】 WIN8 PE标准版(新机器)
/IDBC/GRUB/RUN /PE/DBC8x86.ISO

title      【03】 WIN2003 PE经典版(老机器)
map --mem /PE/DBC2003.ISO (0xff)
map --e820cycles=0
map --hook
chainloader (0xff)

title      【04】 WIN2003 PE兼容版(老机器)
configfile /IDBC/GRUB/2003.LST

title      【05】 安装Linux系统
configfile /IDBC/GRUB/LINUX.LST

title      【06】 运行自定义映像
graphicsmode -1 640
font /IDBC/GRUB/MENU.HEX
/IDBC/GRUB/RUN --automenu-all /MYEXT/

title      【07】 其他工具
configfile /IDBC/GRUB/TOOLS.LST

title      【08】 关闭计算机
halt

由于增加了菜单,会导致界面冗长,所以我将不常用的菜单放到了子菜单里。

注意其中的其他工具和安装Linux系统这两个菜单,代码基本相同,都是指向一个子菜单,在/IDBC/GRUB/目录里,我新建了这两个子菜单,新建方法为复制里边随意一个菜单并重命名。

TOOLS.LST的内容如下:

timeout 300
default 0
gfxmenu /IDBC/GRUB/MESSAGE

title      【01】 DiskGenius 硬盘分区工具
map --unmap=0
terminal console
pause --wait=2 Loading DiskGenius ...
map --mem /IDBC/IMGS/DGDOS.LZMA (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)

title      【02】 Ghost 备份还原工具
map --unmap=0:0xfe   
configfile /IDBC/GRUB/GHOST.LST

title      【03】 MaxDos 工具箱
map --unmap=0
terminal console
pause --wait=2 Loading MaxDos ...
map --mem /IDBC/IMGS/DOS.LZMA (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)

title      【04】 硬盘/内存 检测工具
configfile /IDBC/GRUB/RAMHDD.LST

title      【05】 Windows 密码破解工具
configfile /IDBC/GRUB/PWD.LST

title      【06】 返回主菜单
configfile /IDBC/GRUB/MENU.LST

LINUX.LST的内容如下:

timeout 300
default 0
gfxmenu /IDBC/GRUB/MESSAGE

title      【01】 安装Mint Cinnamon
find --set-root /ISO/Mint-cinnamon/Mint-cinnamon.iso
kernel /ISO/Mint-cinnamon/vmlinuz boot=casper iso-scan/filename=/ISO/Mint-cinnamon/Mint-cinnamon.iso
initrd /ISO/Mint-cinnamon/initrd.lz
boot

title      【02】 安装Mint Mate
find --set-root /ISO/Mint-mate/Mint-mate.iso
kernel /ISO/Mint-mate/vmlinuz boot=casper iso-scan/filename=/ISO/Mint-mate/Mint-mate.iso
initrd /ISO/Mint-mate/initrd.lz
boot

title      【03】 安装Elementary OS
find --set-root /ISO/Elementary/Elementary.iso
kernel /ISO/Elementary/vmlinuz boot=casper iso-scan/filename=/ISO/Elementary/Elementary.iso
initrd /ISO/Elementary/initrd.lz
boot

title      【04】 安装Manjaro XFCE
find --set-root /ISO/Manjaro-xfce/Manjaro-xfce.iso
kernel /ISO/Manjaro-xfce/vmlinuz-x86_64 misolabel=Manjaro-xfce.iso img_dev=/dev/sdc1 img_loop=/ISO/Manjaro-xfce/Manjaro-xfce.iso
initrd /ISO/Manjaro-xfce/initramfs-x86_64.img
boot

title      【05】 返回主菜单
configfile /IDBC/GRUB/MENU.LST

最关键的就是LINUX.LST中的内容,这里定义了常用Linux发行版的引导代码。

最后在U盘根目录创建ISO文件夹,里边每个系统建一个文件夹,将ISO镜像文件放到创建的系统文件夹中,并将镜像中casper目录里的initrd.lz和vmlinuz文件解压出来。

以Mint Cinnamon为例,我将下载的ISO镜像重命名为Mint-cinnamon.iso放到了/ISO/Mint-cinnamon/目录里,并用解压工具将Mint-cinnamon.iso里casper目录下的initrd.lz和vmlinuz文件解压出来放到了/ISO/Mint-cinnamon/目录里。

修改电脑BIOS启动顺序,从U盘启动,就可以看到安装Linux系统菜单了,安装Windows系统的方法和以前一样。

阿里云