Summary: | sys-boot/grub-2 multiple platform support | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Benedikt Reinartz <filmor> |
Component: | New packages | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | aklhfex, akshayushah, amigadave, darkbasic, flow, ford_prefect, lephilousophe, o.freyermuth, panard, pemagongo |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Patch for the ebuild |
Description
Benedikt Reinartz
2010-03-07 21:32:47 UTC
*** Bug 308389 has been marked as a duplicate of this bug. *** i dont have any EFI systems, so i really have no way of testing things what exactly do you need changed in the ebuild ? --enable-efiemu ? Nope, it's "--with-platform=efi". The rest should be quite similar to the bios version. You make an grub.efi with grub-mkimage and toss it into your boot partitions /EFI directory together with modules and grub.cfg. i see that the platform option can actually support multiple things: pc, efi, coreboot, ieee1275, qemu, ... some of these make sense to have enabled in parallel. i wonder if we should make this into a USE_EXPANDED variable so that people could select multiple things at once. if the user hasnt selected any at all, then we'd default to both pc and efi on x86/x86_64 ... So, is there going to be such a use variable? The grub-2 ebuild is quite useless without it as grub-2 in this form is not really better than grub-1 on x86... ebuild updates dont appear out of thin air. someone has to do the work. Created attachment 230923 [details, diff]
Patch for the ebuild
Sorry, I didn't know if you were working on this. I don't know where you've read that one can use multiple platforms, the autoconf-script suggests that you can only have enabled one platform at a time. As the automatic works in most cases (and nobody complained yet) the only thing that needs to be added is an efi useflag, as on Intel Macs and other x86-EFI-environments the configure-scripts only sees the x86-part and chooses the bios-platform.
no, i havent been working on it. sorry if that wasnt clear. i was merely tossing out ideas. if we're going to spend time on this, i'd rather we fix it once and be done. unless i missed something, i believe x86 supports multiple targets (as i mentioned in comment #4). so we'd want to declare a new USE_EXPAND. let's go with: - USE_EXPAND variable name is GRUB_PLATFORMS - ebuild has IUSE_GRUB_PLATFORMS="coreboot efi emu ieee1275 pc qemu yeeloong" - if user hasnt selected any platforms, we default to all the valid values for the target cpu - src_compile does a for loop over the possible values and runs configure/make in a sep build dir with platform set for each enabled value - src_install does a for loop over the possible values and installs from the sep build dir for each enabled value i wont have time to implement this for a while. see the sandbox ebuild as an example of multiple configures+makes. I think it's starting to be quite important to support efi because sandy bridge motherboards use it. I have a Core i5 2500K with H67 chipset so I can test it if patches are proposed. (In reply to comment #8) > if we're going to spend time on this, i'd rather we fix it once and be done. > unless i missed something, i believe x86 supports multiple targets (as i > mentioned in comment #4). so we'd want to declare a new USE_EXPAND. AFAICT, grub2 does not support building multiple platforms. if multiple --with-patlform is given to configure script, the last one is chosen. so it looks like we don't need a USE_EXPAND As a quick workaround, copying the ebuild to a local overlay and adding "--with-platform=efi" manually worked perfectly. I can boot my P8P67 Deluxe fine with it, just copied over the efi-builds to the efi system partition, loaded once with efi-shell and used efibootmgr to add it to the bootup-options. Great working alternative to elilo, I mainly used this tutorial: http://grub.enbug.org/TestingOnUEFI (page currently offline, but available via Google Cache). Maybe the ebuild should also automate the copy-over part of the .efi-files to the correct directory and / or the efibootmgr-setup. (In reply to comment #10) you snipped a fairly important part of my comment #8 ... specifically, where i said "run a loop" which means "configure/compile grub multiple times; once for each requested platform" (In reply to comment #11) > As a quick workaround, copying the ebuild to a local overlay and adding > "--with-platform=efi" manually worked perfectly. > I can boot my P8P67 Deluxe fine with it, just copied over the efi-builds to the > efi system partition, loaded once with efi-shell and used efibootmgr to add it > to the bootup-options. > Great working alternative to elilo, I mainly used this tutorial: > http://grub.enbug.org/TestingOnUEFI (page currently offline, but available via > Google Cache). > Maybe the ebuild should also automate the copy-over part of the .efi-files to > the correct directory and / or the efibootmgr-setup. unfortunately the cache was cleaned up and the tut is gone... I tried the tut on https://wiki.archlinux.org/index.php/GRUB2#Bootloader_Installation_for_UEFI_systems but couldn't make it working yet... could you please somehow reproduce the how-to? The page is now conserved here (also as a reference on how to implement the new ebuild sometime): https://help.ubuntu.com/community/UEFIBooting (a copy of the original page) However, it mainly consists of the copy-over-part and on the generation of the correct partitions. To get your system to boot in UEFI-Mode once: Read the "Miscellaneous info"-section or use an UEFI-enabled linux-distribution (new Ubuntu Live CD might do the trick). This should then become a NOTICE in the ebuild. In long-term view, UEFI-booting should also be integrated in the Gentoo-Live oder Minimal CD. But I have not tested whether the IA64-disk already supports it (it might, for UEFI came here a lot earlier). This functionality is implemented in my dev overlay. Only thing that is lacking now is some detection script which platforms what cpu supports. (so we won't get configure/build failiures if user set stupid platforms to be enabled). It seems that the Grub ebuild in Scarabeus overlay is broken : the modules are stripped and they shouldn't be. I think there is a typo in -9999 and 1.99 ebuilds : the STRIP_MASK variable ends with a "a" and shouldn't. Applying this patch worked for me : --- a/sys-boot/grub/grub-1.99.ebuild +++ b/sys-boot/grub/grub-1.99.ebuild @@ -63,7 +63,7 @@ else DEPEND+=" app-arch/xz-utils" fi -export STRIP_MASK="*/grub/*/*.{mod,img}a" +export STRIP_MASK="*/grub/*/*.{mod,img}" QA_EXECSTACK=" lib64/grub/*/setjmp.mod lib64/grub/*/kernel.img In addition to the "a" in STRIP_MASK, I had to comment out the lines 227 and 228 in the 1.99 ebuild, to get grub emerged on a fresh stage3 install: 227 # grub_rename_files deep "${ED}"/usr/share/man/man1/ 228 # grub_rename_files deep "${ED}"/usr/share/man/man8/ But everything else worked and I am now able to boot via UEFI and grub on my X220. Added the grub with GRUB_PLATFORMS support into main tree. |