Bios and booting linux

Содержание
  1. Ubuntu Documentation
  2. Original attempt
  3. Not stable enough to survive certain updates
  4. Detailed instructions
  5. Make a system bootable in UEFI as well as BIOS
  6. A. Make an install CD/DVD/USB drive from a current Ubuntu 64-bit desktop iso file
  7. B. Boot into UEFI mode from the install drive
  8. C. Connect a target USB pendrive, where the system is to be installed
  9. D. Wipe the target USB pendrive if necessary
  10. E. Start gparted
  11. F. Device — Create partition table — Advanced — gpt
  12. G. [If complaint about rebooting]
  13. H. Create partitions
  14. I. Check partitions
  15. J. Check that you are still in UEFI mode
  16. K. Reboot into the installer
  17. L. Shutdown
  18. M. Boot into the target drive. It should boot in UEFI mode
  19. N. Change the computer’s setting from UEFI to BIOS (sometimes called CSM)
  20. O. Boot into the installer in BIOS mode. Try Ubuntu without installing
  21. P. Repair grub (in BIOS mode)
  22. Q. Similar to K. but now in BIOS mode
  23. R. Repeat P. Repair grub (in BIOS mode)
  24. S. Shutdown
  25. T. Boot into the target drive. It should boot in BIOS mode
  26. U. Reboot
  27. V. Repeat [only if necessary]
  28. Final tweaks
  29. Ubuntu Documentation
  30. Introduction
  31. Non-Mac UEFI systems
  32. Apple Mac EFI systems
  33. Caution for Mac owners
  34. Setting up GRUB2 (U)EFI
  35. Detect (U)EFI firmware processor architecture
  36. Building GRUB2 (U)EFI
  37. Install GRUB2 in (U)EFI systems
  38. Make the firmware launch GRUB2 (U)EFI as default
  39. Non-Mac x86_64 UEFI systems
  40. Apple Mac EFI systems (both EFI architecture)
  41. Via rEFIt/rEFInd
  42. Using Apple bootloader itself (safest option)
  43. Blessing grub.efi (Grub2 as the only bootloader)
  44. Selecting the (U)EFI Graphic Protocol
  45. Non-Mac UEFI systems
  46. Apple Mac EFI systems
  47. Selecting the graphic card
  48. Non-Mac x86_64 UEFI specific info
  49. Chainloading Windows x86_64 UEFI-GPT
  50. Apple Mac EFI specific info
  51. Loading OSX
  52. Chainloading BIOS operating systems
  53. Loading Linux
  54. Enabling framebuffer console
  55. Configuring X.org
  56. Linux boot options
  57. Key mapping
  58. Tested configurations
  59. Troubleshooting
  60. Live CD is not a Boot Option
  61. Kernel unbootable without noefi
  62. Kernel Panic on Reboot
  63. Page Attribute Table problem
  64. Display stuck after grub output
  65. Corrupted initial RAM disk
  66. Apple Mac EFI specific info
  67. Distorted screen picture
  68. IRQ assignment errors
  69. Display seems stuck after grub output
  70. Wrong graphic card is activated
  71. Workaround in case grub cannot determine the graphic properties
  72. Miscellaneous info
  73. UEFI Shell
  74. Alternatives
  75. grub 1 EFI (aka grub-legacy)
  76. efilinux
  77. EFI Stub Loader
  78. Feedback
  79. References

Ubuntu Documentation

Original attempt

The method described and the ‘final product’ as a compressed image file worked for me in a Toshiba notebook according to the following specification.

It was also tested in a middle-aged HP computer where it worked in BIOS and UEFI when chainloaded. That computer does not boot from grub via USB (which is independent of the BIOS-UEFI issue).

This web page describes how to install a portable Ubuntu system, that boots in UEFI as well as BIOS mode.

Not stable enough to survive certain updates

I expected that it could be installed into a USB pendrive as a good alternative to a persistent live system, possible to update and upgrade without limits. But unfortunately a current update involving a new kernel and updating grub will make it fail to boot. So this system is not stable enough to survive certain updates. It is good only as an illustration of a method to make a bootable drive in UEFI as well as BIOS mode.

It might help to prepare by reading the following link

The following link gives more background information about partitioning

Detailed instructions

Make a system bootable in UEFI as well as BIOS

Instructions how to make an installed system (typically in a USB pendrive) that works with UEFI and BIOS, and is small enough to work in an undersized 8 GB pendrive (7.8 GB).

It is easier to find a fast pendrive of 16 GB or larger size. Look for USB 3 pendrives, move the swap and grow the root partition to use the whole drive.

