Hi, Well, first let me say that the CentOS version has it also hardcoded and loads the grub.conf anyway (from fw_path, I suppose). Second grub-mkimage requires the prefix to be set, that's where it is 'hardcoded'. You cannot run it without specifying -p. So how can I _not_ set it?
Uli Andrei Borzenkov <[email protected]> schrieb am Mo., 19. Juni 2023, 20:36: > On 19.06.2023 19:44, Ulrich Sibiller wrote: > > Hello, > > > > what exactly does "built to include networking support" mean here? > > This non-working bootx64.efi includes many network modules, which can > > be included using grub-mkimage (see also > > > https://github.com/PartialVolume/shredos.x86_64/issues/147#issuecomment-1593733621 > ): > > ... > > grub-mkimage: info: writing 704 bytes of a fixup block starting at > 0x10000. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/terminal.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/gettext.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/bufio.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/boot.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/datetime.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/priority_queue.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/net.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/crypto.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/extcmd.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/normal.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/mmap.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/video.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/relocator.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/linux.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/video_fb.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/video_bochs.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/video_cirrus.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/efi_gop.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/efi_uga.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/all_video.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/archelp.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/newc.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/efinet.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/tftp.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/gcry_crc.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/gzio.mod. > > grub-mkimage: info: reading /usr/lib/grub/x86_64-efi/part_gpt.mod. > > grub-mkimage: info: kernel_img=0x7fd6d998b010, kernel_size=0x1c000. > > grub-mkimage: info: the core size is 0xa03d0. > > grub-mkimage: info: writing 0xa3000 bytes. > > > > But even with them included the grub.conf is only loaded from the > > provided prefix (-p option of grub-mkimage) /EFI/BOOT. So what's > > missing? > > > > If you hardcode prefix path into core.efi, why are you surprised that > core.efi is using this prefix? Any autodetection relies on the fact that > prefix is *not* hardcoded. > > > If you run "make menuconfig in buildroot there's not much to select for > grub2: > > [*] grub2 > > Platform > > (i386-pc) ---> > > (hd0,msdos1) > > boot partition > > (boot linux ext2 > > fat squash4 part_msdos part_gpt normal biosdisk progress) builtin > > modules > > () builtin > config > > [*] install > tools > > > > > > > > Uli > > > > On Mon, Jun 19, 2023 at 4:06 PM Andrei Borzenkov <[email protected]> > wrote: > >> > >> On 19.06.2023 12:46, Ulrich Sibiller wrote: > >>> Hello, > >>> > >>> I am wondering where grub is supposed to look for grub.cfg when booted > >>> via PXE as grubx64.efi (or bootx64.efi)? > >>> > >>> Background: I have been playing around with running shredos > >>> (https://github.com/PartialVolume/shredos.x86_64) over the network via > >>> PXE. I failed with the bootx64.efi (which is grub2) coming with > >>> shredos because it does not find grub.conf when booted via PXE/tftp. > >>> It just checks /EFI/BOOT/grub.conf in this case. The grub in shredos > >>> is built via GNU's buildroot using the official grub sources. > >>> > >>> So I tried with grubx64.efi as delivered by Centos7 and succeeded. > >>> This grubx64.efi loads grub.conf - amongst other locations - from the > >>> same path where the .efi file has been found: > >>> > >>> Jun 15 14:10:33 server in.tftpd[31076]: RRQ from 192.168.11.15 > >>> filename cluster/shredos/bootx64.efi > >>> Jun 15 14:10:33 server in.tftpd[31076]: Client 192.168.11.15 finished > >>> cluster/shredos/bootx64.efi > >>> ... > >>> Jun 15 14:10:40 server in.tftpd[31097]: RRQ from 192.168.11.15 > >>> filename cluster/shredos/grub.cfg > >>> Jun 15 14:10:40 server in.tftpd[31097]: Client 192.168.11.15 finished > >>> cluster/shredos/grub.cfg > >>> > >>> I think that the centos7 build works because it is patched to check > >>> the fw_path variable. The official sources seem to not contain fw_path > >>> at all. > >>> > >>> (if you want to know more details all this is described in some length > >>> at https://github.com/PartialVolume/shredos.x86_64/issues/147) > >>> > >>> So is there a way to make the official grub look for grub.conf at the > >>> same dir as the efi file when booting via PXE? > >>> > >> > >> That is exactly what the official grub does when booted via PXE - as > >> long as it was built to include networking support in the first place. > >> And if $prefix is not hardcoded in core.efi. Without knowing how your > >> grub binary is built it is hard to guess what could be wrong. > >> > >
