From 8b9e6b44d9e996a65cc4b81a71e8e6fdc054ea27 Mon Sep 17 00:00:00 2001 From: srs5694 Date: Fri, 4 May 2012 20:52:23 -0400 Subject: [PATCH] Version 0.3.2 release --- NEWS.txt | 15 +++- docs/refind/bootmode.html | 2 +- docs/refind/configfile.html | 19 ++++- docs/refind/drivers.html | 2 +- docs/refind/features.html | 2 +- docs/refind/getting.html | 8 +- docs/refind/index.html | 4 +- docs/refind/installing.html | 154 +++++++++++++++++++++++++++++++++--- docs/refind/linux.html | 2 +- docs/refind/revisions.html | 4 +- docs/refind/themes.html | 2 +- docs/refind/todo.html | 2 +- docs/refind/using.html | 2 +- mkcdimage | 1 + mkdistrib | 4 +- refind.conf-sample | 10 +++ refind/main.c | 10 +-- refind/screen.c | 6 +- 18 files changed, 213 insertions(+), 36 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index 173d904..204c1cd 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,5 +1,16 @@ -0.3.2 (?/??/2012): ------------------- +0.3.2 (5/4/2012): +----------------- + +- Added the install.sh script to install rEFInd on Linux and Mac OS X + systems. This script must be run as root (or via sudo). It requires + no options, but on Mac OS X, passing it the "esp" option causes it + to install rEFInd on the computer's ESP rather than the default of the + currently OS X boot partition. (Under Linux, the default is to install to + the ESP.) Note that there may be some unusual cases in which this script + will fail to work. + +- Does a better job of clearing the screen when launching OSes in text + mode. - Added detection "recipe" for GRUB 2's BIOS Boot Partition. diff --git a/docs/refind/bootmode.html b/docs/refind/bootmode.html index eaef3d4..b2acedb 100644 --- a/docs/refind/bootmode.html +++ b/docs/refind/bootmode.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Originally written: 3/14/2012; last Web page update: -4/27/2012, referencing rEFInd 0.3.1

+5/4/2012, referencing rEFInd 0.3.2

I'm a technical writer and consultant specializing in Linux technologies. 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!

diff --git a/docs/refind/configfile.html b/docs/refind/configfile.html index 35cacb6..56c3813 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: -4/27/2012, referencing rEFInd 0.3.1

+5/4/2012, referencing rEFInd 0.3.2

I'm a technical writer and consultant specializing in Linux technologies. 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!

@@ -309,15 +309,28 @@ menuentry Gentoo { initrd \kernels\initrd-3.3.0-rc7.img options "root=/dev/sda3 ro" } + +menuentry "Windows via shell script" { + icon \EFI\refind\icons\os_win.icns + loader \EFI\tools\shell.efi + options "fs0:\EFI\tools\launch_windows.nsh" +} -

This example sets up two entries: one for Ubuntu Linux and one for Gentoo Linux. Note that the two entries use different directory separators, simply to demonstrate the fact that it's possible. The Ubuntu entry sets no icon, since rEFInd will note that the boot loader is stored in the ubuntu directory, and it will automatically find the appropriate Ubuntu icon (os_ubuntu.icns). This option is, however, disabled, so no matching icon will appear when you reboot unless you first comment out or delete the disabled line.

+

This example sets up three entries: one for Ubuntu Linux, one for Gentoo Linux, and one to launch a shell script. Note that the first two entries use different directory separators, simply to demonstrate the fact that it's possible. The Ubuntu entry sets no icon, since rEFInd will note that the boot loader is stored in the ubuntu directory, and it will automatically find the appropriate Ubuntu icon (os_ubuntu.icns). This option is, however, disabled, so no matching icon will appear when you reboot unless you first comment out or delete the disabled line.