A. Make an install CD/DVD/USB drive from a current Ubuntu 64-bit desktop iso file

Use standard Ubuntu, Kubuntu, Lubuntu, Xubuntu, Ubuntu Gnome, Ubuntu Studio, Edubuntu .

and check the md5sum with the listed value at https://help.ubuntu.com/community/UbuntuHashes

B. Boot into UEFI mode from the install drive

C. Connect a target USB pendrive, where the system is to be installed

D. Wipe the target USB pendrive if necessary

E. Start gparted

F. Device — Create partition table — Advanced — gpt

You may need to reboot to inform the kernel of the change.

G. [If complaint about rebooting]

Boot into UEFI mode from the install drive, connect the target USB pendrive, and start gparted again.

H. Create partitions

1a. Make a 1 MiB partition without file system (unformatted)

1b. Add the flag bios_grub.

2a. Make a 250 MiB partition with FAT32 file system and the label EFI

2b. Add the boot flag

3. Make a 6838 MiB partition with ext4 file system and the label pendrive (the size and label can be modified to fit the pendrive).

4. Make a 348 MiB swap partition (linux-swap) (the size can be modified to fit the pendrive).

I. Check partitions

J. Check that you are still in UEFI mode

Install Ubuntu (or your favourite flavour of Ubuntu) into the partition ‘pendrive’ (use ‘Something else’ at the partitioning window).

The following instructions assume that you install Ubuntu 12.04.4 LTS desktop 64-bit, but it should work with other current 64-bit systems with minor modifications.

Partition #3 on the target drive should be used as ext4 and have the mount point / and need not be formatted (it was formatted with gparted).

Check that the device for boot loader installation is the same target drive with the root partition (at the bottom of the partitioning window).

Select time zone, language, user name, computer name, password . and let the installer finish.

K. Reboot into the installer

Install Boot-Repair and run it to ‘repair’ the installed system in the target pendrive.

Unmount all partitions of the target pendrive, particularly /dev/sdx3 ‘pendrive’.

Run ‘Recommended repair’

L. Shutdown

Wait for the shutdown process to finish. Remove the install CD/DVD/USB drive.

M. Boot into the target drive. It should boot in UEFI mode

If problems, repeat K, L, M.

Run the command

without any other drive connected or edit manually the file /boot/grub/grub.cfg to get a clean grub menu (remove the menuentries for 30_os-prober)

N. Change the computer’s setting from UEFI to BIOS (sometimes called CSM)

O. Boot into the installer in BIOS mode. Try Ubuntu without installing

P. Repair grub (in BIOS mode)

Q. Similar to K. but now in BIOS mode

Install Boot-Repair and run it to ‘repair’ the installed system in the target pendrive.

Unmount all partitions of the target pendrive, particularly /dev/sdx3 ‘pendrive’.

Run ‘Recommended repair’

R. Repeat P. Repair grub (in BIOS mode)

S. Shutdown

Wait for the shutdown process to finish. Remove the install CD/DVD/USB drive.

T. Boot into the target drive. It should boot in BIOS mode

U. Reboot

Change the computer setting to UEFI and check that it can boot from the target drive.

V. Repeat [only if necessary]

Repeat K. Boot-Repair in UEFI mode and after that repeat P. repair grub in BIOS mode

Final tweaks

Installation/UEFI-and-BIOS/original-attempt (последним исправлял пользователь nio-wiklund 2016-04-10 18:08:18)

The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details

Источник

Ubuntu Documentation

Booting Linux natively on a UEFI system (without BIOS CSM) using GRUB2

Introduction

IMPORTANT: This page is a bit outdated. A newer and simpler documentation about UEFI is available here: UEFI.

UEFI is the firmware that will eventually replace BIOS in commercial PCs. PCs certified for Windows 8 will require UEFI booting by default. Many vendors have started adopting UEFI as their firmware. Some of the notable UEFI firmwares are Phoenix Secure Core Tiano, AMI Aptio, and Insyde H2O.

Caution if you want to dual boot. Due to bug 769669 the boot partition will be formatted. This has resulted in the Windows bootloader being deleted for some users of Ubuntu 11.04 & 11.10. This issue has been resolved in Ubuntu 12.04. To be safe, even on non-Mac machines, you can boot the Mac alternate ISO CD, where the UEFI bootloader has been removed. You can install Linux in BIOS mode, and then set up e grub2 EFI.

Non-Mac UEFI systems

Linux officially supports both the UEFI and BIOS firmware. However Windows supports UEFI only with Vista for x86_64, SP1 and later (on UEFI 1.1), or Windows 7 (on UEFI 2.0), or Windows 8 (on UEFI 1.1), and only with GPT partitioning.

