Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVE] EFI, GRUB2 and other confusions
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Wed Aug 28, 2013 6:48 am    Post subject: [SOLVE] EFI, GRUB2 and other confusions Reply with quote

Hello there,
I just got a new laptop and I'm trying to get Gentoo in it. However, it has this UEFI thing and I can't quite figure out what I'm doing.

- I am using SystemRescueCD which manages to successfully boot using EFI (drawback is that I cannot connect to the internet with it, for some reason...).
- The first partition in my hard driver was created using gdisk and it is of the type EF00
- I downloaded, configured and compiled the kernel, gentoo-3.9.10.
- I emerged and compiled GRUB2
- I did this:
Code:
grub2-install --target=x86_64-efi --root-directory=/boot/ --boot-directory=/boot/efi/ --bootloader-id=GRUB2 --no-floppy

as explained in this guide.
- then I ran "make install" to get the kernel in /boot.
- and then grub2-mkconfig, which seems to properly find the kernel in /boot

I reboot and I am met with GRUB2 and a command line, not a menu. It is okay, I try then:
Code:
grub> linux /vmlinuz root=/dev/sdaX
grub> boot

And then I get the "blind mode" error, and I end up without booting messages or console or anything. I am not sure if I need to do anything special. Do I need initramfs? I was using it in my previous installation for fbcon stuffs, but turned off now. Do I need to have the kernel as efi also? How do I do that? I find the information about this subject very very very confusing =S Can I just ignore the EFI and keep using normal GRUB2 MBR boot? How do I do that?

Thanks in advance!
_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)


Last edited by Holysword on Thu Sep 05, 2013 5:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
renegart
Tux's lil' helper
Tux's lil' helper


Joined: 30 Oct 2012
Posts: 122

PostPosted: Wed Aug 28, 2013 8:45 am    Post subject: Re: EFI, GRUB2 and other confusions Reply with quote

Holysword wrote:
Hello there,
I just got a new laptop and I'm trying to get Gentoo in it. However, it has this UEFI thing and I can't quite figure out what I'm doing.

- I am using SystemRescueCD which manages to successfully boot using EFI (drawback is that I cannot connect to the internet with it, for some reason...).
- The first partition in my hard driver was created using gdisk and it is of the type EF00
- I downloaded, configured and compiled the kernel, gentoo-3.9.10.
- I emerged and compiled GRUB2
- I did this:
Code:
grub2-install --target=x86_64-efi --root-directory=/boot/ --boot-directory=/boot/efi/ --bootloader-id=GRUB2 --no-floppy

as explained in this guide.
- then I ran "make install" to get the kernel in /boot.
- and then grub2-mkconfig, which seems to properly find the kernel in /boot

I reboot and I am met with GRUB2 and a command line, not a menu. It is okay, I try then:
Code:
grub> linux /vmlinuz root=/dev/sdaX
grub> boot

And then I get the "blind mode" error, and I end up without booting messages or console or anything. I am not sure if I need to do anything special. Do I need initramfs? I was using it in my previous installation for fbcon stuffs, but turned off now. Do I need to have the kernel as efi also? How do I do that? I find the information about this subject very very very confusing =S Can I just ignore the EFI and keep using normal GRUB2 MBR boot? How do I do that?

Thanks in advance!


I've installed Gentoo on two systems with EFI right now. The HowTos are ok, but sometimes a little bit outdated.
Because you have booted your system with 'SystemRescueCD' your (running) kernel is aware of EFI and you can install grub2 simply with:
Code:
grub2-install /dev/sda

to the master boot record. It will also takes care that a EFI boot entry is created as long as you have 'efibootmgr' installed before.

Regarding your blank console, check your kernel config that you have enabled the "EFI-based Framebuffer support (CONFIG_FB_EFI)' in addition to your other prefered console frame buffer.
Back to top
View user's profile Send private message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Wed Aug 28, 2013 1:20 pm    Post subject: Re: EFI, GRUB2 and other confusions Reply with quote

renegart wrote:
I've installed Gentoo on two systems with EFI right now. The HowTos are ok, but sometimes a little bit outdated.
Because you have booted your system with 'SystemRescueCD' your (running) kernel is aware of EFI and you can install grub2 simply with:
Code:
grub2-install /dev/sda

to the master boot record. It will also takes care that a EFI boot entry is created as long as you have 'efibootmgr' installed before.

Regarding your blank console, check your kernel config that you have enabled the "EFI-based Framebuffer support (CONFIG_FB_EFI)' in addition to your other prefered console frame buffer.

Thank you for your reply.
I have CONFIG_FB_EFI enabled, still not console. Also, do I HAVE to use grub2-install /dev/sda or if I use the command that I used I should still get the same result?

