From: srs5694 Date: Thu, 20 Nov 2014 22:04:38 +0000 (-0500) Subject: Tweaks for OS X 10.10 (Yosemite) and new support to enable and lock X-Git-Url: https://code.delx.au/refind/commitdiff_plain/f27ce23381e3d1c3bc4f37d74fb6e70a3babc5dd?ds=sidebyside Tweaks for OS X 10.10 (Yosemite) and new support to enable and lock VMX support on Intel CPUs. --- diff --git a/NEWS.txt b/NEWS.txt index 985837f..5ef467f 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,3 +1,17 @@ +0.8.4 (11/??/2014): +------------------- + +- Tweaked default for dont_scan_volumes: Removed "Recovery HD". This change + better suits the needs of OS X 10.10 ("Yosemite") installations, but may + result in some stray Recovery HD entries on some Macs. + +- Updated icons for Fedora and Ubuntu and added an icon for Xubuntu. + +- Added new configuration option, "enable_and_lock_vmx", which sets an + Intel CPU feature that's required for some types of virtualization to + work. Most EFIs enable setting this feature in their own setup utilities, + but some (such as most Macs) don't. + 0.8.3 (7/6/2014): ----------------- diff --git a/docs/refind/configfile.html b/docs/refind/configfile.html index 6dccbb6..5d47e93 100644 --- a/docs/refind/configfile.html +++ b/docs/refind/configfile.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Originally written: 3/14/2012; last Web page update: -7/6/2014, referencing rEFInd 0.8.3

+7/28/2014, referencing rEFInd 0.8.3

This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!

@@ -130,7 +130,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

-