Apple Mac EFI systems

Apple officially supports only EFI booting for Mac OS X, although technically it is possible to boot Mac OS X using BIOS firmware.

Booting Linux using (U)EFI on Intel Macs has the following advantages :

  • For dual-graphic card models, the power-saving card can be used (Nvidia 9400M, Intel GMA HD (aka 5700MHD), Intel GMA HD 3000, or Intel GMA HD 4000), resulting in significantly longer battery life and lower temperatures. Only for Intel graphics, the same is achievable in BIOS mode with the «setpci» command described below.
  • Faster bootloading, because the legacy BIOS does not need to be loaded, and it does not need to search for BIOS bootable disks.
  • SATA disks are accessed in AHCI mode instead of legacy IDE mode, allowing advanced features (native command queuing, aggressive link power management, and more)
  • On Xserve models, there is no legacy BIOS layer, a.k.a. CSM.
  • Use of hard disks larger than 2 TiB (2.2 TB) with GPT partitioning instead of MBR partitions.
Читайте также:  Windows 10 не открываются свойства ipv4

However it also has the following drawbacks :

  • EFI booting is still experimental and not yet supported as a mainstream boot method on Macs, since Apple uses a nonstandard mix of EFI 1.x with some UEFI 2.x functionalities (x86_64, GOP, etc.).
  • Models with Thunderbolt connectors only support external monitors with the discrete graphic card, not with the Intel integrated graphic card (the same limitation is also applicable on MacOS X).
  • Some hardware features might not work reliably : screen brightness control, suspend/resume, etc.
  • Virtual terminals (Ctrl-Alt-function key) might not work with some graphic drivers (they stay black).
  • OS kernel architecture (32 or 64-bit) must be the same as the EFI architecture (unless «eficross» is used, which is available from kernel 3.4)

Caution for Mac owners

In Ubuntu 11.04 (x86_64 only), due to bug 774089, the ISO CD supports UEFI booting and the Ubuntu installer will try to set up the bootloader for (U)EFI boot. But the installer formats the EFI System Partition to FAT16 (even if the filesystem is non-empty) and also uses efibootmgr, therefore Intel Macs may fail to boot due to corrupted firmware. This feature is not recommended on Mac models because it can corrupt the firmware. You will need to reflash the firmware to repair it. The bug was fixed in Ubuntu 11.10.

On Macs use only the Mac alternate ISO CD

Setting up GRUB2 (U)EFI

Detect (U)EFI firmware processor architecture

If you have a non-Mac UEFI system, then you have a x86_64 (aka 64-bit) UEFI 2.x firmware.

Some of the known x86_64 UEFI 2.x firmwares are Phoenix Secure Core Tiano, AMI Aptio, Insyde H2O.

Some of the known systems using these firmwares are Asus EZ Mode BIOS (in Sandy Bridge P67 and H67 motherboards), MSI ClickBIOS, HP Elite Books, Sony Vaio Z series, Lenovo Think Pads (>=2010), many Intel Server and Desktop motherboards

Some machines (all Dell laptops, all new Apple from 2010 on, some Lenovo) have bugs in their UEFI firmware, preventing them from booting (black screen). Linux Kernel 3.0 (and higher versions) includes patches with workarounds for them. It is therefore recommended to use a Linux kernel of version 3.0 or higher.

Pre-2008 Macs usually have i386-efi firmware while >=2008 Macs have mostly x86_64-efi. All Macs capable of running Mac OS X Snow Leopard 64-bit Kernel have x86_64 EFI 1.x firmware.

imac 8,1 has 64-bit EFI.

Type the following command in a MacOS terminal :

32-bit (i386) EFI

64-bit (x86_64) EFI

Also, architecture of your EFI is shown in «refit» -> «about» screen.

Building GRUB2 (U)EFI

Download the latest grub2 source code ZIP file (1.99 as of May 2011).

1.99 is recommended because it supports dual-graphic cards, GOP and contains the «newreloc» feature and btrfs support. (U)EFI booting is broken in grub 1.98.

It is strongly recommended to use a Linux distribution to compile grub2-efi and also that the processor architecture of both the kernel and UEFI firmware match.

Building grub2 requires the following programs to be installed (build dependencies):

Under Ubuntu 12.04 run this command to install the required build dependencies:

For bzr development version checkout

On Mac, if after you’ve installed and configured, when you reboot, rEFIt/rEFInd reports «Error: Unsupported while loading grub.efi», it is likely you compiled the wrong version (64 vs 32 bit). Try the other EFI architecture.