Which HowTo you used that worked correctly? I think are more things I am missing since my GRUB doesn't even show me a list of kernels to boot from (it just returns the command line).
_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Wed Aug 28, 2013 2:57 pm    Post subject: Reply with quote

Hello,
I just come to install Grub2-efi Amd64 for Gentoo. I actually use Debian Grub2-efi for Amd64. There is no --root-directory and --no-floppy options of grub2-install for Gentoo. I think your command line should be, including options not mandatory
Code:
grub2-install --target=x86_64-efi --boot-directory=/boot/grub2 --efi-directory=/boot/efi --bootloader-id=GRUB2 --recheck /dev/sda


This should install Grub2-efi in your EFI partition. If this partition is not in /dev/sda, you should change this target for the good hard disk one. Maybe it' not mandatory, because the UEFI firmware use the EFI System partition to load Grub.

Before executing this command you should have bind the /dev, /proc and /sys directories of SystemRescueCD host to the same directories under the mount point of your Gentoo installation. For example
Code:
mount -o bind /dev /mnt/gentoo/dev
mount -o bind /proc /mnt/gentoo/proc
mount -o bind /sys /mnt/gentoo/sys

Than pass in chroot in that mount point
Code:
HOME=/root SHELL=/bin/bash USER=root  chroot /mnt/gentoo

From there, you must mount your /boot partition if you have one and the /boot/efi partition, already formated in Fat. The /boot/efi partition can be a flash drive.

If you make a search with the keywords grub and efi on the Internet, your will find several wikis on the subject.
_________________
Paul
Back to top
View user's profile Send private message
renegart
Tux's lil' helper
Tux's lil' helper


Joined: 30 Oct 2012
Posts: 122

PostPosted: Wed Aug 28, 2013 9:21 pm    Post subject: Reply with quote

try 'grub2-install --target=x86_64-efi --efi-directory=/boot/efi --boot-directory=/boot'. Otherwise the grub files will be installed into the wrong directory.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Wed Aug 28, 2013 11:02 pm    Post subject: Reply with quote

The default is --boot-directory=/boot/grub2 .
_________________
Paul
Back to top
View user's profile Send private message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Thu Aug 29, 2013 2:51 am    Post subject: Reply with quote

renegart wrote:
try 'grub2-install --target=x86_64-efi --efi-directory=/boot/efi --boot-directory=/boot'. Otherwise the grub files will be installed into the wrong directory.

Logicien wrote:
The default is --boot-directory=/boot/grub2 .

Thank you both for your suggestion.
I had no problems installing GRUB and the command I mentioned seems to work fine without errors. I get GRUB2 being booted automagically when I reboot, but GRUB2 is unable to find any kernel to boot, thus I have to do it manually.

I installed my kernel manually with efibootmgr and it boots fine. The only problem is that its not the first option in the list, so I always have to quickly press ESC to get the option to choose the vmlinuz.efi file manually.
_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Back to top
View user's profile Send private message
imaginasys
Tux's lil' helper
Tux's lil' helper


Joined: 26 Dec 2009
Posts: 83
Location: Québec

PostPosted: Thu Aug 29, 2013 5:45 am    Post subject: Reply with quote

Aren't you supposed to have 2 efi partition:
#1 type EF00 EFI BOOT (formatted VFAT) mounted on /boot/efi (recommanded size 512MB)
#2 type EF02 EFI BIOS (formatted VFAT) no mounted usually sized 32MB.

And then a boot partition :
#3 type 8300 /boot formatted EXT2

After that the other OS partitions.

The documentations is often outdated and not clear about this .

?????

Regards,
BT :mrgreen:
Back to top
View user's profile Send private message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Thu Aug 29, 2013 6:23 am    Post subject: Reply with quote

imaginasys wrote:
Aren't you supposed to have 2 efi partition:
#1 type EF00 EFI BOOT (formatted VFAT) mounted on /boot/efi (recommanded size 512MB)
#2 type EF02 EFI BIOS (formatted VFAT) no mounted usually sized 32MB.

And then a boot partition :
#3 type 8300 /boot formatted EXT2

After that the other OS partitions.

The documentations is often outdated and not clear about this .

?????

Regards,
BT :mrgreen:

If I am supposed to, then I'm doing it wrong because I have 1 EF00 partition which has 100MB and no EXT2 partition. I won't need dual-boot btw.
_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Back to top
View user's profile Send private message
renegart
Tux's lil' helper
Tux's lil' helper


Joined: 30 Oct 2012
Posts: 122

PostPosted: Thu Aug 29, 2013 10:04 am    Post subject: Reply with quote

Holysword wrote:
renegart wrote:
try 'grub2-install --target=x86_64-efi --efi-directory=/boot/efi --boot-directory=/boot'. Otherwise the grub files will be installed into the wrong directory.

