I'd like some feedback before doing anything, so let me try to explain ...
= UEFI-FAT-boot-partition and /boot =
UEFI needs a FAT boot partition, but /boot contains a symlink (/boot/boot ->
/boot/.). FAT partitions cannot contain symlinks.
So I cannot mount the UEFI boot partition to /boot, the symlink would get lost
and thus legacy GRUB would not work out of the box.
= My current partitions =
When installing with the installer (with legacy bios and uefi support), I
currently create these partitions:
/dev/sda1 vfat on /boot/efi
/dev/sda2 ext2 on /boot
/dev/sda3 swap
/dev/sda4 ext4 on /
Legacy GRUB runs from /dev/sda2, where the kernel, etc. resides.
/dev/sda1 is the UEFI boot partition, with the GRUB-2 uefi image and menu.
== Drawbacks of this setup ==
1) 2 boot partitions
Needs 2 boot partitions where 1 might be sufficient
2) Complicated to manage.
Legacy grub from sda2 with kernel at sda2, but grub-2 from sda1 pointing to
same kernel at sda2.
3) Cannot boot kernel directly by UEFI
UEFI can boot the kernel directly, but it must be on the vfat UEFI boot
partition. So with the above layout, this means either:
- moving the kernel from sda2 to sda1; thus losing legacy grub-bios support.
- copying the kernel to sda2; leaving the user with 2 kernels to manage.
In both cases, genkernel might not be aware of the change afaik.
= Possible solutions =
== Remove that symlink ==
Afaik, that symlink is installed by grub-static.
Both legacy grub and grub-2 tend to search for their files at path /boot/grub
(resp. /boot/grub2) - the path being relative to the partition root.
So the symlink is most likely not really necessary, it just makes things easier
to handle (/boot/grub becomes identical both from the root of the partition as
well as for the OS).
== Migrate to GRUB-2 ==
We could also ditch legacy grub altogether and relay on grub-2 both for bios
and uefi booting. Configuring grub-2 is a pain, but having one bootloader only
is tempting.
= Sidenote: Fix/remove grub partition detection in the installer =
Partition detection by the installer is useless/wrong imho. When booting from
an usb stick, grub sees that usb disk as hd0 - the installer tries to be smart
and suggests hd1 or hd2.
= What do you think? =
I'd like to hear your thoughts before doing anything on this.
grub-static is in the gentoo tree with a mod at pentoo repo - shall I fiddle
with that and we'll manage 2 bootloaders for a while?
The code in the pentoo-installer for legacy grub is not so easy - but looking
at the above sidenote I'd like to touch it anyway someday.
Or shall we move forward to the pain of grub-2 and dump legacy grub?
Original issue reported on code.google.com by Wuod...@gmail.com on 24 Dec 2012 at 10:34
Original issue reported on code.google.com by
Wuod...@gmail.com
on 24 Dec 2012 at 10:34