Install GRUB2 in (U)EFI systems

Boot into Linux (any live ISO) preferably in UEFI mode.

Determine your EFI SYSTEM PARTITION or create it (>=100 MiB FAT32 partition — GPT fdisk type code EF00 or GNU Parted ‘boot’ flag in GPT).

Then mount the partition at /mnt/EFISYS (or at any mountpoint you wish). The following code assumes /dev/sda1 to be EFISYS partition.

Then, build an EFI application for GRUB and copy it and the other modules:

Note : The -p «» option is important for creating a portable grub.efi app. Now create a grub.cfg in /mnt/EFISYS/efi/grub :

Make the firmware launch GRUB2 (U)EFI as default

Non-Mac x86_64 UEFI systems

For non-Mac UEFI systems, efibootmgr is used to modify the UEFI Firmware Boot Manager. This requires the kernel to be booted in UEFI mode and that the kernel processor architecture should match the firmware architecture (and ‘noefi’ is NOT used) for ‘efivars’ kernel module to be loaded and efibootmgr to access the boot manager variables. Initially the user is required to manually launch /boot/efi/efi/grub/grub.efi from the firmware itself if grub2-efi was installed in BIOS mode. Then efibootmgr should be run to create the boot entry.

In the above command, /boot/efi/efi/grub/grub/efi can be split up as /boot/efi and /efi/grub/grub.efi, which translates to (/dev/sda) -> partition 1 -> \\EFI\\grub\\grub.efi .

Note the capital EFI, FAT32 file system is case-insensitive since it does not use UTF-8 encoding by default. In that case the firmware uses capital ‘EFI’ instead of small «efi,» although using \\efi\\grub\\grub.efi should be just fine (this will change if the filesystem encoding is UTF-8). Also the path names in UEFI firmware are similar to Microsoft Windows path names and also uses backslashes (they are doubled because the shell interprets «\\» to mean a single backslash). The «label» is any name for your identification; the actual label used does not affect booting the system.

Apple Mac EFI systems (both EFI architecture)

For Macs you can choose any one of the 3 boot methods : rEFIt/rEFInd, Apple, and grub-only.

Via rEFIt/rEFInd

The most flexible way to boot grub EFI is to load it from rEFIt (version 0.14 as of mid-2010; apparently abandoned), or its successor rEFInd (version 0.6.1 as of end-2012). It’s quite easy, just copy grub.efi and related files to /efi/grub/ in any FAT or HFS+ partition, rEFIt/rEFInd will find it automatically and list it in the boot menu, along with the MacOS partition and all BIOS bootable partitions (also those on CD and USB drives). If you install the ext2fs or ReiserFS drivers provided with rEFIt/rEFInd, you can place your boot loader in the root or /efi/grub directory of any ext2fs, ext3fs, or ReiserFS volume, as well. As of rEFInd version 0.6.0, ext4fs drivers are available as well as many other new features.

Using Apple bootloader itself (safest option)

You need to use the following naming convention for grub.efi :

Bootloader path and filename

/EFI/BOOT/BOOTIA32.EFI

/EFI/BOOT/BOOTX64.EFI

When you press the Alt key during boot, your Intel Mac should show the disk as «EFI Boot».

In order to make the partition appear in the Apple boot picker menu, and be selectable as a startup disk, the boot partition should be in HFS+ format and have the following files :

    /mach_kernel : can be empty

