|
本帖最后由 2013abcdefg 于 2021-5-9 10:02 编辑
wintoflash 大侠 Grub2_2.05 (2020.11.14) 全模块 .efi 怎么写GRUB.CFG
这些是做什么用的呢?
export pager=0;
cat --set=modlist ${prefix}/insmod.lst;
for module in ${modlist}; do
insmod ${module};
done;
if [ "${grub_platform}" = "efi" ]; then
getenv -t uint8 SecureBoot grub_secureboot;
if [ "${grub_secureboot}" = "1" ]; then
sbpolicy -i;
fi;
fi;
loadfont ${prefix}/fonts/unicode.pf2;
export enable_progress_indicator=0;
export locale_dir=${prefix}/locale;
export lang=zh_CN;
export gfxmode=1024x768;
export gfxpayload=keep;
export color_normal=white/black;
export color_highlight=black/white;
terminal_output gfxterm;
#### FUNCTION ####
function to_g4d_path {
unset g4d_path;
if regexp --set=1:num '^\(hd[0-9]+,[a-zA-Z]*([0-9]+)\).*' "${1}"; then
# (hdx,msdosy) (hdx,gpty) (hdx,y)
expr --set=num "${num} - 1";
regexp --set=1:path_1 --set=2:path_2 '^(\(hd[0-9]+,)[a-zA-Z]*[0-9]+(\).*)' "${1}";
set g4d_path="${path_1}${num}${path_2}";
elif regexp '^\([chf]d[0-9]*\).*' "${1}"; then
# (hd) (cd) (fd) (hdx) (cdx) (fdx)
set g4d_path="${1}";
fi;
}
menuentry "Load grubfm.cfg" {
configfile "${prefix}/grubfm.cfg";
}
|
|