Logicien wrote:
The default is --boot-directory=/boot/grub2 .

Thank you both for your suggestion.
I had no problems installing GRUB and the command I mentioned seems to work fine without errors. I get GRUB2 being booted automagically when I reboot, but GRUB2 is unable to find any kernel to boot, thus I have to do it manually.


Because grub does not find its files. How does your '/boot' directory looks like?
You need there at least two sub directories:
* efi - EFI partition
* grub2 - grub files with several sub-directories for efi boot + grub.cfg

'grub2-install' creates the 'grub2' directory as subdirectory of --boot-directory and copies all files which are needed during boot.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Thu Aug 29, 2013 12:14 pm    Post subject: Reply with quote

The --boot-directory= option tell grub2-install to write everething needed in this directory to complete it's load at boot time. At the same time, it write the Grub2 UEFI executable in the /boot/efi subdirectory. This executable is the one that the UEFI firmware will load. Than Grub2 will look in the /boot/grub2 directory.

One question is if you have a boot partition, like a flashdrive mounted in /boot, you must link the root directory of it with boot when the --boot-directory=/boot/grub2 option is used:
Code:
cd /boot
ln -s . boot

Than Grub2 will be able to look in the /boot/grub2 and not only in the /grub2 directory after it have mounted the partition.

An other question is did you create a /boot/grub2/grub.cfg file using the command
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg

The grub2-install command do not create this file according with the bash scripts marked as executables in the /etc/grub.d directory. This directory can be personnalize, but it's default should be able to create a /boot/grub2/grub.cfg file that will give you a bootable entry for your kernel in the menu of Grub2. You can create your own entries and configuration setup in the 40_custom file.

Without the file /boot/grub2/grub.cfg that Grub2 can correctly parse, Grub2 have no menu and configuration and can only give you it's prompt. Note that have haven't use Gentoo Grub2 a lot. The file name needed can be grub2.cfg.
_________________
Paul
Back to top
View user's profile Send private message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Thu Aug 29, 2013 5:57 pm    Post subject: Reply with quote

renegart wrote:
Because grub does not find its files. How does your '/boot' directory looks like?
You need there at least two sub directories:
* efi - EFI partition
* grub2 - grub files with several sub-directories for efi boot + grub.cfg

'grub2-install' creates the 'grub2' directory as subdirectory of --boot-directory and copies all files which are needed during boot.

Logicien wrote:
One question is if you have a boot partition, like a flashdrive mounted in /boot, you must link the root directory of it with boot when the --boot-directory=/boot/grub2 option is used:
Κώδικας:
Code:
cd /boot
ln -s . boot


Than Grub2 will be able to look in the /boot/grub2 and not only in the /grub2 directory after it have mounted the partition.

I think we are having some misunderstanding here. I have one EF00 partition (with vfat) and everything else is ext4. I do not have one ext2 partition. Can I even create symbolic links in vfat partitions?! No guide I have found so far mentioned the need to create a boot ext2 partition in addition to the EF00 one:
http://wiki.gentoo.org/wiki/UEFI_Gentoo_Quick_Install_Guide
http://wiki.gentoo.org/wiki/EFI_stub_kernel
https://forums.gentoo.org/viewtopic-p-7011836.html

My EF00 partition (/dev/sda1) is normally mounted in /boot. I don't have access to that machine now, but I'm pretty sure that it contains the subdirectory efi, and inside efi, a grub2 directory.
I am going to post again once I have access.
_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Back to top
View user's profile Send private message
renegart
Tux's lil' helper
Tux's lil' helper


Joined: 30 Oct 2012
Posts: 122

PostPosted: Thu Aug 29, 2013 6:44 pm    Post subject: Reply with quote

On my ultrabook I've also just two partitions.
A EFI partition and my system partition.
The EFI partition is mounted directly at /boot and contains 'EFI' and 'grub2' as sub directories.

'EFI' contains the boot entry with the "stage1" bootloader.
'grub2' contains the "stage2" files and 'grub.cfg'

Code:
/boot [mount point EFI-Partition]
        /EFI 
            /Boot/bootx64.efi
            /gentoo/grubx64.efi
        /grub2
            /fonts
            /locale
            /themes
            /x86_64-efi
            /grub.cfg
            /grubenv
       {kernel-files}

The grub install command is:
Code:
grub2-install --target=x86_64-efi --efi-directory=/boot --boot-directory=/boot


At my desktop PC I've the same layout (+ Windows System parition) and the EFI partition is mounted at '/boot/efi' and contains 'EFI' subdirectory with boot entries and 'stage1' boot loaders.

The grub2 'stage2' files and 'grub.cfg' are also stored at '/boot/grub2'.

