archlinux / archinstall

Arch Linux installer - guided, templates etc.
GNU General Public License v3.0
5.84k stars 508 forks source link

Bad grub configuration for /efi or /boot/efi partitions #2428

Open HanM23 opened 3 months ago

HanM23 commented 3 months ago

I do not understand the fix #2048
It will put grub.cfginto /boot/efi/grub if we use /boot/efi as esp partition OR into /efi/grub if we use /efias esp partition

boot_dir = Path('/boot')

boot_dir_arg = []
            if boot_partition.mountpoint and boot_partition.mountpoint != boot_dir:
                boot_dir_arg.append(f'--boot-directory={boot_partition.mountpoint}')
                boot_dir = boot_partition.mountpoint

Indeed, either we use /efi (new style) or /boot/efi (old style) as esp partition, grub.cfg, grubenv, fonts, locales and so on should not be in this partition.

It causes issue with btrfs snapshot for instance if you want to do a restore. All thoses files should be located in the /boot/grub FOLDER inside the root filesystem.

Onlybootx64.efi or/and grubx64.efi should be inside the esp partition.

NB: also, permissions of folder (e.g. the mounpoint) in esp partition must be drwx------ and not drwxr-xr-x

p2world commented 3 months ago

I have meet the same issue, when use /efi as ESP, will exec grub-mkconfig -o /efi/grub/grub.cfg, this will cause 2 issues:

  1. There is no /efi/grub directory in the ESP.
  2. Grub will try to load /boot/grub/grub.cfg so it won't boot archlinux.
codefiles commented 3 months ago

@HanM23

Indeed, either we use /efi (new style) or /boot/efi (old style) as esp partition, grub.cfg, grubenv, fonts, locales and so on should not be in this partition.

It causes issue with btrfs snapshot for instance if you want to do a restore. All thoses files should be located in the /boot/grub FOLDER inside the root filesystem.

What if the user chooses to encrypt the root file system? This would be problematic because archinstall supports encrypting the root file system but not /boot (see #1271).

@p2world, duplicate of #2372

HanM23 commented 3 months ago

What if the user chooses to encrypt the root file system? This would be problematic because archinstall supports encrypting the root file system but not /boot (see #1271).

This is the problem indeed if the installer does not support /boot encryption, it should, hopefully soon.

codefiles commented 3 months ago

Right. It can be done, it just is not there yet.