nilsmeyer / ansible-debootstrap

An ansible role for bootstrapping new Debian based systems, including setting up partitions, file systems, encryption (luks), RAID and LVM
GNU Lesser General Public License v3.0
35 stars 19 forks source link

Efi support #17

Closed mvk15 closed 5 years ago

mvk15 commented 5 years ago

EFI support

  1. Check if a system uses EFI by checking the directory /sys/firmware/efi
  2. In the case of the system uses EFI checking that mount point /boot/efi is defined and fail role if is not defined
  3. Creating "vfat" file system on EFI partition and mount it to /boot/efi on a target
  4. Replace "grub-pc" by "grub-efi" before installing required packages on the target
nilsmeyer commented 5 years ago

This is good, however, I think EFI should be opt in for the user, there may be some platforms that advertise EFI support but don't really support it (well), I'm thinking virtual machines for example.

We could do that seamlessly by checking for an EFI partition and just proceed with regular grub if the user hasn't specified it, or use a parameter.

mvk15 commented 5 years ago

I thought about it and probably a good option will be adding some variable (for example "efi_system") with values "yes", "no" and "auto". By default can be "auto" for example. "yes" and "no" as force options.

BTW, Yesterday I was installing two servers with your role. And those servers support only EFI. As a result, added EFI support :)

mvk15 commented 5 years ago

Added boolean variable "use_efi" for enabling or disabling EFI support. "yes" - means auto. Force "yes" - doesn't make any sense because of on a system without EFI is possible to install "grub-efi" but it is broken anyway.

nilsmeyer commented 5 years ago

~I think you can even install both at the same time, the packages don't conflict. I'll give this a test later.~ Thank you for your work.

mvk15 commented 5 years ago

Unfortunately, they are conflicted:

# apt-get install grub-pc grub-efi
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 grub-efi : Depends: grub-efi-amd64 (= 2.02~beta3-5+deb9u1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
nilsmeyer commented 5 years ago

Interesting, I was thinking that works.

nilsmeyer commented 5 years ago

The only thing missing here is documentation for the use_efi variable, then it's good to merge.

mvk15 commented 5 years ago

Added description for use_efi option in documentation; removed a mention about UEFI in "Limitation" section; fixed formatting for some lines in "Global variables" section.