Code:
/boot
        /efi [mount point EFI-Partition]
            /EFI
                 /Boot/bootx64.efi
                 /gentoo/grubx64.efi
                 /Microsoft/Boot/*
        /grub2
            /fonts
            /locale
            /themes
            /x86_64-efi
            /grub.cfg
            /grubenv
       {kernel-files}

The grub install command on this system is:
Code:
grub2-install --target=x86_64-efi --efi-directory=/boot/efi --boot-directory=/boot

I've no 'boot' link and both configurations are working well.
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Thu Aug 29, 2013 7:48 pm    Post subject: Re: EFI, GRUB2 and other confusions Reply with quote

Holysword wrote:
I just got a new laptop and I'm trying to get Gentoo in it. However, it has this UEFI thing and I can't quite figure out what I'm doing.


EFI has a learning curve, particularly for distributions, like Gentoo, which put the user in charge rather than rely on GUI installers.

Quote:
- I emerged and compiled GRUB2
- I did this:
Code:
grub2-install --target=x86_64-efi --root-directory=/boot/ --boot-directory=/boot/efi/ --bootloader-id=GRUB2 --no-floppy


I realize that you've got GRUB 2 (sort-of) working, but IMHO, GRUB 2 is the worst of the available EFI boot loaders. It's just too complex, and therefore too easy to mess up its installation. See my Web page on the topic for a rundown of what's available. FWIW, my personal preference is to use the EFI stub loader along with rEFInd as a boot manager; however, as I maintain rEFInd, I'm not exactly unbiased on that score. Still, one of my major goals with rEFInd is to make it dead easy to install and configure. Judging by the feedback I've received, I think I'm doing pretty well on that score. Certainly I've got GRUB 2 beat hands down, with the notable exception of distributions like Ubuntu and Fedora, which do most of the work of GRUB installation in their OS installers. Even then, they often get things wrong, and when that happens, it's often easier to install rEFInd than to deal with the GRUB problem.

Holysword wrote:
Code:
grub> boot

And then I get the "blind mode" error, and I end up without booting messages or console or anything. I am not sure if I need to do anything special. Do I need initramfs? I was using it in my previous installation for fbcon stuffs, but turned off now. Do I need to have the kernel as efi also? How do I do that? I find the information about this subject very very very confusing =S


Getting the console (or video generally) to work with EFI can be a challenge. Generally speaking, you need to have the right combination of video drivers compiled into your kernel, either directly or as modules. If you compile them as modules, you won't see anything during boot unless you use an initrd file. Details vary depending on your hardware, and I haven't been keeping tabs on those details, so I can't offer specific advice. You may want to do a Web search on "EFI" and your video hardware (with specific model numbers), and/or post details here about your video hardware.

Holysword wrote:
Can I just ignore the EFI and keep using normal GRUB2 MBR boot? How do I do that?


Yes, you can boot in BIOS/CSM/legacy mode using a BIOS version of GRUB. To do this, you go through all the software steps for the Gentoo installation exactly as you would on a BIOS-based computer. The trick is to get your firmware to boot the installation in BIOS mode, which can be a problem because there's no standardization on this score. Sometimes you need to set firmware options. Other times you need to use MBR partitioning, or set a partition as active in the MBR. Some systems boot in BIOS mode if there's no EFI System Partition (ESP; the type-EF00 partition on your disk).

renegart wrote:
your (running) kernel is aware of EFI and you can install grub2 simply with:
Code:
grub2-install /dev/sda

to the master boot record.


An EFI-mode GRUB doesn't touch the MBR; it installs to the ESP and typically also modifies the NVRAM (via "efibootmgr") to tell the ESP where to look for the files. I'm not sure offhand if using "/dev/sda" is correct or necessary with the EFI version of GRUB. If it worked for you, then it's probably at least not incorrect.

renegart wrote:
try 'grub2-install --target=x86_64-efi --efi-directory=/boot/efi --boot-directory=/boot'. Otherwise the grub files will be installed into the wrong directory.


There are two ways to configure GRUB's configuration files on an EFI system:


  • On the ESP -- You can configure GRUB to look for its configuration files on the ESP itself, typically in its own directory (such as EFI/gentoo/ or EFI/grub/). This has the advantage that the configuration will work even if something happens to the Gentoo installation (such as if it's damaged or if you remove it). The problem is that if you rely on scripts to update the files, they may not look in the right place.
  • On a Linux partition -- You can configure GRUB to put its files in Linux's /boot/grub/ or /boot/grub2/ directory -- that is, in the traditional GRUB location. This lets GRUB's configuration scripts work correctly, but it makes the installation susceptible to complete failure should that partition become damaged or removed.


Overall, if you're dual-booting, I definitely recommend storing GRUB's configuration files on the ESP. I don't recall the precise commands to set up in either way, though.

Holysword wrote:
I installed my kernel manually with efibootmgr and it boots fine. The only problem is that its not the first option in the list, so I always have to quickly press ESC to get the option to choose the vmlinuz.efi file manually.


This sounds like you're booting with an EFI stub loader and your computer's built-in boot manager. This can work fine, but is a bit inflexible, since you can't adjust boot options on a boot-by-boot basis. Adding rEFInd or gummiboot will enable you to do this, as well as to easily launch any of several kernels or boot other tools (such as an EFI shell) or OSes.

If you want to keep booting the kernel directly, you can change the boot order with efibootmgr's "-o" option; see its man page for details.

imaginasys wrote:
Aren't you supposed to have 2 efi partition:
#1 type EF00 EFI BOOT (formatted VFAT) mounted on /boot/efi (recommanded size 512MB)
#2 type EF02 EFI BIOS (formatted VFAT) no mounted usually sized 32MB.


The EF00 partition is the ESP, and is used to boot the computer in EFI mode. The EF02 partition is the BIOS Boot Partition, and is used by GRUB 2 to boot the computer in BIOS/CSM/legacy mode. Ordinarily, you need one of these partitions to boot Linux from a GPT disk. Having both enables you to switch boot modes relatively easily, but is not strictly required.

imaginasys wrote:
And then a boot partition :
#3 type 8300 /boot formatted EXT2


This partition is usually optional, and it can use any Linux filesystem. In fact, it can be FAT, HFS+, or various others. A separate /boot partition is required under certain circumstances, such as when using LVM and a boot loader that doesn't understand LVM. (GRUB 2 supposedly does, but I've never tested that.)

One variant configuration is to mount the ESP at /boot. This is a bit unconventional, but it does work, and it has the advantage that when you place your kernel in its usual location, it will become automatically accessible to EFI boot managers such as gummiboot that require the kernel to be on their own partition. OTOH, mounting the ESP at /boot could run afoul of any tools that assume the ESP is to be mounted at /boot/efi. FWIW, mounting the ESP at /boot is popular in the Arch community, which favors use of gummiboot or rEFInd with the EFI stub loader.

Holysword wrote:
I have 1 EF00 partition which has 100MB


A 100MB ESP is adequate for many purposes, but I recommend making it larger -- my usual recommended size is 550MiB. I recommend this size for several reasons:


  • The EFI spec says that the ESP must be FAT32, not FAT16. In practice, most EFIs work fine with FAT16 ESPs, but some don't, and some tools don't, either. Most notably, the Windows 7 installer flakes out if fed a FAT16 ESP. (I don't know if the same is true of the Windows 8 installer.)
  • Some EFIs have problems with FAT32 ESPs that are smaller than 512MiB. In particular, they can mount the filesystem fine, but some files will seem to have disappeared, which can produce all sorts of misbehavior in boot loaders.
  • The Linux mkdosfs tool switches from FAT16 to FAT32 by default at some peculiar number that's a bit over 512MiB -- something like 520MiB. I don't recall the precise value, though.
  • Given the possibility of MB/MiB confusion, adding a bit to the size makes sense. 550MiB is easy to remember, and even if the user mistakenly creates a 550MB partition, it will still be big enough to become FAT32 if it's prepared with mkdosfs using its default values.


That said, if a 100MB ESP is working for you now, it's probably not worth resizing it unless doing so is convenient -- say, if you want to start over from scratch for other reasons.

Logicien wrote:
One question is if you have a boot partition, like a flashdrive mounted in /boot, you must link the root directory of it with boot when the --boot-directory=/boot/grub2 option is used:
Code:
cd /boot
ln -s . boot

Than Grub2 will be able to look in the /boot/grub2 and not only in the /grub2 directory after it have mounted the partition.


I don't believe this is always necessary, although some GRUB configurations may require it. That said, I've not studied the issue in detail. (As I said, I believe GRUB 2 is pretty dreadful, so I prefer to avoid it whenever possible.)

Overall, my own recommendation is to forget GRUB 2; it's like an elephant on jet-propelled roller skates -- big and likely to cause problems. Instead, rely on the kernel's EFI stub boot loader and add rEFInd or gummiboot. Unfortunately, neither is in the Gentoo repository; but rEFInd is easily installed from the binary .zip file I provide. Gummiboot is a little harder to install, since its developers don't provide binary download links; but my page on gummiboot does provide some links (that are probably a bit behind by now; the gummiboot developers release new versions fairly frequently).

One caveat: If your laptop is a Lenovo, be aware that there seem to be some problems with inconsistent boot behavior of the EFI stub loader since the 3.6 series. See this Arch forum discussion for details. If you run into this problem, using ELILO or SYSLINUX might make sense, either by itself (if you're booting Linux alone) or in conjunction with rEFInd or gummiboot (if you're booting along with Windows or some other OS).
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Thu Aug 29, 2013 10:23 pm    Post subject: Reply with quote

Holysword,
I gave you the default way for Grub2 with the UEFI firmware. I do not have any /boot partition, so I do not need any symbolic link to say to Grub that it must also see the root directory as the /boot directory in this partition when it load in BIOS or UEFI mode. Mandatory or not, everything depend on how you do the whole thing.

You have a /boot partition. It is your EFI System Fat partition, the one with the ID EF00. That's mean that all the data of your Gentoo who must be written in the /boot directory will be write in the EFI System partition. It is quite usable.

I prefer to mount the EFI System partition in /boot/efi. I know then that the EFI System partition only contain EFI executables. Anyway, the EFI firmware cannot execute anything else then files with the efi extension, if I am correct, when you navigate in with it's trivial files manager.

Grub2 work well in BIOS and UEFI modes. I was unable to make Grub2 the default bootloader of the UEFI firmware when Windows was there. The Windows bootloader was always the default one. I had to use the boot devices key to select Grub2. Removing Windows make it easy to have Grub2 the default bootloader. This because of the (U)EFI specifications probably.

It have been said that you can have Grub2 in the default menu if you use a Windows UEFI bootloader. I only have a live-DVD of Windows Seven, mainly to flash in graphic mode firmwares that cannot be flash otherwise. I will not make a dual boot between Windows and Linux in UEFI mode anymore.
_________________
Paul
Back to top
View user's profile Send private message
renegart
Tux's lil' helper
Tux's lil' helper


Joined: 30 Oct 2012
Posts: 122

PostPosted: Fri Aug 30, 2013 5:43 am    Post subject: Reply with quote

Logicien wrote:
Holysword,
Grub2 work well in BIOS and UEFI modes. I was unable to make Grub2 the default bootloader of the UEFI firmware when Windows was there. The Windows bootloader was always the default one. I had to use the boot devices key to select Grub2. Removing Windows make it easy to have Grub2 the default bootloader. This because of the (U)EFI specifications probably.

UEFI supports to load a default bootloader from 'Boot' directory as fallback if no other boot entries exists.
When installing Windows, Microsoft stores its own bootloader into that directory, regardless if there is already another or not.
I've recogniced on my Ultrabook that some UEFI Bios booting this bootloader only. If you want grub2 (or any other) bootloader as default, copy it into the 'Boot' directory and name it 'bootx64.efi'
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Fri Aug 30, 2013 6:28 am    Post subject: Reply with quote

renegart wrote:
If you want grub2 (or any other) bootloader as default, copy it into the 'Boot' directory and name it 'bootx64.efi'

I did that in my HP laptop g6-2040ca. Windows was booting anyway. More I move the Windows directory from the EFI System partition, or rename it, the UEFI firmware told me there was no bootable system available. Always the 'Secure boot' was disabled.

I could have make some mistakes in those manipulations. Because I have no Windows anymore on that machine I will not reinstall it to make those manipulations again.

For the moment, I only have a debian sub-directory in the EFI directory of my EFI System partition. I have no Boot directory. Grub2-efi of Debian is the default by force. I use it to load Gentoo.
_________________
Paul


Last edited by Logicien on Fri Aug 30, 2013 6:35 am; edited 1 time in total
Back to top
View user's profile Send private message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Fri Aug 30, 2013 6:34 am    Post subject: Reply with quote

Thank you very much, srs5694 for your detailed explanation.
In view of your explanation I simply got rid of GRUB2, but I let to try rEFInd during the weekend. I just used efiboomgr to fix up the boot order and got my kernel to boot automatically for me, but now I have the problem with loosing the video again... it starts with the video, but right after it loads the udev service, it glitches and disappears. I can log in and type "startx" and then the video comes back though, but that's not how it was meant to be, I'm sure. To be honest, I cannot completely blame EFI now, since I was changing stuffs both in the kernel and in the rc-update so I will have to double check everything. Meanwhile, are you guys aware of any service which could glitch the video while booting with EFI?
_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Fri Aug 30, 2013 7:12 am    Post subject: Reply with quote

To have help, it would be necessary to know what is your graphic card, your kernel configuration, your kernel boot parameters and if you use an initramfs. Everythings are related in that part.

I see only Udev that could replace the EFI framebuffer compiled in the kernel by a KMS framebuffer compiled in module that it load without the appropriates firmware files and/or with errors. The KMS framebuffer drivers are the only one I know that can replace an other framebuffer driver already working.

If you have set things to display a background image with fbcondecor, if something is wrong, the fbcondecor boot service just dont do anything without changing any video configuration. Also,the Ati proprietary drivers (fglrx) haven't work for me in UEFI mode with Xorg.

In UEFI mode, I experiment that only Radeon KMS that I use and the EFI framebuffer where working with my Amd/Ati graphic card. UEFI do not support the Vesa mode, so the vesafb and uvesafb cannot be use as framebuffer drivers.

Possibly, other KMS framebuffer drivers like Intel and Nouveau work with their respective cards in UEFI mode. I haven't test them.
_________________
Paul
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1480

PostPosted: Fri Aug 30, 2013 7:37 am    Post subject: Reply with quote

@Holysword, using efi mode when booting:
- I have an experimental Gentoo installation using linux-3.11rc with nouveau: There I managed to get the video.
- But my main installation using proprietary nvidia-drivers stops showing the consoles[1-6] once it starts the kdm graphics ...
:(
Back to top
View user's profile Send private message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Fri Aug 30, 2013 2:24 pm    Post subject: Reply with quote

Logicien wrote:
To have help, it would be necessary to know what is your graphic card, your kernel configuration, your kernel boot parameters and if you use an initramfs. Everythings are related in that part.

My graphic card is:
Code:
jarvis holysword # lspci | grep 'VGA\|NVIDIA'
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
01:00.0 3D controller: NVIDIA Corporation GK208M [GeForce GT 740M] (rev a1)
jarvis holysword # uname -a
Linux jarvis 3.10.9-gentoo #9 SMP PREEMPT Thu Aug 29 21:48:20 PDT 2013 x86_64 Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz GenuineIntel GNU/Linux

I've uploaded my .config into pastebin: http://pastebin.com/1FUWiPQt . I am not usin initramfs (and hopefully I disabled everything in the kernel config regarding that, since I was using previously) and I do not specify any kernel boot parameters.

ulenrich wrote:
@Holysword, using efi mode when booting:
- I have an experimental Gentoo installation using linux-3.11rc with nouveau: There I managed to get the video.
- But my main installation using proprietary nvidia-drivers stops showing the consoles[1-6] once it starts the kdm graphics ...
:(

That... actually could be a reason... since I was testing graphic drivers and I had nouveau installed at some point. I'm going to install it again and see if the booting process likes nouveau better than nvidia-drivers.
_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1480

PostPosted: Fri Aug 30, 2013 2:48 pm    Post subject: Reply with quote

Holysword wrote:
ulenrich wrote:
- I have an experimental Gentoo installation using linux-3.11rc with nouveau:

That... actually could be a reason... since I was testing graphic drivers and I had nouveau installed at some point. I'm going to install it again and see if the booting process likes nouveau better than nvidia-drivers.

Be sure to have enabled some of this graphics related in your .confg:
Code:
# Graphics support
#
# CONFIG_AGP is not set
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=2
# CONFIG_VGA_SWITCHEROO is not set
CONFIG_DRM=m
CONFIG_DRM_KMS_HELPER=m
CONFIG_DRM_LOAD_EDID_FIRMWARE=y
CONFIG_DRM_TTM=m

#
# I2C encoder or helper chips
#
CONFIG_DRM_I2C_CH7006=m
CONFIG_DRM_I2C_SIL164=m
CONFIG_DRM_I2C_NXP_TDA998X=m
# CONFIG_DRM_TDFX is not set
# CONFIG_DRM_R128 is not set
# CONFIG_DRM_RADEON is not set
CONFIG_DRM_NOUVEAU=m
CONFIG_NOUVEAU_DEBUG=3
CONFIG_NOUVEAU_DEBUG_DEFAULT=2
CONFIG_DRM_NOUVEAU_BACKLIGHT=y
# CONFIG_DRM_MGA is not set
# CONFIG_DRM_VIA is not set
# CONFIG_DRM_SAVAGE is not set
# CONFIG_DRM_VMWGFX is not set
# CONFIG_DRM_GMA500 is not set
# CONFIG_DRM_UDL is not set
# CONFIG_DRM_AST is not set
# CONFIG_DRM_MGAG200 is not set
# CONFIG_DRM_CIRRUS_QEMU is not set
# CONFIG_DRM_QXL is not set
CONFIG_VGASTATE=m
CONFIG_VIDEO_OUTPUT_CONTROL=y
CONFIG_HDMI=y
CONFIG_FB=y
CONFIG_FIRMWARE_EDID=y
CONFIG_FB_DDC=m
CONFIG_FB_BOOT_VESA_SUPPORT=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
CONFIG_FB_SYS_FILLRECT=m
CONFIG_FB_SYS_COPYAREA=m
CONFIG_FB_SYS_IMAGEBLIT=m
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYS_FOPS=m
CONFIG_FB_DEFERRED_IO=y
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
CONFIG_FB_BACKLIGHT=y
CONFIG_FB_MODE_HELPERS=y
# CONFIG_FB_TILEBLITTING is not set

#
# Frame buffer hardware drivers
#
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ARC is not set
# CONFIG_FB_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
# CONFIG_FB_VGA16 is not set
CONFIG_FB_UVESA=m
CONFIG_FB_VESA=y
CONFIG_FB_EFI=y
# CONFIG_FB_N411 is not set
# CONFIG_FB_HGA is not set
# CONFIG_FB_S1D13XXX is not set
CONFIG_FB_NVIDIA=m
CONFIG_FB_NVIDIA_I2C=y
# CONFIG_FB_NVIDIA_DEBUG is not set
CONFIG_FB_NVIDIA_BACKLIGHT=y
# CONFIG_FB_RIVA is not set
# CONFIG_FB_I740 is not set
# CONFIG_FB_LE80578 is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_S3 is not set
# CONFIG_FB_SAVAGE is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_VIA is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_VT8623 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_ARK is not set
# CONFIG_FB_PM3 is not set
# CONFIG_FB_CARMINE is not set
# CONFIG_FB_GEODE is not set
# CONFIG_FB_TMIO is not set
# CONFIG_FB_SM501 is not set
# CONFIG_FB_SMSCUFX is not set
# CONFIG_FB_UDL is not set
# CONFIG_FB_GOLDFISH is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
# CONFIG_FB_BROADSHEET is not set
# CONFIG_FB_AUO_K190X is not set
# CONFIG_EXYNOS_VIDEO is not set
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_LCD_CLASS_DEVICE=m
# CONFIG_LCD_L4F00242T03 is not set
# CONFIG_LCD_LMS283GF05 is not set
# CONFIG_LCD_LTV350QV is not set
# CONFIG_LCD_ILI922X is not set
# CONFIG_LCD_ILI9320 is not set
# CONFIG_LCD_TDO24M is not set
# CONFIG_LCD_VGG2432A4 is not set
# CONFIG_LCD_PLATFORM is not set
# CONFIG_LCD_S6E63M0 is not set
# CONFIG_LCD_LD9040 is not set
# CONFIG_LCD_AMS369FG06 is not set
# CONFIG_LCD_LMS501KF03 is not set
# CONFIG_LCD_HX8357 is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_GENERIC=y
CONFIG_BACKLIGHT_APPLE=m
# CONFIG_BACKLIGHT_SAHARA is not set
# CONFIG_BACKLIGHT_ADP8860 is not set
# CONFIG_BACKLIGHT_ADP8870 is not set
# CONFIG_BACKLIGHT_LM3630 is not set
# CONFIG_BACKLIGHT_LM3639 is not set
# CONFIG_BACKLIGHT_LP855X is not set

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
CONFIG_VGACON_SOFT_SCROLLBACK=y
CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=128
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
CONFIG_FONTS=y
# CONFIG_FONT_8x8 is not set
CONFIG_FONT_8x16=y
CONFIG_FONT_6x11=y
# CONFIG_FONT_7x14 is not set
# CONFIG_FONT_PEARL_8x8 is not set
# CONFIG_FONT_ACORN_8x8 is not set
# CONFIG_FONT_MINI_4x6 is not set
# CONFIG_FONT_SUN8x16 is not set
# CONFIG_FONT_SUN12x22 is not set
CONFIG_FONT_10x18=y
# CONFIG_LOGO is not set
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Fri Aug 30, 2013 4:37 pm    Post subject: Reply with quote

Holysword wrote:
I've uploaded my .config into pastebin: http://pastebin.com/1FUWiPQt .


You might try setting CONFIG_FB_NVIDIA, which is currently disabled. There may be other options you'd want to set or unset, but that's the one that stands out in my own mind.
Back to top
View user's profile Send private message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Sat Aug 31, 2013 6:36 pm    Post subject: Reply with quote

srs5694 wrote:
Holysword wrote:
I've uploaded my .config into pastebin: http://pastebin.com/1FUWiPQt .


You might try setting CONFIG_FB_NVIDIA, which is currently disabled. There may be other options you'd want to set or unset, but that's the one that stands out in my own mind.

Doesn't work. In fact it makes things worse. After the video disappears, I cannot startx anymore (or I can and just can't ever see it).
Afaik, FB in the kernel always conflicts with proprietary drivers. On the top of that, I believe that EFI is not using nvidia as video card, but the intel one. I also tried to enable some FB stuffs for intel, no help also.

Maybe my OpenRC booting process IS SHOWING an error, I just can't see because the video crashes. Is there any log where I can check the whole output of OpenRC?
_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Sun Sep 01, 2013 1:30 am    Post subject: Reply with quote

rc_logger="YES" in /etc/rc.conf writes to /var/log/rc.log
does your laptop have a backlight brigtness control?
http://people.skolelinux.org/pere/blog/Fixing_the_Linux_black_screen_of_death_on_machines_with_Intel_HD_video.html may provide useful info
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum