Difference between pages "Install/BootLoader" and "Package:Eselect (OpenGL)"

< Install(Difference between pages)
(Installing GRUB)
 
 
Line 1: Line 1:
<noinclude>
+
{{Ebuild
{{InstallPart|boot loader configuration}}
+
|Summary=A Gentoo/Funtoo utility that allows the active OpenGL implementation on a system to be switched between a variety of installed options.
</noinclude>
+
|CatPkg=app-admin/eselect-opengl
=== Installing a Bootloader ===
+
|Maintainer=
 +
}}
 +
== Introduction ==
  
These install instructions show you how to use GRUB to boot using BIOS (old-school) or UEFI (new-school).
+
Eselect (OpenGL) (also called <tt>eselect-opengl</tt>) is a module for [[Package:Eselect|Eselect]] that allows the OpenGL implementation on a Funtoo Linux or Gentoo Linux system to be switched between a variety of installed OpenGL implementations. It functions by creating an <tt>env.d</tt> file at <tt>/etc/env.d/03opengl</tt> which contains OpenGL settings, as well as managing symbolic links to OpenGL libraries and headers.  
  
==== Old School (BIOS) ====
+
=== Sample env.d File ===
  
If you're using the BIOS to boot, setting up GRUB, the bootloader, is pretty easy.
+
A sample <tt>env.d</tt> file for a multilib system with xorg-x11 OpenGL implementation may look like this:
  
To use this recommended boot method, first emerge <code>boot-update</code>. This will also cause <code>grub-2</code> to be merged, since it is a dependency of <code>boot-update</code>.
+
{{file|name=/etc/env.d/03opengl|desc=An example env.d file for eselect-opengl|body=
 +
# Configuration file for eselect
 +
# This file has been automatically generated.
 +
LDPATH="/usr/lib32/opengl/xorg-x11/lib:/usr/lib64/opengl/xorg-x11/lib"
 +
OPENGL_PROFILE="xorg-x11"
 +
}}
  
<console>
+
== Implementation ==
(chroot) # ##i##emerge boot-update
+
</console>
+
  
Then, edit <code>/etc/boot.conf</code> and specify "<code>Funtoo Linux genkernel</code>" as the <code>default</code> setting at the top of the file, replacing <code>"Funtoo Linux"</code>.
+
Eselect-opengl is implemented as a single bash-based [[Package:Eselect|Eselect]] module approximately 10K in size, installed at <tt>/usr/share/eselect/modules/opengl.eselect</tt>. One interfaces with this module via the main <tt>eselect</tt> command:
  
<code>/etc/boot.conf</code> should now look like this:
+
<console>
 +
# ##i##eselect opengl help
 +
Manage the OpenGL implementation used by your system
 +
Usage: eselect opengl <action> <options>
  
<pre>
+
##g##Standard actions:
boot {
+
  help                      Display help text
generate grub
+
  usage                    Display usage information
default "Funtoo Linux genkernel"
+
  version                  Display version information
timeout 3
+
}
+
  
"Funtoo Linux" {
+
##g##Extra actions:
kernel bzImage[-v]
+
  list                      List the available OpenGL implementations.
}
+
  set <target>             Select the OpenGL implementation.
 
+
    <target>                 The profile to activate
"Funtoo Linux genkernel" {
+
    --use-old                If an implementation is already set, use that one instead
kernel kernel[-v]
+
    --prefix=<val>           Set the source prefix (default: /usr)
initrd initramfs[-v]
+
    --dst-prefix=<val>       Set the destination prefix (default: /usr)
params += real_root=auto
+
    --ignore-missing          Ignore missing files when setting a new implementation
}
+
  show                      Print the current OpenGL implementation.
 
+
"Funtoo Linux better-initramfs" {
+
kernel vmlinuz[-v]
+
initrd /initramfs.cpio.gz
+
}
+
</pre>
+
 
+
Please read <code>man boot.conf</code> for further details.
+
 
+
===== Running grub-install and boot-update =====
+
 
+
Finally, we will need to actually install the GRUB boot loader to your disk, and also run <code>boot-update</code> which will generate your boot loader configuration file:
+
 
+
<console>
+
(chroot) # ##i##grub-install --no-floppy /dev/sda
+
(chroot) # ##i##boot-update
+
 
</console>
 
</console>
  
Now you need to update your boot loader configuration file:
+
== What is Switched ==
<console>
+
(chroot) # ##i##boot-update
+
</console>
+
You only need to run <code>grub-install</code> when you first install Funtoo Linux, but you need to re-run <code>boot-update</code> every time you modify your <code>/etc/boot.conf</code> file, so your changes are applied on next boot.
+
  