/.Volume Icon.icns : optional icon

  • /System/Library/CoreServices/boot.efi : must be bless’ed (see section below) and may be booted, if so should be a symlink to the actual bootloader.
  • /System/Library/CoreServices/SystemVersion.plist which should look something like
  • Blessing grub.efi (Grub2 as the only bootloader)

    If you do not need an alternate (ie safe) boot method, you can configure grub.efi as the only loader. First, place grub.efi in any folder in any HFS+ partition.

    Detect where your grub.efi is stored. For example, in folder /Volumes/something, then uses bless it (type command in MacOS X terminal):

    Alternatively, the command «hfs-bless» from the mactel-boot package can be used under Linux.

    Selecting the (U)EFI Graphic Protocol

    If you are getting this error on the screen upon booting a menu entry

    and if no kernel boot messages are shown, then insert this to your grub.cfg file

    and copy /usr/share/grub/unicode.pf2 (or /usr/share/grub2/unicode.pf2 depending on your distro) to your grub2 efi dir (/boot/efi/efi/grub mostly).

    Otherwise detect which graphics protocol is supported by the firmware to enable only that module

    Non-Mac UEFI systems

    Non Mac systems use only Graphics Output Protocol. Thus efi_gop module should be loaded.

    Apple Mac EFI systems

    For Macs detect the most reliable way to determine whether your hardware model has UGA (Universal Graphics Adapter) or GOP (Graphics Output Protocol) is to select «About rEFIT» in the rEFIt boot screen (or «About rEFInd» for rEFInd), you will see an output like this :

    Depending on the «Screen Output» value, add one of the two following command lists :

    The easiest way is to try the first one, and if you get an error message, try the second one. As a rule of thumb, models released after 2008 (Mac Book5 and higher) should have GOP.

    Читайте также:  При сканировании этого диска возникла проблема windows 10

    Beware that on some Mac models (eg MacBookPro8,x), suspend/resume only works when none of efi_uga and efi_gop are used.

    Selecting the graphic card

    If your model has 2 graphics card and you wish to completely power down the discrete graphic card in order to save more power, you must add

    This uses the IO ports of the «gmux» Apple device (offset 0x700). Under MacOS , the «Apple Graphics Control» driver provides an API used by the MacOS mode switching GUI and by gfxCardStatus.

    Note: After every suspend/resume, the discrete graphic card is powered up again, so you need to disable it through a command line program, which can be executed automatically on each resume by PM-Utils.

    If is also possible to dynamically switch from the integrated to the discrete graphics, see the the patch «Add apple_gmux driver and provide support to use it with vga_switcheroo»

    Significant progress has been implemented recently (as of April 2012) within the Linux Hybrid Graphics project

    Conversely, it is also possible to hide the Intel graphics entirely at the PCI level with the following commands in grub.cfg :

    The first command sets the amount of RAM used for the card and some other settings. The second command is just an enable switch.

    Non-Mac x86_64 UEFI specific info

    Chainloading Windows x86_64 UEFI-GPT

    Find the UUID of the FAT32 filesystem in the UEFI SYSTEM PARTITION where the Windows UEFI Bootloader files reside. For example, if Windows bootmgfw.efi exists at /boot/efi/efi/Microsoft/Boot/bootmgfw.efi (ignore the upper-lower case differences since that is immaterial in FAT fs):

    Then, add this code to grub.cfg to chainload Windows x86_64 (Vista SP1+, 7 or 8) installed in UEFI-GPT mode :

    Apple Mac EFI specific info

    Loading OSX

    To load OSX, use the following section in grub.cfg:

    For debug output, uncomment the «-v» option. Apple’s boot.efi is a Universal EFI binary, which is compatible with both i386 and x86_64 architectures, so the path is valid for all models.

    If your Mac OS X is installed on a partition with FileVault full-disk encryption, you will not be able to chain load Mac OS X from GRUB.

    Chainloading BIOS operating systems

    You can use appleloader to boot from legacy disk/cdrom/usb:

    The last one may not work on some model.

    Loading Linux

    First of all, you need kernel version >=2.6.25 ,

    First, you need to decide whether to use a BIOS dump. BIOS dump is necessary for certain x.org drivers, as they need to scan the video rom for important data structure such as DDC table. Some driver even calls INT 10 to locate VESA BIOS, so the IVT for INT10 needs to be set properly as well.

    To get the BIOS dump, you need to boot into BIOS mode, then use these commands to generate dump files:

    It would create /boot/vbios.bin and /boot/int10.bin to be used by the loadbios command.

    In some cases, BIOS dump is not needed (for instance with NVidia proprietary drivers), or BIOS mode is not supported by the hardware (such as Xserve models). Then you need to use fakebios, so that grub would try to mimic a BIOS environment.

    For Intel cards, you may experience screen distortion in the console mode. To solve this problem, use fix_video command in grub.cfg. Currently, fix_video has been reported to work with Intel 945GM, Intel 965GM and Intel X3100.

    Enabling framebuffer console

    Check whether the framebuffer console («fbcon») is included in your kernel.

    If it is included statically in your kernel («y»), it will work as is. If it is included as a kernel module («m»), the kernel module «fbcon» must be added to the initial RAM disk :

    Configuring X.org

    Sometimes, x.org driver doesn’t work even with BIOS dump. Then you need to use frame buffer instead. In xorg.conf, use fbdev in Device section, it may look like this:

    If your model has 2 graphics card, you must specify the PCI device ID for the active card (the one selected in «Energy Saving» in MacOS X) in xorg.conf, otherwise it will take the first one, which will not be connected to the screen if the second card is active.

    For Mac Book Pro5,x :

    For Mac Book Pro6,x :

    You can obtain the PCI address with the command «lspci», that you can run either in grub2 EFI, either in a Linux terminal in EFI mode.

    Here are the PCI addresses of the dual-graphics models :

    Integrated

    Discrete

    Mac Book Pro5,x

    Mac Book Pro6,x

    Mac Book Pro8,x

    On Mac Book Pro6,x, the screen picture looks distorted when using the Intel integrated graphics. This is because the Intel drivers do not recognize the double LVDS link to the screen when no BIOS initializes it. Problem is described in this discussion. Please recompile your kernel with the «Implement manual override of LVDS single/dual channel mode» patch or mailing list submission, install it, and add the following parameter boot parameters in grub.cfg :

    For kernel 3.5, the patch was included in bug «37742». Beware : the parameter is now spelled «lvds_channel_mode» instead of «lvds_channels».

    Linux boot options

    In some cases, you need to add these options to linux command line.

    This is usually not needed with fakebios/loadbios (DMI can be detected with the bios dump), but if you are still having the ATA timeout or USB not response issue, try this option.

    In 2.6.27-2.6.28, amd64 kernel, there is a bug that would cause EFI to hang. Since 2.6.27, it would only map available RAM, and the EFI runtime needs to be mapped with efi_ioremap. However, efi_ioremap only reserves MAX_EFI_IO_PAGES (100) pages for EFI, which is not enough for Apple 64-bit firmware (about 17M). To workaround this, you need to pass the «noefi» option which tells the kernel to disable EFI. However, some models do not need this workaround (eg Mac Book Pro5,3).

    Alternatively, you can try the following kernel option, explained in EFI implementation bugs :

    Alternatively, you can try the 3.0-rc1 kernel, which contains several EFI-related fixes.

    If everything else fails, you can try a known good workaround by installing the «Run EFI in physical mode» patch for kernel = 2.6.37 . This patch is less recommended because both MacOS and Windows run in virtual mode, so the EFI firmware is better tested when when the operating system runs in virtual mode. Also this patch is known to cause problems when efivars kernel module is used since the module requires EFI virtual mode to work properly.

    then recompile and install the kernel.

    Key mapping

    As Apple Mac EFI doesn’t recognize ctrl sequence, we need to use special key to mimic its function. Define the following mappings in grub.cfg in 1.98 :

    In grub 1.99, you can use the built-in equivalent already defined :

    Tested configurations

    This section contains the list of models on which Linux has been successfully tested in EFI mode.

    Distribution

    Video Driver

    Extra steps

    OK and KO

    Mac Book Air3,2

    Ubuntu 12.04 64-bit

    grub-efi64 1.99

    A NouveauBug means you must use a 3.3 kernel.

    Console and everything works great. Beautiful.

    Mac Book Pro5,3

    Ubuntu 10.04 32-bit

    2.6.32-24-generic-pae

    nvidia-195.36.24

    grub-efi64 1.98

    Need to first boot in BIOS mode, then reboot in EFI mode. «noefi» kernel option.

    No physical terminal with vanilla kernel, reboot and suspend KO

    Mac Book Pro5,3

    Ubuntu 10.10 64-bit

    nvidia-260.19.06

    grub-efi64 1.99

    Reboot and suspend OK, console works at boot but Ctrl-Alt-F1..6 displays black screen

    Mac Book Pro5,1

    Ubuntu 10.04 64-bit

    nvidia-195.36.24

    grub-efi64 1.97

    Works fine with patched «drivers/video/efifb.c» (from kernel 2.6.34 and up) using NVIDIA 9400M

    Mac Book Pro4,1

    Ubuntu 10.10 64-bit

    nvidia-260.19.06-0ubuntu1

    grub-efi 1.99beta

    Model details of «drivers/video/efifb.c» were wrong and needed patching/recompiling

    Mac Book Pro8,3

    Ubuntu 11.04-Beta 64-Bit

    grub-efi trunk, 1.99-rc1 appears to work too

    Requires ‘noefi’

    Booted from external ESATA drive via Express Card. Xorg picks up the Intel video chip and LVDS1 as output, however screen remains blank.

    Ubuntu 10.11 32-bit

    2.6.38-10-generic-pae

    nvidia proprietary

    standard

    just efi_uga and loadbios commands required

    local consoles (ALT-F1) does not work (black screen). AHCI works OK. USB works OK. Interrupts does not work without loadbios neither with noefi nor without

    Mac Book Pro8,3

    Ubuntu 11.10 — Ubuntu 12.04 amd64

    2.6.38 through 3.6.0-rc2

    radeon/intel vga_switcheroo

    grub-efi-amd64 1.99

    I keep a repo of the Ubuntu quantal kernel git merged with what patches I’ve found are required for EFI boot on my 8,3 @ github https://github.com/akatrevorjay/linux||Works great, besides some small glitches here and there with switching between DIS and IGD, you have to do it a few times to get it to switch. Lowered temperatures down 30C

    Troubleshooting

    Live CD is not a Boot Option

    Some ASUS models use Aptio firmware from American Megatrends. It appears some version of the BIOS are case sensitive (for example, version 205 and 208). It looks for the filename EFI/BOOT/bootx64.efi, but Ubuntu provides EFI/BOOT/BOOTX64.EFI. The result is the Live CD is not a Boot Option in the Boot Menu. See https://bugs.launchpad.net/linux/+bug/1261465.

    Читайте также:  При установке windows только курсор

    Kernel unbootable without noefi

    If the kernel fails to boot with noexec=off or reboot_type=k or any other boot option(s) (without noefi) in UEFI mode, recompile the kernel with the following patches (to be applied in order) —

    These patches are included in linux kernel version 3.0-rc7 (as of July 2011).

    Other related patches :

    Kernel Panic on Reboot

    On some Sandy Bridge UEFI systems, the Linux kernel panics. This has been reported on both Arch Linux and Ubuntu. This is due to buggy UEFI firmware which has bugs in its EFI Reboot Runtime Service which the kernel uses for rebooting. Add

    to the kernel command line in grub.cfg to work around this problem. This instructs the kernel to use ACPI and warm reboot.

    Page Attribute Table problem

    Add the following kernel option :

    Display stuck after grub output

    If you use a 32-bit kernel on 64-bit EFI firmware, the following option instructs the kernel not to access the UEFI Runtime Services :

    This happens in some Dell Latitude systems and some Mac Book Pro6,x and 8,x . For those systems, you should use a Linux kernel compiled with the «Run EFI in physical mode» patch.

    Corrupted initial RAM disk

    The initial RAM disk is corrupted by grub 1.98, please see the problem description. Solution : upgrade to grub 1.99. The «newreloc» feature takes cares to avoid overwriting the memory.

    Apple Mac EFI specific info

    Distorted screen picture

    On a Mac Book Pro6,x, the screen picture looks distorted. When loading the i915 module it displays an error in dmesg which has probably something to do with the distortion:

    You need the «Implement manual override of LVDS single/dual channel mode» patch.

    IRQ assignment errors

    These errors can occur as a result of the «noefi» kernel parameter, which can cause problems with IRQ assignments for PCI devices (for instance SATA and USB controllers), so some devices might not be properly recognized. During kernel boot, you will enter a BusyBox prompt and the keyboard is unresponsive.

    When the «noefi» option is used, a side effect on some models (eg Mac Book Pro5,3) is that booting straight into EFI mode does not work : an additional workaround is to first boot any OS in BIOS mode, then reboot in EFI mode. The fastest way is to boot grub BIOS, then press «c» for command-line, then type «reboot», then boot grub EFI, then select the Linux kernel. The cause of the problem or the reason why it acts as a workaround are unclear.

    Display seems stuck after grub output

    If you see the following output with grub 1.98 and no further output afterwards :

    It might not as bad as it looks like. First boot Linux in BIOS mode, and add the following option in your grub.cfg :

    Then reboot Linux in EFI mode.

    Test 1 : The keyboard backlight (if your model has one) should still be on (tested on Ubuntu 10.04). After 10-30 seconds, the keyboard backlight should quickly flash on-off-on, which indicates that Linux is properly booted, but with a headless display and the X Server fails to start.

    Test 2 : Go to another physical machine, and start a SSH connection to your headless Mac. Type the command :

    and you will probably see an output like this :

    -19 stands for ENODEV, which is the «generic» error code returned by the efifb driver when its initialization fails.

    If efifb is successfully initialized, you should see an an output like this :

    Check whether the X Server is started. If not, check the files /var/log/Xorg.[0-n].log for errors.

    Test 3 : Boot in EFI, then force a hardware shutdown by holding down the power button, then reboot in BIOS mode and check the files /var/log/kern.log.[0-n].

    Wrong graphic card is activated

    If your grub 1.98 output looks like the following :

    it means it cannot use the activated graphic card. Debug result : grub_efi_locate_protocol succeeds, but the «get_mode» fails with return code GRUB_EFI_NOT_READY (6). Solution : switch to the other graphic card in MacOS X and reboot. The output should look like the following :

    Workaround in case grub cannot determine the graphic properties

    This step is not needed in normal cases : it is the bootloader’s responsibility (ie grub) to determine the graphics properties and pass them to the kernel in the linux_kernel_params structure. The bootloader uses the EFI boot services for this purpose, which are terminated before control is passed to the kernel. However, if grub cannot determine your graphics properties, you can as a workaround hard-code them in the Linux kernel. Make sure your kernel knows the «Frame Buffer Base» and «Pixels Per Scan Line» for your particular Mac hardware model. Type the following command in a MacOS X 10.5 or 10.6 terminal :

    This gives an output similar to this :

    Beware that different values are possible for the Frame Buffer Base on the same model, depending on the amount of RAM installed for 4GB or less (first hex digit), but possibly also from which PCI devices are active (fourth hex digit). For a dual-graphic card system, 2 values for the Frame Buffer Base are possible, depending on which graphic card was activated when the machine was booted. Any of those 2 values can be used.

    Make sure that the file «drivers/video/efifb.c» of your kernel source has the correct values. If not, please recompile your kernel with the correct hard-coded values, and contribute your values in this forum thread.

    Note that adding the following parameter to the linux kernel command line in grub.cfg is NOT working:

    Miscellaneous info

    UEFI Shell

    The UEFI Shell is a shell/terminal for the firmware which allows launching UEFI applications which include UEFI bootloaders. Apart from that, the shell can also be used to obtain various other information about the system or the firmware like memory map (memmap), running partitioning programs (diskpart), loading UEFI drivers, editing text files (edit), hexedit etc. You can download a BSD licensed UEFI Shell from Intel’s Tianocore EDK2 Sourceforge.net project.

    Use the Beta Shell. If it doesn’t work use the Old shell. Few Asus and other AMI Aptio x86_64 UEFI firmware based motherboards (from Sandy Bridge onwards) provide an option called Launch EFI Shell from filesystem device . For those motherboards, download the x86_64 UEFI Shell and copy it to you EFI SYSTEM PARTITION as /shellx64.efi (mostly /boot/efi/shellx64.efi) .

    Alternatives

    grub BIOS (aka grub-pc) can be used as a fallback, which is more widely tested and supported. On Mac machines with 2 GPUs, it is possible to unhide the Intel GPU with the following command in grub2 BIOS :

    grub 1 EFI (aka grub-legacy)

    The Fedora Core 11 (and higher) Live CD contains a bootable grub EFI 0.97 (the grub-legacy originally patched by Intel for EFI and forked by Red Hat for Fedora Core). The 32-bit edition runs on hardware models with EFI 32-bit and the 64-bit edition runs on hardware models with EFI 64-bit. They are bootable using the Apple bootloader.

    Limitation : if your hardware has UGA graphics, grub-legacy is not able to determine the «Frame Buffer Base» and «Pixels Per Scan Line» for your particular Mac hardware model, because these values are not provided by the EFI API for UGA. With grub-legacy, the workaround using hard-coded values in efifb is necessary. Grub2, however, is able to figure out these values by some PCI scanning code. For Fedora 18, Grub2 will be used in EFI mode; it is already the default for BIOS mode since Fedora 16.

    efilinux

    Ubuntu 12.10 will use Intel’s efilinux as UEFI bootloader in order to comply with Microsoft’s UEFI Secure Boot.

    EFI Stub Loader

    Linux kernel 3.3 can be run as a UEFI application, with the EFI Stub Loader. This method is still highly experimental.

    Feedback

    Any questions, or suggestions ?

    Apple Mac users — Please leave a message in the Ubuntu Apple Users forum (also for non-Ubuntu users) Non-Mac x86_64 UEFI users (Sandy Bridge etc.) — Please open a thread in Ubuntu forums (or) send a mail to help-grub mailing list.

    Bug reports and feature requests should be sent to bug-grub or grub-devel mailing list, not to be posted in the forums.

    Most of the non-Mac info have been copied directly from the Arch Linux grub2 and UEFI pages.

    References

    UEFI Forum — contains the official UEFI Specifications — GUID Partition Table is part of UEFI specification.

    Intel’s Tianocore Project for Open-Source UEFI firmware which includes DuetPkg for direct BIOS based booting and OvmfPkg used in QEMU and Oracle VirtualBox

    Microsoft’s Windows and GPT FAQ — Contains info on Windows UEFI booting also

    UEFIBooting (последним исправлял пользователь trusktr 2014-06-26 18:03:02)

    The material on this wiki is available under a free license, see Copyright / License for details
    You can contribute to this wiki, see Wiki Guide for details

    Источник

    Оцените статью