-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GRUB with non-/boot ESP #2015
Conversation
Nicely done, and clean fix. |
@Weissnix4711 apologies for the delay, unfortunately the PR conflicts with some other changes that got merged. Would you mind resolving the conflicts then I think it's good to go Also could you please run the flake8/mypy checks as these seem to fail |
Should be good now. 🤞 |
It is not; there are errors in the mypy check.
You have the function parameters |
@Weissnix4711 apologies for the delay in merging this. That way we can get this in for the next release due in a couple of days :) |
I merged the latest changes from master. If So I'm wondering if this makes more sense? f'--efi-directory={f"{efi_partition.mountpoint} " if efi_partition else f"{boot_partition.mountpoint}/efi"}'
f'--boot-directory={boot_partition.mountpoint} ' As I think boot_partition: disk.PartitionModification, |
(This will be the last planned PR before I release the new version) |
Yup. In this case grub-install defaults to Not sure if defaulting to |
Ah ok. We should probably set the boot directory explicitly anyway. The EFI I'm open for suggestions what the best sane place is. The |
The efi dir should really only be on some subdir of a suitable FAT32 partition. If efi_partition is None, that presumably means we found no suitable partition, so should error out or install only as legacy (i386-pc). At least that's my thinking. It is possible the system may support other filesystems beyond the scope of the UEFI spec, and so the user may wish to proceed with setting the efi directory to something 'weird', but I don't see an easy way of achieving this customisability. Also, the user will realistically run through the manual install process anyway. Keeping I will have it set boot_directory explicitly. |
As for typing fixes, I'm not 100% sure how to proceed. I'm not a python dev :) Logically, at least one of boot or efi dir must be passed to the I was originally hoping someone would just take over this PR for me lol |
Hehe, I can fix the typing stuff in a couple of hours :) As for all the other reasoning, I agree with it. I forgot this logic is specifically for EFI boot. And that we're really only need to consider that scenario :D |
I pushed the fixes for mypy and flake8 should be good now |
Awesome, I'm on my phone so hard to check. But could we add an exception if both boot and efi is none? :) |
@Torxed I don't think the boot partition can be none actually, we're doing a validation here https://github.com/Weissnix4711/archinstall/blob/e87bf500c30eff5277be8cb2373b045e6a0d3888/archinstall/lib/installer.py#L1128-L1128 before calling the grub bootloader installation so that wouldn't pass |
Fair enough, works for now. It's best to put a validation on the function performing the task tho since people might get creative and call the boot loader functions directly hehe. |
Yeah that's fair, however, the method header does specify the boot partition argument as a object type not an optional object. So it would be a user error if someone calls it with none :) |
Hi guys, Could you please tell me if this has been tested with luks (luks2) encryption e.g
Thanks EDIT : That does not work with encrypted or unencrypted root. I always end up with that error |
PR Description:
Changes
get_efi_partition()
logic to include partitions with ESP flag. Also had to changeget_boot_partition()
to prevent it returning the ESP even if that partition does not have the boot flag. Not that there currently is a way to set the ESP flag from the guided menu. But I hope that'll be added eventually.Grub can now use a custom boot directory with UEFI, though this is untested and probably should never be done. Will actually use the correct ESP mount path now, and will make the config to the correct location.
All untested. There's probably better ways to do this too, but I don't have time to faff about with this, so if someone could take over from here, please do.
Tests and Checks