Skip to content

Commit

Permalink
. 使用 "./build i386" 编译 BOOTIA32.EFI。
Browse files Browse the repository at this point in the history
  • Loading branch information
yaya committed Dec 10, 2020
1 parent 3f14993 commit a799a32
Show file tree
Hide file tree
Showing 13 changed files with 1,709 additions and 242 deletions.
5 changes: 5 additions & 0 deletions ChangeLog_UEFI.txt
@@ -1,4 +1,9 @@
更新说明:
2020-12-10 (yaya)
使用 "./build i386" 编译 BOOTIA32.EFI 。
可以使用参数 "--top" 将镜像强制加载到 4Gb 以上内存。
修正字符串颜色显示,修正映射磁盘读写。

2020-11-26 (yaya)
合并 i386 与 x86_64 源代码。
修正 hotkey 及 exit_g4d 函数。
Expand Down
33 changes: 32 additions & 1 deletion build
Expand Up @@ -8,6 +8,14 @@
# ./build
#此时在根目录 /home/dev/grub4efi

#使用“./build i386”编译BOOTIA32.EFI
#使用“./build”或者"make"编译BOOTX64.EFI
if [ $1 = i386 ]; then
I386=1
else
I386=0
fi

#源目录
SOURCE_DIR=`pwd`
#版本
Expand Down Expand Up @@ -71,6 +79,13 @@ fi
#转到 GRUB4DOS_TEMP 目录
cd ${GRUB4DOS_TEMP} || exit $?

#编译切换
if [ $I386 = 1 ]; then
mv stage2/Makefile.in stage2/Makefile.in-64
mv stage2/Makefile.in-i386 stage2/Makefile.in
echo 1
fi

#生成 Get_Source_of_This_Build.txt 文件
if [ "$Get_source" ]; then
echo -n -e "Get the source code of this build in this way:\r\n\r\n${Get_source}" > Get_Source_of_This_Build.txt
Expand Down Expand Up @@ -156,12 +171,22 @@ make || exit $?
cp stage2/pre_stage2.exec $GRUB4DOS_TEMP/kernel.img
cp $SOURCE_DIR/moddep.lst $GRUB4DOS_TEMP/moddep.lst
platform=`uname -m`
if ! [ $I386 = 1 ]; then
if [ $platform = 'x86_64' ]
then
$SOURCE_DIR/grub-mkimage64 -d $GRUB4DOS_TEMP -p /GRUB2 -o BOOTX64.EFI -O x86_64-efi
else
$SOURCE_DIR/grub-mkimage -d $GRUB4DOS_TEMP -p /GRUB2 -o BOOTX64.EFI -O x86_64-efi
fi
else
echo 3
if [ $platform = 'x86_64' ]
then
$SOURCE_DIR/grub-mkimage64 -d $GRUB4DOS_TEMP -p /GRUB2 -o BOOTIA32.EFI -O i386-efi
else
$SOURCE_DIR/grub-mkimage -d $GRUB4DOS_TEMP -p /GRUB2 -o BOOTIA32.EFI -O i386-efi
fi
fi
#转到源目录
cd $SOURCE_DIR
#$SOURCE_DIR/grub-mkimage -d $SOURCE_DIR -p /GRUB2 -o BOOTX64.EFI -O x86_64-efi
Expand All @@ -179,11 +204,17 @@ cd $SOURCE_DIR
#fi

rm -f ${RELEASE}.zip ${RELEASE}.rar ${RELEASE}.tar.gz || exit $?
if ! [ $I386 = 1 ]; then
if ! 7z a ${RELEASE}.7z ${GRUB4DOS_TEMP}/BOOTX64.EFI $SOURCE_DIR/ChangeLog_UEFI.txt $SOURCE_DIR/menu.lst \
${GRUB4DOS_TEMP}/Get_Source_of_This_Build.txt ${GRUB4DOS_TEMP}/grub4dos_${CURR_REVISION}.diff; then
echo 7z failed. Continue with zip or tar...
fi

else
if ! 7z a ${RELEASE}.7z ${GRUB4DOS_TEMP}/BOOTIA32.EFI $SOURCE_DIR/ChangeLog_UEFI.txt $SOURCE_DIR/menu.lst \
${GRUB4DOS_TEMP}/Get_Source_of_This_Build.txt ${GRUB4DOS_TEMP}/grub4dos_${CURR_REVISION}.diff; then
echo 7z failed. Continue with zip or tar...
fi
fi

#删除*.zip *.7z *~
#rm -rf *.zip *.7z *~ || exit $?
Expand Down
27 changes: 13 additions & 14 deletions menu.lst
Expand Up @@ -10,30 +10,29 @@ timeout 30
#设置第一项为默认值
default 1

#设置字符颜色(高32位是背景色,低32位是前景色)
color normal=0xff9933 highlight=0xffff00 helptext=0xff00ff heading=0x66ff00
#设置字符颜色(高32位是背景色,低32位是前景色。在命令行执行:echo -rrggbb,可查看对应的颜色。)
#color normal=0xff9933 highlight=0xffff00 helptext=0xff00ff heading=0x66ff00

#设置图形模式(可使用 graphicsmode 探测系统支持的图形模式)
graphicsmode -1 800

#graphicsmode -1 800(水平像素)
#加载背景图
splashimage /efi/grub/splashimage.jpg || splashimage /boot/grub/splashimage.bmp

#加载字体(如果不是 16*16 字体,需增加参数,如 --font-high=24)
font /efi/grub/unifont.hex.gz
#splashimage /efi/grub/splashimage.jpg || splashimage /boot/grub/splashimage.bmp
#加载unifont字体(如果不是 16*16 字体,需增加参数,如 --font-high=24)
#font /efi/grub/unifont.hex.gz

#设置菜单框
setmenu --box x=4 w=60 y=6 h=9 l=2
#setmenu --box x=4 w=60 y=6 h=9 l=2
#设置中文菜单按键帮助
setmenu --lang=zh
#setmenu --lang=zh
#设置自动菜单编号
setmenu --auto-num-on
#setmenu --auto-num-on
#设置字符串信息
setmenu --string=80=2=0x0000000000ffff="G4D 维 护 菜 单"
#setmenu --string=x=y=颜色="字符串"
#设置日期时间
#setmenu --string=s=1=0x8800000000ffff="date&time=yyyy-MM-dd HH:mm:ss"
#setmenu --string=x=y=颜色="date&time=yyyy-MM-dd HH:mm:ss"
#设置倒计时
setmenu --timeout=90=2=0x88000000ffff
#setmenu --timeout=x=y=颜色
#更多菜单编辑功能、动画、图像菜单等等,可参考http://bbs.wuyou.net/forum.php?mod=viewthread&tid=369720&extra=page%3D3

title 启动 efi 文件
chainloader /efi/boot/grub2x64.efi
Expand Down

0 comments on commit a799a32

Please sign in to comment.