Sample Header Ad - 728x90

What's missing in my grub2 configuration for PxE

1 vote
1 answer
10011 views
I'm trying to automate the installation of physical servers using PxE. In this case I'm installing Oracle Virtual Servers (OVS for short, RHEL/Centos-like systems with Xen and custom linux kernel). I followed the steps outlined in the official documentation and implemented them using ansible. To summarize I took in account some important notes: - I'm using version 3.4.2 so I'm building my own boot loader for UEFI-based PXE clients. - I'm using Oracle Linux 7.3 since it provides the grub2-tools package that is required to build the GRUB2 boot loader. With ansible I configured my tftp, dhcp and http servers (for simplicity all of them in the same box) which all seem to be working as expected (tested downloading files and IP assignment and everything works). Here is how I'm building the boot loader $ grub2-mkimage -p '(tftp,)' -O x86_64-efi -d -c -o /core.efi Here is the current state of my grub2.cfg file: set timeout=60 # Load modules insmod net insmod efinet insmod tftp insmod gzio insmod part_gpt insmod efi_gop insmod efi_uga insmod video_bochs insmod video_cirrus insmod all_video insmod ext2 insmod multiboot2 insmod normal menuentry 'Install Oracle VM Server 3.4.2' --class fedora --class gnu-linux --class gnu --class os { # dhcp, tftp server in my network set net_default_server= # This is for testing echo 'Network status: ' net_ls_addr net_ls_routes echo 'Loading Xen...' multiboot2 /isolinux/xen.gz dom0_mem=max:11582M dom0_max_vcpus=20 noreboot echo 'Loading Linux Kernel...' module2 /isolinux/vmlinuz ip=dhcp vlanid= repo=http:///pxelinux/ISOs/OVS3.4.2 ks=http:///pxelinux/kickstart/ovs-3.4.2.ks ksdevice= echo 'Loading initrd...' module2 /isolinux/initrd.img } The server boots properly, the IP is being set, both the core.efi image and the grub2.cfg file are being downloaded from the tftp server and I get the "Welcome to Grub!" message but just when it should run what's configured in the grub2.cfg file this happens: //Start PXE Over IPv4 Station IP Address is X.X.X.X Server IP Address is X.X.X.X NBP filename is /boot/grub2/core.efi NBP filesize is 397824 Bytes Downloading NBP file... Succeed to download NBP file. Downloading NBP file... Succeed to download NBP file. Welcome to GRUB! Unknown command 'menuentry'. Unknown command '#'. Unknown command '#'. Unknown command 'echo'. efinet0 efinet0:local / efinet0 efinet0:default 0.0.0.0/0 gw Unknown command 'echo'. Unknown command 'echo'. Unknown command 'echo'. Unknown command '}'. And finally I'm directed to the grub prompt, where I can type all the commands in the grub2.cfg file correctly and actually boot and install my system with kickstart. So I'm guessing I'm missing something in the grub2 image creation because it's like some modules are not being imported before running the grub2.cfg file?? Only certain commands are being run, the rest are "Unknown".
Asked by Nocturn (153 rep)
Sep 8, 2017, 05:38 PM
Last activity: Sep 15, 2017, 04:21 PM