boot - How does the GRUB2 UEFI loader know where to look for the configuration file (or where the 2nd stage's files are located)? -


if use grub2 on gpt-enabled partition how loader "know" find configuration file , other 2nd stage's files?

note: found mentions config file located in same folder grub's efi loader , contains chained load of "primary" configuration file specified partition, not true - there 1 "something.efi" file.

there actual several ways can happen:

  • load embedded config file.
  • load config file in same directory grub binary.
  • load config file path decided @ grub-mkimage (called grub-install) execution time.

the latter functionality asking - , it's combination of default config file name (grub.cfg), prefix (default /boot/grub, can explicitly specified grub-mkimage) , grub partition name partition prefix located.

if run strings /boot/efi/efi/debian/grubx64.efi | tail -1 on current workstation, prints out stored value: (,gpt2)/boot/grub, telling grubx64.efi configuration file in /boot/grub on gpt partition 2. bit before comma (the grub disk device name) gets filled in @ runtime based on disk grubx64.efi image loaded from.

dynamically loaded modules searched under location, in architecture/platform-specific directory - in case /boot/grub/x86_64-efi.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -