Jump to content

[Armbian build PR] - grub: remove unnecessary config


Recommended Posts

Posted

Description

/boot/efi/EFI/BOOT/grub.cfg is used to location /boot/grub/grub.cfg. But it seem like that we don't need to generate it manually.

Here I use amd64 for example. arm64 should be same.

If we use grub-efi-amd64-bin, grub-install will embed prefix in core.img which will be copied to /boot/efi/EFI/BOOT/BOOTX64.efi. We can confirm in output/debug/install.log

grub-install: info: grub-mkimage --directory '/usr/lib/grub/i386-pc' --prefix '(,gpt1)/boot/grub' --output '/boot/grub/i386-pc/core.img'  --dtb '' --format 'i386-pc' --compression 'auto'  'ext2' 'part_gpt' 'biosdisk' 
...
grub-install: info: copying `/boot/grub/x86_64-efi/core.efi' -> `/boot/efi/EFI/BOOT/BOOTX64.EFI'.

If we use grub-efi-amd64-signed, grub-install will generate load.cfg to location the true configfile, which the same thing we do. We can confirm in output/debug/install.log

grub-install: info: grub-mkimage --directory '/usr/lib/grub/x86_64-efi' --prefix '' --output '/boot/grub/x86_64-efi/grub.efi'  --dtb '' --format 'x86_64-efi' --compression 'auto'  --config '/boot/grub/x86_64-efi/load.cfg' 'ext2' 'part_gpt' 'search_fs_uuid' 
...
grub-install: info: copying `/usr/lib/grub/x86_64-efi-signed/gcdx64.efi.signed' -> `/boot/efi/EFI/BOOT/BOOTX64.EFI'.
grub-install: info: copying `/boot/grub/x86_64-efi/load.cfg' -> `/boot/efi/EFI/BOOT/grub.cfg'.

So this configfile is unnecessary.

What's more, if we need boot partition (i.e. cryptroot), the path in it was incorrent. The first partition is /boot, so prefix will become /boot/boot/grub which is incorrent.

So just let grub-install to do this job.

How Has This Been Tested?

  • [X] uefi-x64
  • [ ] uefi-arm

Checklist:

  • [ ] My code follows the style guidelines of this project
  • [X] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [X] My changes generate no new warnings
  • [ ] Any dependent changes have been merged and published in downstream modules

View the full article

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines