Fix groups, default in the main grub.cfg for netboot-grub
This commit is contained in:
parent
a26cb97933
commit
adf25f33cb
1 changed files with 63 additions and 0 deletions
63
roles/netboot-grub/templates/grub.cfg
Normal file
63
roles/netboot-grub/templates/grub.cfg
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
if [ x$net_efinet0_boot_file != x ]; then
|
||||||
|
set groupname=$net_efinet0_boot_file
|
||||||
|
elif [ x$net_efinet1_boot_file != x ]; then
|
||||||
|
set groupname=$net_efinet1_boot_file
|
||||||
|
elif [ x$net_efinet2_boot_file != x ]; then
|
||||||
|
set groupname=$net_efinet2_boot_file
|
||||||
|
elif [ x$net_pxe_boot_file != x ]; then
|
||||||
|
set groupname=$net_pxe_boot_file
|
||||||
|
else
|
||||||
|
set groupname=default
|
||||||
|
fi
|
||||||
|
# regexp -s 2:groupname (.*)/(.*)_(.*)_(.*) $net_pxe_boot_file
|
||||||
|
# regexp -s 3:architecture (.*)/(.*)_(.*)_(.*) $net_pxe_boot_file
|
||||||
|
# set fname=/grub/$groupname\_$architecture.cfg
|
||||||
|
# set arch_default=/grub/default_$architecture.cfg
|
||||||
|
|
||||||
|
export groupname
|
||||||
|
|
||||||
|
function load_video {
|
||||||
|
if [ x$feature_all_video_module = xy ]; then
|
||||||
|
insmod all_video
|
||||||
|
else
|
||||||
|
insmod efi_gop
|
||||||
|
insmod efi_uga
|
||||||
|
insmod ieee1275_fb
|
||||||
|
insmod vbe
|
||||||
|
insmod vga
|
||||||
|
insmod video_bochs
|
||||||
|
insmod video_cirrus
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#loadfont unicode
|
||||||
|
#load_video
|
||||||
|
#insmod gfxterm
|
||||||
|
#insmod gettext
|
||||||
|
#terminal_output gfxterm
|
||||||
|
#insmod png
|
||||||
|
#set color_highlight=white/red
|
||||||
|
#set color_normal=black/black
|
||||||
|
set menu_color_normal=white/black
|
||||||
|
set menu_color_highlight=white/cyan
|
||||||
|
if regexp ":" "${cmdpath}"; then
|
||||||
|
set root="http,{{ansible_default_ipv6.address}}"
|
||||||
|
set prefix="(http,{{ansible_default_ipv6.address}})/grub/"
|
||||||
|
set fname=/grub/configs/${net_default_ip}.cfg
|
||||||
|
else
|
||||||
|
set root="http,{{ansible_default_ipv4.address}}"
|
||||||
|
set prefix="(http,{{ansible_default_ipv4.address}})/grub/"
|
||||||
|
set fname=/grub/configs/${net_default_ip}.cfg
|
||||||
|
fi
|
||||||
|
|
||||||
|
set fname=/grub/by_mac/${net_default_mac}.cfg
|
||||||
|
if ! [ -s ${fname} ]; then
|
||||||
|
set fname=/grub/by_group/${groupname}.cfg
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [ -s ${fname} ]; then
|
||||||
|
set fname=/grub/common/default.cfg
|
||||||
|
fi
|
||||||
|
|
||||||
|
configfile ${fname}
|
Loading…
Add table
Add a link
Reference in a new issue