Many casual users will be able to use rEFInd without making changes to its settings; in its default configuration, the boot manager automatically detects all the EFI boot loader programs you have on your ESP (or your OS X boot partition, in the case of Macs) and displays icons for them. On Macs, rEFInd also presents legacy BIOS boot options by default. Sometimes, though, you may want to tweak rEFInd's configuration. Sometimes you can obtain your desired results by adjusting the filenames of your boot loaders. Other times, you can edit rEFInd's configuration file, refind.conf, which resides in the same directory as its binary file (refind_x64.efi or whatever you've renamed it).

+

Many casual users will be able to use rEFInd without making changes to its settings; in its default configuration, the boot manager automatically detects all the EFI boot loader programs you have on your EFI System Partition (ESP) (or your OS X boot partition, in the case of Macs) and displays icons for them. On Macs, rEFInd also presents legacy BIOS boot options by default. Sometimes, though, you may want to tweak rEFInd's configuration. Sometimes you can obtain your desired results by adjusting the filenames of your boot loaders. Other times, you can edit rEFInd's configuration file, refind.conf, which resides in the same directory as its binary file (refind_x64.efi or whatever you've renamed it).

@@ -330,12 +330,12 @@ timeout 20 dont_scan_volumes or don't_scan_volumes filesystem or partition label(s) - Adds the specified volume or volumes to a volume "blacklist"—these filesystems are not scanned for EFI boot loaders. This may be useful to keep unwanted EFI boot entries, such as for a Macintosh recovery partition, from appearing on the main list of boot loaders. The default value is "Recovery HD", LRS_ESP, to keep the Mac OS X and Lenovo Windows recovery volumes from appearing. (These should get their own tools icon instead—see the showtools token.) Note that on a Macintosh with whole-disk encryption, you may need to uncomment this token and leave "Recovery HD" off the list to boot the system. You can use dont_scan_volumes to hide disks or partitions from legacy-mode scans, too. In this case, you can enter any part of the description that appears beneath the icons to hide entries that include the string you specify. + Adds the specified volume or volumes to a volume "blacklist"—these filesystems are not scanned for EFI boot loaders. This may be useful to keep unwanted EFI boot entries, such as for a Macintosh recovery partition, from appearing on the main list of boot loaders. The default value is LRS_ESP, to keep the Lenovo Windows recovery volume from appearing. (This volume should get its own tools icon instead—see the showtools token.) You can use dont_scan_volumes to hide disks or partitions from legacy-mode scans, too. In this case, you can enter any part of the description that appears beneath the icons to hide entries that include the string you specify. dont_scan_dirs or don't_scan_dirs directory path(s) - Adds the specified directory or directories to a directory "blacklist"—these directories are not scanned for boot loaders. You may optionally precede a directory path with a volume name and a colon to limit the blacklist to that volume; otherwise all volumes are affected. For instance, EFI/BOOT prevents scanning the EFI/BOOT directory on all volumes, whereas ESP:EFI/BOOT blocks scans of EFI/BOOT on the volume called ESP but not on other volumes. You can use a filesystem number, as in fs0, in place of a volume name. This token may be useful to keep duplicate boot loaders out of the menu; or to keep drivers or utilities out of the boot menu, if you've stored them in a subdirectory of EFI. This option takes precedence over also_scan_dirs; if a directory appears in both lists, it will not be scanned. To add directories to the default list rather than replace the list, specify + as the first option, as in dont_scan_dirs + EFI/dontscan. + Adds the specified directory or directories to a directory "blacklist"—these directories are not scanned for boot loaders. You may optionally precede a directory path with a volume name and a colon to limit the blacklist to that volume; otherwise all volumes are affected. For instance, EFI/BOOT prevents scanning the EFI/BOOT directory on all volumes, whereas ESP:EFI/BOOT blocks scans of EFI/BOOT on the volume called ESP but not on other volumes. You can use a filesystem number, as in fs0, in place of a volume name. This token may be useful to keep duplicate boot loaders out of the menu; or to keep drivers or utilities out of the boot menu, if you've stored them in a subdirectory of EFI. This option takes precedence over also_scan_dirs; if a directory appears in both lists, it will not be scanned. To add directories to the default list rather than replace the list, specify + as the first option, as in dont_scan_dirs + EFI/dontscan. The default for this token is EFI/tools, EFI/tools/memtest86, EFI/tools/memtest, EFI/memtest86, EFI/memtest, com.apple.recovery.boot. dont_scan_files or don't_scan_files diff --git a/docs/refind/drivers.html b/docs/refind/drivers.html index 3c06aed..14b5a5c 100644 --- a/docs/refind/drivers.html +++ b/docs/refind/drivers.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Originally written: 4/19/2012; last Web page update: -7/6/2014, referencing rEFInd 0.8.3

+7/28/2014, referencing rEFInd 0.8.3

This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!

@@ -163,7 +163,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

-
  • You can load a filesystem driver to gain access to files on a filesystem other than FAT (or HFS+ on Macs or ISO-9660 on some systems). This is most likely to be useful on a Linux installation, since a filesystem driver can enable you to store a Linux kernel with EFI stub loader or for use by ELILO on a Linux-native filesystem if your ESP is getting crowded.
  • +
  • You can load a filesystem driver to gain access to files on a filesystem other than FAT (or HFS+ on Macs or ISO-9660 on some systems). This is most likely to be useful on a Linux installation, since a filesystem driver can enable you to store a Linux kernel with EFI stub loader or for use by ELILO on a Linux-native filesystem if your EFI System Partition (ESP) is getting crowded.
  • You can load a driver for a plug-in disk controller to give the EFI access to its disks. Note that this is not required if you place your boot loader (and perhaps your OS kernel) on another disk, or if the plug-in disk controller includes EFI-capable firmware. It could be handy, perhaps in conjunction with a filesystem driver, to enable the EFI to read a boot loader or kernel from a disk on a plug-in controller, though.
  • diff --git a/docs/refind/getting.html b/docs/refind/getting.html index b26523b..0c0b517 100644 --- a/docs/refind/getting.html +++ b/docs/refind/getting.html @@ -293,11 +293,6 @@ computer.

    collection—This site creates packages for a number of OSes using its own packaging system. -
  • Slackware—Although it doesn't seem to provide an official - build, this - site has links to rEFInd binary packages for Slackware 13.37 and - 14.0.
  • -

    To the best of my knowledge, no other Linux distribution yet includes rEFInd in its repositories. That's likely to change in time. If you hear of rEFInd being included in an OS's official package set, feel free to drop me a line.

    diff --git a/docs/refind/index.html b/docs/refind/index.html index 6df301e..e7634bf 100644 --- a/docs/refind/index.html +++ b/docs/refind/index.html @@ -156,6 +156,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

  • Installing rEFInd—Instructions for installing rEFInd, using Linux, OS X, and Windows
  • +
  • rEFInd and OS X 10.10 (Yosemite)—Apple's latest OS X makes some changes that require your attention
  • +
  • Using rEFInd—Basic usage instructions for the boot loader
  • Configuring the Boot Manager—For advanced users, information on customizing a rEFInd installation
  • diff --git a/docs/refind/installing.html b/docs/refind/installing.html index 6e78b65..ec81622 100644 --- a/docs/refind/installing.html +++ b/docs/refind/installing.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    Originally written: 3/14/2012; last Web page update: -7/6/2014, referencing rEFInd 0.8.3

    +8/14/2014, referencing rEFInd 0.8.3

    This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!

    @@ -132,7 +132,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    Don't be scared by the length of this page! Only portions of this page apply to any given user, and most people can install rEFInd from an RPM or Debian package in a matter of seconds or by using the install.sh script in minute or two.

    -

    Once you've obtained a rEFInd binary file, you must install it to your computer's ESP (or conceivably to some other location). The details of how you do this depend on your OS and your computer (UEFI-based PC vs. Macintosh). The upcoming sections provide details. See the Contents sidebar to the left for links to specific installation procedures. For most Linux users, an RPM or Debian package is the best way to go. If your Linux system doesn't support these formats, though, or if you're running OS X, using the install.sh script can be a good way to go. If you're using Windows, you'll have to install manually.

    +

    Once you've obtained a rEFInd binary file, you must install it to your computer's EFI System Partition (ESP) (or conceivably to some other location). The details of how you do this depend on your OS and your computer (UEFI-based PC vs. Macintosh). The upcoming sections provide details. See the Contents sidebar to the left for links to specific installation procedures. For most Linux users, an RPM or Debian package is the best way to go. If your Linux system doesn't support these formats, though, or if you're running OS X, using the install.sh script can be a good way to go. If you're using Windows, you'll have to install manually.

    @@ -218,7 +218,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    Either command produces output similar to that described for using the install.sh script, so you can check it for error messages and other signs of trouble. The package file installs rEFInd and registers it with the EFI to be the default boot loader. The script that runs as part of the installation process tries to determine if you're using Secure Boot, and if so it will try to configure rEFInd to launch using shim; however, this won't work correctly on all systems. Ubuntu 12.10 users who are booting with Secure Boot active should be wary, since the resulting installation will probably try to use Ubuntu's version of shim, which won't work correctly with rEFInd.

    -

    If you're using Ubuntu, you should be able to install the PPA as follows:

    + +

    If you're using Ubuntu, you should be able to install the PPA as follows:

    $ sudo apt-add-repository ppa:rodsmith/refind
     $ sudo apt-get update
    @@ -584,13 +585,11 @@ $ ioreg -l -p IODeviceTree | grep firmware-abi
     
     
  • Type cd EFI\refind to change into the refind subdirectory
  • -
  • Type del refind_ia32.efi to delete the unused 32-bit version of rEFInd. (Windows only supports EFI boots on 64-bit EFI implementations and in 64-bit versions of Windows.)
  • - -
  • Optionally type rd /s drivers_ia32 to delete the drivers_ia32 directory and its contents. You may also want to selectively delete some of the drivers in the drivers_x64 directory, depending on your needs. Unnecessary drivers may slow the rEFInd start process. See the page on drivers for more on this topic.
  • +
  • You may want to selectively delete some of the drivers in the drivers_x64 or drivers_ia32 directory, depending on your architecture and needs. Unnecessary drivers will slow the rEFInd start process. See the page on drivers for more on this topic.
  • Type rename refind.conf-sample refind.conf to rename rEFInd's configuration file.
  • -
  • Type bcdedit /set {bootmgr} path \EFI\refind\refind_x64.efi to set rEFInd as the default EFI boot program. Note that {bootmgr} is entered as such; that's not a notation for a variable.
  • +
  • Type bcdedit /set {bootmgr} path \EFI\refind\refind_x64.efi to set rEFInd as the default EFI boot program. Note that {bootmgr} is entered as such; that's not a notation for a variable. Also, change refind_x64.efi to refind_ia32.efi on systems with 32-bit EFIs. Such computers are rare, and most of them are tablets. Check your Windows bit depth to determine which binary you should use.
  • If you like, type bcdedit /set {bootmgr} description "rEFInd description" to set a description (change rEFInd description as you see fit).
  • @@ -602,7 +601,7 @@ $ ioreg -l -p IODeviceTree | grep firmware-abi
  • You can rename files on the ESP. as described in the next section, Alternative Naming Options.
  • -
  • You can boot from an optical disc into an emergency OS to do the job. Ubuntu, for instance, provides an EFI-bootable installer with a "try before installation" mode. You'll need to type sudo apt-get install efibootmgr to install efibootmgr, but you can then use that program as described earlier. (If you're using Ubuntu, you'll need to precede the command with sudo.
  • +
  • You can boot from an optical disc into an emergency OS to do the job. Ubuntu, for instance, provides an EFI-bootable installer with a "try before installation" mode. You'll need to type sudo apt-get install efibootmgr to install efibootmgr, but you can then use that program as described earlier. (If you're using Ubuntu, you'll need to precede the command with sudo. If you use an Ubuntu image, you can install rEFInd via its PPA, which is an easy way to do the job. (In fact, the rEFInd PPA depends on the efibootmgr package, so you shouldn't need to manually install it.) The PPA approach may even be easier than installing from Windows using its tools, at least if you're familiar with Linux and have an Ubuntu desktop image handy.
  • You may be able to use rEFInd's bootable CD image to use rEFInd to boot an OS that's been installed but rendered inoperable because of changes to your boot order. You can then use efibootmgr, bless, or some other tool to restore rEFInd as the default boot loader.
  • @@ -1057,7 +1056,7 @@ Boot0007* CD/DVD Drive

    Go to the main rEFInd page

    -

    Learn how to use rEFInd

    +

    Comments on rEFInd and OS X 10.10 (Yosemite)

    Return to my main Web page.

    diff --git a/docs/refind/linux.html b/docs/refind/linux.html index 66fa9f5..42a4b6e 100644 --- a/docs/refind/linux.html +++ b/docs/refind/linux.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    Originally written: 3/19/2012; last Web page update: -7/6/2014, referencing rEFInd 0.8.3

    +7/28/2014, referencing rEFInd 0.8.3

    This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!

    @@ -190,8 +190,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

  • Copy the relevant driver file for your filesystem and architecture to the drivers or drivers_arch - subdirectory of the rEFInd installation directory on the ESP. You may - need to create this subdirectory, too.
  • + subdirectory of the rEFInd installation directory on the EFI System + Partition (ESP). You may need to create this subdirectory, too.
  • Create a refind_linux.conf file in your /boot directory. The mkrlconf.sh script that comes with rEFInd diff --git a/docs/refind/secureboot.html b/docs/refind/secureboot.html index 82b4517..9141033 100644 --- a/docs/refind/secureboot.html +++ b/docs/refind/secureboot.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    Originally written: 11/13/2012; last Web page update: -7/6/2014, referencing rEFInd 0.8.3

    +7/28/2014, referencing rEFInd 0.8.3

    This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!

    @@ -205,7 +205,7 @@ Windows 8, this isn't an option for it. Unfortunately, the shim and PreLoader pr -

    PreLoader is easier to set up on a distribution that doesn't support shim because PreLoader doesn't rely on keys; instead, you tell it which binaries you trust and it will let you launch them. This works well on a system with boot managers, boot loaders, and kernels that seldom change. It's not a good solution for distribution maintainers, though, because it requires that users manually add binaries to PreLoader's list of approved binaries when the OS is installed and every time those binaries change. Also, PreLoader relies on a helper program, HashTool, to enroll hashes. (This is Geek for "tell the computer that a binary is OK.") Unfortunately, HashTool can enroll hashes only from the partition from which it was launched, so if you want to use rEFInd to launch Linux kernels directly, it's easiest if you mount your ESP at /boot in Linux or copy your kernels to the ESP. Another approach is to copy HashTool.efi to the partition that holds your kernel and rename it to almost anything else. rEFInd will then treat it like an OS boot loader and create a menu entry for it, enabling you to launch it as needed.

    +

    PreLoader is easier to set up on a distribution that doesn't support shim because PreLoader doesn't rely on keys; instead, you tell it which binaries you trust and it will let you launch them. This works well on a system with boot managers, boot loaders, and kernels that seldom change. It's not a good solution for distribution maintainers, though, because it requires that users manually add binaries to PreLoader's list of approved binaries when the OS is installed and every time those binaries change. Also, PreLoader relies on a helper program, HashTool, to enroll hashes. (This is Geek for "tell the computer that a binary is OK.") Unfortunately, HashTool can enroll hashes only from the partition from which it was launched, so if you want to use rEFInd to launch Linux kernels directly, it's easiest if you mount your EFI System Partition (ESP) at /boot in Linux or copy your kernels to the ESP. Another approach is to copy HashTool.efi to the partition that holds your kernel and rename it to almost anything else. rEFInd will then treat it like an OS boot loader and create a menu entry for it, enabling you to launch it as needed.

    Beginning with version 0.5.0, rEFInd can communicate with the shim system to authenticate boot loaders. If a boot loader has been signed by a valid UEFI Secure Boot key, a valid shim key, or a valid MOK key, rEFInd will launch it. rEFInd will also launch unsigned boot loaders or those with invalid signatures if Secure Boot is disabled in or unsupported by the firmware. (If that's your situation, you needn't bother reading this page.) PreLoader is designed in such a way that it requires no explicit support in rEFInd to work.

    diff --git a/docs/refind/themes.html b/docs/refind/themes.html index 0960860..3b1c8dd 100644 --- a/docs/refind/themes.html +++ b/docs/refind/themes.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    Originally written: 4/19/2012; last Web page update: -7/6/2014, referencing rEFInd 0.8.3

    +11/6/2014, referencing rEFInd 0.8.3

    This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!

    @@ -288,6 +288,10 @@ to be tedious.

  • Zhu Qunying has created a Slackware-themed banner logo for rEFInd. Although it's not a full theme, I thought I'd mention it here.
  • +
  • naymlezwun has created an OS X theme for rEFInd.
  • + +
  • jamaladdeen on deviantART has created an OS X theme that resembles the OS X environment.
  • +

    If you've created or discovered another rEFInd theme, please tell me about it so that I can provide a link to it from this page.

    diff --git a/docs/refind/todo.html b/docs/refind/todo.html index df3d665..13cd4cb 100644 --- a/docs/refind/todo.html +++ b/docs/refind/todo.html @@ -329,6 +329,17 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    stanzas override auto-detected boot loader definitions for the same boot loader file. +
  • Along similar lines, some users have asked for a way to take + detected boot programs and create a set of manual boot stanzas for + them, so that they can be modified manually.
  • + +
  • GRUB provides a configuration-file command called outb + that enables manipulating hardware registers. Something similar, + via the mm command, can be done in the EFI shell. I'd like + to add such a feature to rEFInd, since it enables doing things like + disabling one or another video output on Macs with two video + cards.
  • +
  • I have thoughts about creating an EFI configuration tool and information utility—something to tell you about your hard disks, enable you to manage MOKs, adjust boot loader priority in diff --git a/docs/refind/using.html b/docs/refind/using.html index 42b4354..08f19da 100644 --- a/docs/refind/using.html +++ b/docs/refind/using.html @@ -148,6 +148,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

  • Booting Legacy OSes
  • +
  • Reducing Startup Delays
  • + @@ -266,7 +268,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    F10 - Saves an image of the current screen in the file screenshot_###.bmp, where ### is a sequence number starting with 001, in the ESP's root directory + Saves an image of the current screen in the file screenshot_###.bmp, where ### is a sequence number starting with 001, in the EFI System Partition's (ESP's) root directory F12 or (on some keyboards) Eject @@ -346,6 +348,36 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    On both PCs and Macs, if you see non-functional legacy boot options, you can remove them by using the dont_scan_volumes token in refind.conf: Add any substring from the description that appears when you highlight the non-functional option to the set of options to have rEFInd ignore that entry. (Note that you must provide a complete volume name when excluding EFI volumes from scanning. The legacy-mode exclusion operation is more flexible in this regard.)

    + +

    Reducing Startup Delays

    +
    + +

    You may discover that rEFInd takes a while to appear on the screen compared to other boot managers and boot loaders. Ultimately, the reason is that rEFInd is doing more—it's reading more filesystems, scanning for bootable files, and so on. In most cases, rEFInd takes just a second or two longer than other boot loaders, but I've heard of (and seen) much longer delays on computers that are configured sub-optimally. Some things you can do to reduce these delays include:

    + + + +

    I hope these tips will help you to overcome any speed problems you're experiencing. As I said, rEFInd is reasonably fast on many computers, so you might not run into problems in the first place. If you do, though, reducing rEFInd's workload can help.

    +

    copyright © 2012–2014 by Roderick W. Smith

    diff --git a/icons/os_fedora.png b/icons/os_fedora.png index f977cdc..310f64a 100644 Binary files a/icons/os_fedora.png and b/icons/os_fedora.png differ diff --git a/icons/os_ubuntu.png b/icons/os_ubuntu.png index 344785d..11b614b 100644 Binary files a/icons/os_ubuntu.png and b/icons/os_ubuntu.png differ diff --git a/install.sh b/install.sh index 67df9ee..50748d3 100755 --- a/install.sh +++ b/install.sh @@ -765,7 +765,7 @@ FindMountedESP() { InstallDir=`echo $EspLine | cut -d " " -f 6` if [[ -n "$InstallDir" ]] ; then - EspFilesystem=`grep "$InstallDir" /etc/mtab | uniq | grep -v autofs | cut -d " " -f 3` + EspFilesystem=`grep -w "$InstallDir" /etc/mtab | uniq | grep -v autofs | cut -d " " -f 3` fi if [[ $EspFilesystem != 'vfat' ]] ; then FindLinuxESP diff --git a/refind.conf-sample b/refind.conf-sample index b9b46eb..ab7cd66 100644 --- a/refind.conf-sample +++ b/refind.conf-sample @@ -251,26 +251,25 @@ timeout 20 # OSes' file browsers. # For legacy-mode scans, you can specify any subset of the boot loader # description shown when you highlight the option in rEFInd. -# The default is "Recovery HD,LRS_ESP". +# The default is "LRS_ESP". # #dont_scan_volumes "Recovery HD" # Directories that should NOT be scanned for boot loaders. By default, # rEFInd doesn't scan its own directory, the EFI/tools directory, the -# EFI/memtest directory, or the EFI/memtest86 directory. Using the -# dont_scan_dirs option enables you to "blacklist" other directories; -# but note that using this option removes the EFI/memtest and -# EFI/memtest86 directories, so if you don't want them scanned, be -# sure to include them in your new list. You might use this token to -# keep EFI/boot/bootx64.efi out of the menu if that's a duplicate of -# another boot loader or to exclude a directory that holds drivers -# or non-bootloader utilities provided by a hardware manufacturer. If -# a directory is listed both here and in also_scan_dirs, dont_scan_dirs -# takes precedence. Note that this blacklist applies to ALL the -# filesystems that rEFInd scans, not just the ESP, unless you precede -# the directory name by a filesystem name, as in "myvol:EFI/somedir" -# to exclude EFI/somedir from the scan on the myvol volume but not on -# other volumes. +# EFI/memtest directory, the EFI/memtest86 directory, or the +# com.apple.recovery.boot directory. Using the dont_scan_dirs option +# enables you to "blacklist" other directories; but be sure to use "+" +# as the first element if you want to continue blacklisting existing +# directories. You might use this token to keep EFI/boot/bootx64.efi out +# of the menu if that's a duplicate of another boot loader or to exclude +# a directory that holds drivers or non-bootloader utilities provided by +# a hardware manufacturer. If a directory is listed both here and in +# also_scan_dirs, dont_scan_dirs takes precedence. Note that this +# blacklist applies to ALL the filesystems that rEFInd scans, not just +# the ESP, unless you precede the directory name by a filesystem name, +# as in "myvol:EFI/somedir" to exclude EFI/somedir from the scan on the +# myvol volume but not on other volumes. # #dont_scan_dirs ESP:/EFI/boot,EFI/Dell,EFI/memtest86 @@ -343,6 +342,17 @@ timeout 20 #default_selection Maintenance 23:30 2:00 #default_selection "Maintenance,OS X" 1:00 2:30 +# Enable VMX bit and lock the CPU MSR if unlocked. +# On some Intel Apple computers, the firmware does not lock the MSR 0x3A. +# The symptom on Windows is Hyper-V not working even if the CPU +# meets the minimum requirements (HW assisted virtualization and SLAT) +# DO NOT SET THIS EXCEPT ON INTEL CPUs THAT SUPPORT VMX! See +# http://www.thomas-krenn.com/en/wiki/Activating_the_Intel_VT_Virtualization_Feature! +# for more on this subject. +# The default is false: Don't try to enable and lock the MSR. +# +#enable_and_lock_vmx false + # Include a secondary configuration file within this one. This secondary # file is loaded as if its options appeared at the point of the "include" # token itself, so if you want to override a setting in the main file, @@ -411,7 +421,7 @@ menuentry Linux { # its GRUB 2 boot loader. Note uses of Linux-style forward slashes menuentry Ubuntu { loader /EFI/ubuntu/grubx64.efi - icon /EFI/refined/icons/os_linux.png + icon /EFI/refind/icons/os_linux.png disabled } diff --git a/refind/config.c b/refind/config.c index 7afb529..ba0c06b 100644 --- a/refind/config.c +++ b/refind/config.c @@ -669,6 +669,9 @@ VOID ReadConfig(CHAR16 *FileName) } else if (StriCmp(TokenList[0], L"max_tags") == 0) { HandleInt(TokenList, TokenCount, &(GlobalConfig.MaxTags)); + } else if (StriCmp(TokenList[0], L"enable_and_lock_vmx") == 0) { + GlobalConfig.EnableAndLockVMX = HandleBoolean(TokenList, TokenCount); + } else if ((StriCmp(TokenList[0], L"include") == 0) && (TokenCount == 2) && (StriCmp(FileName, GlobalConfig.ConfigFilename) == 0)) { if (StriCmp(TokenList[1], FileName) != 0) { diff --git a/refind/config.h b/refind/config.h index 8b75288..6e903f3 100644 --- a/refind/config.h +++ b/refind/config.h @@ -82,7 +82,7 @@ typedef struct { #define CONFIG_FILE_NAME L"refind.conf" // Note: Below is combined with MOK_NAMES to make default #define DONT_SCAN_FILES L"shim.efi,shim-fedora.efi,shimx64.efi,PreLoader.efi,TextMode.efi,ebounce.efi,GraphicsConsole.efi,bootmgr.efi" -#define DONT_SCAN_VOLUMES L"Recovery HD,LRS_ESP" +#define DONT_SCAN_VOLUMES L"LRS_ESP" #define ALSO_SCAN_DIRS L"boot" EFI_STATUS ReadFile(IN EFI_FILE_HANDLE BaseDir, CHAR16 *FileName, REFIT_FILE *File, UINTN *size); diff --git a/refind/global.h b/refind/global.h index 4397db8..fc43038 100644 --- a/refind/global.h +++ b/refind/global.h @@ -246,6 +246,7 @@ typedef struct { BOOLEAN TextOnly; BOOLEAN ScanAllLinux; BOOLEAN DeepLegacyScan; + BOOLEAN EnableAndLockVMX; UINTN RequestedScreenWidth; UINTN RequestedScreenHeight; UINTN BannerBottomEdge; diff --git a/refind/main.c b/refind/main.c index 1efadf6..e83940b 100644 --- a/refind/main.c +++ b/refind/main.c @@ -139,8 +139,8 @@ static REFIT_MENU_SCREEN MainMenu = { L"Main Menu", NULL, 0, NULL, 0, NULL L"Insert or F2 for more options; Esc to refresh" }; static REFIT_MENU_SCREEN AboutMenu = { L"About", NULL, 0, NULL, 0, NULL, 0, NULL, L"Press Enter to return to main menu", L"" }; -REFIT_CONFIG GlobalConfig = { FALSE, TRUE, FALSE, 0, 0, 0, DONT_CHANGE_TEXT_MODE, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, 0, 0, - { DEFAULT_BIG_ICON_SIZE / 4, DEFAULT_SMALL_ICON_SIZE, DEFAULT_BIG_ICON_SIZE }, BANNER_NOSCALE, +REFIT_CONFIG GlobalConfig = { FALSE, TRUE, FALSE, FALSE, 0, 0, 0, DONT_CHANGE_TEXT_MODE, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, + 0, 0, { DEFAULT_BIG_ICON_SIZE / 4, DEFAULT_SMALL_ICON_SIZE, DEFAULT_BIG_ICON_SIZE }, BANNER_NOSCALE, NULL, NULL, CONFIG_FILE_NAME, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, { TAG_SHELL, TAG_MEMTEST, TAG_GDISK, TAG_APPLE_RECOVERY, TAG_WINDOWS_RECOVERY, TAG_MOK_TOOL, TAG_ABOUT, TAG_SHUTDOWN, TAG_REBOOT, TAG_FIRMWARE, 0, 0, 0, 0, 0, 0 } @@ -169,7 +169,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.3"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.3.2"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2014 Roderick W. Smith"); @@ -434,10 +434,33 @@ static VOID StoreLoaderName(IN CHAR16 *Name) { // EFI OS loader functions // +// See http://www.thomas-krenn.com/en/wiki/Activating_the_Intel_VT_Virtualization_Feature +// for information on Intel VMX features +static VOID DoEnableAndLockVMX(VOID) +{ + UINT32 msr = 0x3a; + UINT32 low_bits = 0, high_bits = 0; + + // is VMX active ? + __asm__ volatile ("rdmsr" : "=a" (low_bits), "=d" (high_bits) : "c" (msr)); + + // enable and lock vmx if not locked + if ((low_bits & 1) == 0) { + high_bits = 0; + low_bits = 0x05; + msr = 0x3a; + __asm__ volatile ("wrmsr" : : "c" (msr), "a" (low_bits), "d" (high_bits)); + } +} // VOID DoEnableAndLockVMX + static VOID StartLoader(LOADER_ENTRY *Entry, CHAR16 *SelectionName) { UINTN ErrorInStep = 0; + if (GlobalConfig.EnableAndLockVMX) { + DoEnableAndLockVMX(); + } + BeginExternalScreen(Entry->UseGraphicsMode, L"Booting OS"); StoreLoaderName(SelectionName); StartEFIImage(Entry->DevicePath, Entry->LoadOptions, TYPE_EFI,