==== New School (UEFI) ====
+
Using <tt>eselect opengl set</tt> causes the following symbolic links to be updated to point to the files corresponding to the OpenGL implementation that you chose:
  
If you're using UEFI to boot, setting up the boot loader is a bit more complicated for now, but this process will be improving soon. Perform the following steps.
+
* ''Libraries'' (32-bit and 64-bit):
 +
** <tt>/usr/lib(64)/libGL.so.*</tt>
 +
** <tt>/usr/lib(64)/libEGL.so.*</tt>
 +
** <tt>/usr/lib/(32|64|)/libGLESv1.so.*</tt>
 +
** <tt>/usr/lib/(32|64|)/libGLESv2.so.*</tt>
 +
* ''C Headers'':
 +
** <tt>/usr/include/GL/*</tt>
 +
** <tt>/usr/include/EGL/*</tt>
 +
** <tt>/usr/include/KHR/*</tt>
 +
* <tt>/usr/lib(64|)/xorg/modules/extensions/libglx.so</tt>
  
===== Emerging GRUB =====
+
The symbolic links point to an installed OpenGL implementation, stored inside <tt>/usr/lib(32|64|)/opengl/(implementation-name)</tt>. These files are structured as follows:
  
You will still use GRUB as a boot loader, but before emerging grub, you will need to enable EFI booting. To do this,
+
* <tt>/usr/lib/opengl/(implementation-name)/lib</tt>
add the following line to <code>/etc/make.conf</code>:
+
* <tt>/usr/lib/opengl/(implementation-name)/include/(GL|EGL|KHR)</tt>
 +
* <tt>/usr/lib/opengl/(implementation-name)/extensions/libglx.so</tt>
  
<pre>
+
On multilib systems, ebuilds that provide an OpenGL implementation install 32-bit libraries in <tt>/usr/lib32/opengl/(implementation name)/lib</tt> and 64-bit libraries in <tt>/usr/lib64/opengl/(implementation name)/lib</tt>.
  
For 64-bit systems:
+
== Criticisms ==
  
GRUB_PLATFORMS="efi-64"
+
=== Violation of Build Consistency ===
  
For 32-bit systems, i.e. Intel Atom devices and systems with less than 4GB of RAM:
+
As documented in {{Bug|FL-1309}}, sometimes packages fail to merge when the "wrong" eselect opengl implementation is selected. This violates Portage's ability to consistently build a package from source, assuming all its dependencies are satisfied. This could be classified as a design bug -- eselect-opengl is functioning as intended, but its underlying theory of operation is not correct.
  
GRUB_PLATFORMS="efi-32"
+
== eselect-opengl-1.3* experiment ==
  
</pre>
+
=== Introduction ===
  
Then, <code>emerge boot-update</code>. You will notice <code>grub</code> and <code>efibootmgr</code> getting pulled in as dependencies. This is expected and good:
+
As a result of {{Bug|FL-1309}}, an experimental solution was implemented in eselect-opengl-1.3*. With this version, all packages are built unconditionally against xorg-x11 OpenGL implementation and the other implementations are used only in runtime.
  
<console>
+
The rationale for this design change is that:
(chroot) # ##i##emerge boot-update
+
# There should be a consistent and repeatable build/linking process for all OpenGL applications.
</console>
+
# AMD and NVIDIA implementations of OpenGL are designed to be more of a "drop-in" runtime replacement for xorg-x11, rather than a standalone replacement for xorg-x11, and thus appear to exhibit more build-time bugs.
  
===== Installing GRUB =====
+
=== Implementation ===
  
Now, for the magic of getting everything in place for booting. You should copy your kernel and initramfs (if you have one -- you will if you are following the default install) to <tt>/boot</tt>. GRUB will boot those. But how do we get UEFI to boot GRUB? Well, we need to run the following command (for 32bit simply set it as i386-efi):
+
The new version of eselect-opengl switched two files:
 
+
* an env.d file <tt>000opengl</tt> specifying <tt>LDPATH</tt> for the run-time implementation override,
<console>
+
* an xorg.conf.d file overriding the ModulePath for custom glx xorg modules.
(chroot) # ##i##grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda
+
</console>
+
This command will simply install all the stuff to <tt>/boot/EFI</tt> and <tt>/boot/grub</tt> that your system needs to boot. In particular, the <tt>/boot/EFI/grub/grubx64.efi</tt> file will be created. This is the GRUB boot image that UEFI will load and start.
+
 
+
A more detailed explanation of the flags used in the above command:
+
* <code>--target=x86_64-efi</code>: Tells GRUB that we want to install it in a way that allows it to boot in UEFI
+
* <code>--efi-directory=/boot</code>: All GRUB UEFI files will be installed in ''/boot''
+
* <code>--bootloader-id="Funtoo Linux [GRUB]"</code>: This flag is not necessary for GRUB to boot. However, it allows you to change the text of the boot option in the UEFI BIOS. The stuff in the quotes can be set to anything that you would like.
+
* <code>--recheck</code>: If a device map already exists on the disk or partition that GRUB is being installed on, it will be removed.
+
* <code>/dev/sda</code>:The device that we are installing GRUB on.
+
 
+
===== Configuring GRUB =====
+
 
+
OK, now UEFI has the GRUB image it needs to boot. But we still need to configure GRUB itself so it finds and boots your kernel and initramfs. This is done by performing the following steps. Since boot-update doesn't yet support UEFI, we will use boot-update, but then edit our <code>/boot/grub/grub.cfg</code> to support UEFI booting.
+
 
+
First, you will need to edit <code>/etc/boot.conf</code>. Format this as you would if you were booting without UEFI. If you are not sure how this should look, below is an example of what it could look like if you are booting from an unencrypted ext4 partition:
+
 
+
{{file|name=/etc/boot.conf|desc=|body=
+
boot {
+
        generate grub
+
        default "Funtoo Linux"
+
        timeout 3
+
}
+
 
+
"Funtoo Linux" {
+
        kernel vmlinuz[-v]
+
        params += rootfstype=ext4 root=/dev/sda2
+
}
+
}}
+
 
+
After you have edited your <code>/etc/boot.conf</code> file, run <code>boot-update</code>. You should now have a <code>/boot/grub/grub.cfg</code> file, which you can edit using the following command:
+
 
+
<console>
+
# ##i##nano /boot/grub/grub.cfg
+
</console>
+
  
 +
The env.d file has the same contents as the original one, except that the name was changed to ensure that the additional linker paths are added before the system paths where xorg-x11 libraries are installed.
  
To get your <code>/boot/grub/grub.cfg</code> to support booting with UEFI, make the following changes. Below the existing insmod lines, add the following lines.  Both of these involve adding support for the UEFI framebuffer to GRUB.:
+
The xorg.conf.d sets ModulePaths for non-xorg module replacements (such as the nvidia glx module), if necessary.
  
<pre>
+
=== Issues ===
  insmod efi_gop
+
  insmod efi_uga
+
</pre>
+
  
Then, change the <code>set gfxpayload</code> line to read as follows. UEFI does not support text mode, so we will keep video initialized to the current resolution.:
+
The widespread testing of eselect-opengl-1.3* has proven some issues with the new design:
  
<pre>
+
# xorg-server is unable to handle multiple occurences of <code>Files</code> section gracefully. Therefore, eselect-opengl's generated xorg.conf.d file collides with many user-defined configurations. This has been patched locally and the patch is awaiting upstream review)
  set gfxpayload=keep
+
# There are rumors of arm mali's prioprietary OpenGL implementations requiring applications to be built against its own GLES headers.
</pre>
+
  
You can now save your changes by pressing <code>Control-X</code> and answering <code>y</code> when asked if you want to save the modified buffer. When prompted for a filename, hit Enter to use the existing filename.
+
{{EbuildFooter}}

Latest revision as of 08:00, March 1, 2015

app-admin/eselect-opengl


Source Repository:Gentoo Portage Tree

Summary: A Gentoo/Funtoo utility that allows the active OpenGL implementation on a system to be switched between a variety of installed options.


News

Mgorny

New OpenGL management in Funtoo

Funtoo is switching to an improved system for managing multiple OpenGL providers (Mesa/Xorg, AMD and nVidia). The update may involve blockers and file collisions.
30 March 2015 by Mgorny
Drobbins

Subarch Profiles are coming...

Subarch profiles are on their way! Learn more here.
29 March 2015 by Drobbins
Drobbins

RSS/Atom Support

You can now follow this news feed at http://www.funtoo.org/news/atom.xml .
10 February 2015 by Drobbins
View More News...

Eselect (OpenGL)

Tip

This is a wiki page. To edit it, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Introduction

Eselect (OpenGL) (also called eselect-opengl) is a module for Eselect that allows the OpenGL implementation on a Funtoo Linux or Gentoo Linux system to be switched between a variety of installed OpenGL implementations. It functions by creating an env.d file at /etc/env.d/03opengl which contains OpenGL settings, as well as managing symbolic links to OpenGL libraries and headers.

Sample env.d File

A sample env.d file for a multilib system with xorg-x11 OpenGL implementation may look like this:

/etc/env.d/03opengl - An example env.d file for eselect-opengl
# Configuration file for eselect
# This file has been automatically generated.
LDPATH="/usr/lib32/opengl/xorg-x11/lib:/usr/lib64/opengl/xorg-x11/lib"
OPENGL_PROFILE="xorg-x11"

Implementation

Eselect-opengl is implemented as a single bash-based Eselect module approximately 10K in size, installed at /usr/share/eselect/modules/opengl.eselect. One interfaces with this module via the main eselect command:

# eselect opengl help
Manage the OpenGL implementation used by your system
Usage: eselect opengl <action> <options>

Standard actions:
  help                      Display help text
  usage                     Display usage information
  version                   Display version information

Extra actions:
  list                      List the available OpenGL implementations.
  set <target>              Select the OpenGL implementation.
    <target>                  The profile to activate
    --use-old                 If an implementation is already set, use that one instead
    --prefix=<val>            Set the source prefix (default: /usr)
    --dst-prefix=<val>        Set the destination prefix (default: /usr)
    --ignore-missing          Ignore missing files when setting a new implementation
  show                      Print the current OpenGL implementation.

What is Switched

Using eselect opengl set causes the following symbolic links to be updated to point to the files corresponding to the OpenGL implementation that you chose:

  • Libraries (32-bit and 64-bit):
    • /usr/lib(64)/libGL.so.*
    • /usr/lib(64)/libEGL.so.*
    • /usr/lib/(32|64|)/libGLESv1.so.*
    • /usr/lib/(32|64|)/libGLESv2.so.*
  • C Headers:
    • /usr/include/GL/*
    • /usr/include/EGL/*
    • /usr/include/KHR/*
  • /usr/lib(64|)/xorg/modules/extensions/libglx.so

The symbolic links point to an installed OpenGL implementation, stored inside /usr/lib(32|64|)/opengl/(implementation-name). These files are structured as follows:

  • /usr/lib/opengl/(implementation-name)/lib
  • /usr/lib/opengl/(implementation-name)/include/(GL|EGL|KHR)
  • /usr/lib/opengl/(implementation-name)/extensions/libglx.so

On multilib systems, ebuilds that provide an OpenGL implementation install 32-bit libraries in /usr/lib32/opengl/(implementation name)/lib and 64-bit libraries in /usr/lib64/opengl/(implementation name)/lib.

Criticisms

Violation of Build Consistency

As documented in FL-1309, sometimes packages fail to merge when the "wrong" eselect opengl implementation is selected. This violates Portage's ability to consistently build a package from source, assuming all its dependencies are satisfied. This could be classified as a design bug -- eselect-opengl is functioning as intended, but its underlying theory of operation is not correct.

eselect-opengl-1.3* experiment

Introduction

As a result of FL-1309, an experimental solution was implemented in eselect-opengl-1.3*. With this version, all packages are built unconditionally against xorg-x11 OpenGL implementation and the other implementations are used only in runtime.

The rationale for this design change is that:

  1. There should be a consistent and repeatable build/linking process for all OpenGL applications.
  2. AMD and NVIDIA implementations of OpenGL are designed to be more of a "drop-in" runtime replacement for xorg-x11, rather than a standalone replacement for xorg-x11, and thus appear to exhibit more build-time bugs.

Implementation

The new version of eselect-opengl switched two files:

  • an env.d file 000opengl specifying LDPATH for the run-time implementation override,
  • an xorg.conf.d file overriding the ModulePath for custom glx xorg modules.

The env.d file has the same contents as the original one, except that the name was changed to ensure that the additional linker paths are added before the system paths where xorg-x11 libraries are installed.

The xorg.conf.d sets ModulePaths for non-xorg module replacements (such as the nvidia glx module), if necessary.

Issues

The widespread testing of eselect-opengl-1.3* has proven some issues with the new design:

  1. xorg-server is unable to handle multiple occurences of Files section gracefully. Therefore, eselect-opengl's generated xorg.conf.d file collides with many user-defined configurations. This has been patched locally and the patch is awaiting upstream review)
  2. There are rumors of arm mali's prioprietary OpenGL implementations requiring applications to be built against its own GLES headers.