The Gentoo entry begins with an icon specification to be sure that the icon is loaded from the same volume as rEFInd. (If the icon were stored on the same filesystem as the kernel, you'd place the icon line after the volume line.) This entry uses the volume token to tell rEFInd to load the kernel and initial RAM disk file from the filesystem called G_KERNELS. It passes the filename for an initial RAM disk using the initrd line and free-form options using the options line. Note that the kernel filename does not include a .efi extension, which keeps rEFInd from picking up the kernel file in its auto-scans.

-

You can combine these OS stanzas with the global refind.conf options presented earlier. The result would contain just one entry on the rEFInd boot menu, unless rEFInd found other boot options on an external or optical disk.

+

The Windows via shell script entry may seem puzzling, but its purpose is to launch an OS (Windows in this case) after performing additional pre-boot initialization, which is handled by an EFI shell script. This works because you can pass the name of a shell script to an EFI shell—the script is named on the stanza's options line, using EFI file notation. The shell script, in turn, does whatever it needs to do and then launches the OS's boot loader:

+ +
mm 0003003E 8 -pci
+fs0:\EFI\Microsoft\Boot\bootmgfw.efi
+ +

This example writes data to the computer's PCI bus via the EFI shell's mm command and then launches Windows. Chances are you won't need to engage in such operations, and I do not recommend you try this exact example unless you know what you're doing! This command was required to activate the video hardware on a computer of a person with whom I corresponded prior to booting Windows, but such needs are rare.

+ +

You can combine these OS stanzas with the global refind.conf options presented earlier. The result would contain just two entries on the rEFInd boot menu (for Gentoo and Windows, since the Ubuntu entry is disabled), unless rEFInd found other boot options on an external or optical disk.

Creating Submenu Entries

diff --git a/docs/refind/drivers.html b/docs/refind/drivers.html index 40ee0e5..0e25044 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: -4/27/2012, referencing rEFInd 0.3.1

+5/4/2012, referencing rEFInd 0.3.2

I'm a technical writer and consultant specializing in Linux technologies. 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!

diff --git a/docs/refind/features.html b/docs/refind/features.html index 0896f20..9c45522 100644 --- a/docs/refind/features.html +++ b/docs/refind/features.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Originally written: 3/14/2012; last Web page update: -4/27/2012, referencing rEFInd 0.3.1

+5/4/2012, referencing rEFInd 0.3.2

I'm a technical writer and consultant specializing in Linux technologies. 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!

diff --git a/docs/refind/getting.html b/docs/refind/getting.html index a7212cf..9914588 100644 --- a/docs/refind/getting.html +++ b/docs/refind/getting.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Originally written: 3/14/2012; last Web page update: -4/27/2012, referencing rEFInd 0.3.1

+5/4/2012, referencing rEFInd 0.3.2

I'm a technical writer and consultant specializing in Linux technologies. 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!

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

  • Communications diff --git a/docs/refind/installing.html b/docs/refind/installing.html index 1ac51b7..b6bce26 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: -4/27/2012, referencing rEFInd 0.3.1

    +5/4/2012, referencing rEFInd 0.3.2

    I'm a technical writer and consultant specializing in Linux technologies. 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!

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

    -

    Once you've uncompressed a rEFInd binary zip file, you can copy the entire refind directory into your EFI System Partition's (ESP's) EFI directory on UEFI-based PCs, so that rEFInd resides in EFI/refind. If you've tried rEFInd using a CD-R image file, you can copy the files from the EFI/refind directory on the CD to create an equivalent directory on the ESP. To avoid confusion, though, you should delete the rEFInd binary file for the CPU type your computer does not use. To the best of my knowledge, all UEFI-based PCs use 64-bit CPUs, so you should keep the refind_x64.efi binary and delete the refind_ia32.efi binary. Most Intel-based Macs also have 64-bit EFI implementations, so you should do the same thing; but very early Intel-based Macs have 32-bit EFIs (and sometimes 32-bit CPUs), which require the refind_ia32.efi file. You can determine whether your Mac needs the x86-64 or IA32 build by typing the following command in a Mac Terminal window:

    +

    Once you've uncompressed a rEFInd binary zip file, you must install it to your computer's ESP (or conceivably to some other location). The details of how you to this depend on your OS and your computer (UEFI-based PC vs. Macintosh). The upcoming sections provide details. For Linux and Mac OS X, you can use the installation script, install.sh, which provides easy one-command installation on most systems. Occasionally this script will fail, though, so I also provide explicit instructions for Linux and Mac OS X. Installation under Windows also must be done manually. In some cases, you'll have to deviate from the default naming conventions, as described in a section on this topic. If you're upgrading rEFInd, see the section on upgrading. Finally, I describe how to install some additional components you might find useful.

    + + + + +

    Installing rEFInd Using install.sh under Linux or Mac OS X

    + + + +

    If you're using Linux or Mac OS X, the easiest way to install rEFInd is to use the install.sh script. Under Linux, this script installs rEFInd to your disk's ESP. Under Mac OS X, the script installs rEFInd to your current OS X boot partition by default; but you can install to your ESP instead by passing the script the esp option.

    + +

    Before running this script under Linux, you should ensure that your ESP is mounted at /boot or /boot/efi, as described in more detail in the Installing rEFInd Manually Using Linux section. (If you installed Linux in EFI mode, chances are your ESP is properly mounted.) This precaution isn't necessary under OS X.

    + +

    A sample run under Linux looks something like this:

    + +
    +# ./install.sh
    +Installing rEFInd on Linux....
    +ESP was found at /boot/efi using vfat
    +Copied rEFInd binary file refind_x64.efi
    +
    +Copying sample configuration file as refind.conf; edit this file to configure
    +rEFInd.
    +
    +
    +Installation has completed successfully.
    + +

    The output under OS X is a bit different:

    + +
    +$ ./install.sh
    +Not running as root; attempting to elevate privileges via sudo....
    +Password:
    +Installing rEFInd on OS X....
    +Installing rEFInd to the partition mounted at '/'
    +Copied rEFInd binary file refind_ia32.efi
    +
    +Copying sample configuration file as refind.conf; edit this file to configure
    +rEFInd.
    +
    +
    +WARNING: If you have an Advanced Format disk, *DO NOT* attempt to check the
    +bless status with 'bless --info', since this is known to cause disk corruption
    +on some systems!!
    +
    +
    +Installation has completed successfully.
    + +

    In either case, the details of the output differ depending on your existing configuration and how you ran the program. Some details that can affect how the script runs include the following:

    + +
      + +
    • If you run the script as an ordinary user, it attempts to acquire + root privileges by using the sudo command. This works + on Mac OS X and some Linux installations (such as under Ubuntu or if + you've added yourself to the sudo users list), but on some + Linux installations this will fail. On such systems, you should run + install.sh as root.
    • + +
    • Under OS X, you can run the script with a mouse by opening a Terminal + session and then dragging-and-dropping the install.sh file to + the Terminal window. You'll need to press the Return or Enter key to + run the script.
    • + +
    • Under OS X, passing the "esp" option causes the script to install + rEFInd to the ESP. The script finds the first ESP that's identified by + the diskutil program and, if it's not already mounted, mounts + it to install rEFInd. Thus, it's conceivable that install.sh + will install rEFInd to the wrong partition if you have multiple disks + or if a disk has multiple ESPs. If you believe this has happened, you + may need to re-install manually.
    • + +
    • If you're using OS X 10.7's Whole Disk Encryption (WDE) feature, you + must install rEFInd to the ESP, so the esp option to + install.sh is required. I'm still a little bit foggy about + what's required to boot the system once this is done; see this + forum thread for a discussion of the topic.
    • + +
    • If you're using OS X and an Advanced Format disk, heed the warning that + install.sh displays and do not use bless + --info to check your installation status; this combination has + been reported to cause disk corruption on some Macs!
    • + +
    + +

    In any event, you should peruse the script's output to ensure that everything looks OK. install.sh displays error messages when it encounters errors, such as if the ESP is mounted read-only or if you run out of disk space. You may need to correct such problems manually and re-run the script. In some cases you may need to fall back on manual installation, which gives you better control over details such as which partition to use for installation.

    + -

    Installing rEFInd Using Linux

    +

    Installing rEFInd Manually Using Linux

    -

    Accessing the ESP is easiest from Linux: The ESP is usually mounted at /boot/efi. You can verify that this is the case by using the df command:

    +

    On a UEFI-based PC, you'll normally install rEFInd to the ESP, which is usually mounted at /boot/efi. You can verify that this is the case by using the df command:

     $ df /boot/efi
    @@ -114,9 +204,9 @@ Filesystem     1K-blocks  Used Available Use% Mounted on
     /dev/sda1         191284 16604    174681   9% /boot/efi
     
    - + -

    This example shows that /dev/sda1 is mounted at /boot/efi, which is a typical configuration. (The ESP can be on another disk or partition, but /dev/sda1 is the most common place for an ESP.) If your output shows /boot or / under the Mounted on column, then your ESP isn't mounted. If you get a df: `/boot/efi': No such file or directory error message, then the /boot/efi directory doesn't even exist. In such cases, you may need to jump through some extra hoops, as described on my EFI Boot Loader Installation page.

    +

    This example shows that /dev/sda1 is mounted at /boot/efi, which is a typical configuration. (The ESP can be on another disk or partition, but /dev/sda1 is the most common place for an ESP.) If your output shows /boot or / under the Mounted on column, then your ESP isn't mounted. (An exception is if you're mounting the ESP at /boot. This is an unusual configuration. If you're using it, you can proceed, making suitable adjustments to subsequent commands.) If you get a df: `/boot/efi': No such file or directory error message, then the /boot/efi directory doesn't even exist. In such cases, you may need to jump through some extra hoops, as described on my EFI Boot Loader Installation page.

    Assuming the ESP is mounted at /boot/efi, you can install the rEFInd files as follows (you must be root to issue these commands, or precede each of them with sudo):

    @@ -126,7 +216,7 @@ Filesystem 1K-blocks Used Available Use% Mounted on
  • Type cd /boot/efi/EFI/refind to change into rEFInd's new directory on the ESP.
  • -
  • Type rm refind_ia32.efi to remove the IA32 binary if you're using an x86-64 (64-bit) system; or type rm refind_x64.efi to remove the x86-64 binary if you're using an x86 (32-bit) system. You can optionally rename the binary you keep as refind.efi, but this isn't required.
  • +
  • Type rm refind_ia32.efi to remove the IA32 binary if you're using an x86-64 (64-bit) system; or type rm refind_x64.efi to remove the x86-64 binary if you're using an x86 (32-bit) system. You can optionally rename the binary you keep as refind.efi, but this isn't required. (Note that you must keep the version that's the correct bit width for your EFI; if you've installed a 32-bit Linux on a 64-bit PC with a 64-bit EFI, you'd keep refind_x64.efi.
  • Rename the configuration file by typing mv refind.conf-sample refind.conf. Consult the Editing the rEFInd Configuration File page for information on how to adjust your options.
  • @@ -143,10 +233,18 @@ Filesystem 1K-blocks Used Available Use% Mounted on

    On some systems, efibootmgr won't do what you expect. On such systems, you may have better luck renaming the rEFInd files, as described in the Alternative Naming Options section.

    -

    Installing rEFInd Using Mac OS X

    +

    Installing rEFInd Manually Using Mac OS X

    - +

    Before installing rEFInd on a Mac, you must determine whether it uses a 32-bit or 64-bit EFI implementation. Most Intel-based Macs have 64-bit EFIs, so you should use the refind_x64.efi file with them; but very early Intel-based Macs have 32-bit EFIs (and sometimes 32-bit CPUs), which require the refind_ia32.efi file. You can determine whether your Mac needs the x86-64 or IA32 build by typing the following command in a Mac Terminal window:

    + +
    +$ ioreg -l -p IODeviceTree | grep firmware-abi
    +
    + +

    The result should include either EFI32 or EFI64, indicating that you should use the refind_ia32.efi or refind_x64.efi binary, respectively.

    + +

    The procedure for installing rEFInd on a Mac is similar to that for installing it under Linux, except that you can (and probably should) install it to OS X's system partition or some other HFS+ partition rather than to the ESP, and you must use the bless utility rather than efibootmgr. To be precise, you should follow these steps:

    @@ -217,7 +315,7 @@ Filesystem 1K-blocks Used Available Use% Mounted on

    If you want to remove rEFInd from your system, you can delete its files. The Mac will revert to booting using whatever standard boot loader it can find. Alternatively, you can use bless to bless another EFI boot loader. The GUI Startup Disk utility in System Preferences provides a simplified interface that enables you to select which OS X installation to boot, but it doesn't look for non-Apple boot loaders, so you can't use it to enable rEFInd.

    -

    Installing rEFInd Using Windows

    +

    Installing rEFInd Manually Using Windows

    To install rEFInd under Windows, you must first find a way to access the ESP, which Windows normally hides from view. One way to accomplish this goal, and to proceed forward once the ESP is accessible, is as follows:

    @@ -280,6 +378,42 @@ Filesystem 1K-blocks Used Available Use% Mounted on

    When you reboot, rEFInd should come up. With any luck, it will detect your old boot loader as an option, if one was installed before.

    + +

    Upgrading rEFInd

    +
    + +

    If you've installed an earlier version of rEFInd, you can upgrade a bit more easily than you can install directly:

    + + + +

    In all cases, if the new version includes new or altered configuration file options, you may need to manually update your configuration file. Alternatively, if you've used the default configuration file, you can replace your working refind.conf with refind.conf-sample from the rEFInd zip file. (When using install.sh, this file will be copied to rEFInd's installation directory under its original name, so you can rename it within that directory to replace the old file.

    +

    Installing Additional Components

    diff --git a/docs/refind/linux.html b/docs/refind/linux.html index 7680101..fec78d4 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: -4/27/2012, referencing rEFInd 0.3.1

    +5/4/2012, referencing rEFInd 0.3.2

    I'm a technical writer and consultant specializing in Linux technologies. 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!

    diff --git a/docs/refind/revisions.html b/docs/refind/revisions.html index 943f0e1..3b51448 100644 --- a/docs/refind/revisions.html +++ b/docs/refind/revisions.html @@ -14,7 +14,7 @@

    by Roderick W. Smith, rodsmith@rodsbooks.com

    -

    Last Web page update: 4/27/2012

    +

    Last Web page update: 5/4/2012

    I'm a technical writer and consultant specializing in Linux technologies. 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!

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