From 7b006609c81e23ca1c7597776b7ea485932bbe0c Mon Sep 17 00:00:00 2001 From: srs5694 Date: Thu, 6 Dec 2012 20:51:07 -0500 Subject: [PATCH] Version 0.5.0 release. --- docs/refind/bootmode.html | 2 +- docs/refind/configfile.html | 2 +- docs/refind/drivers.html | 2 +- docs/refind/features.html | 2 +- docs/refind/getting.html | 2 +- docs/refind/index.html | 2 +- docs/refind/installing.html | 2 +- docs/refind/linux.html | 2 +- docs/refind/revisions.html | 2 +- docs/refind/secureboot.html | 101 ++++++++++++++++++++++-------------- docs/refind/themes.html | 2 +- docs/refind/todo.html | 2 +- docs/refind/using.html | 2 +- install.sh | 48 +++++++++++++++-- mkdistrib | 40 ++++++++++++-- refind/main.c | 2 +- 16 files changed, 155 insertions(+), 60 deletions(-) diff --git a/docs/refind/bootmode.html b/docs/refind/bootmode.html index 992a019..15e5218 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: -12/5/2012, referencing rEFInd 0.5.0

+12/6/2012, referencing rEFInd 0.5.0

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 04c144e..dcf1fe1 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: -12/5/2012, referencing rEFInd 0.5.0

+12/6/2012, referencing rEFInd 0.5.0

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/drivers.html b/docs/refind/drivers.html index e753c0b..fb5852f 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: -12/5/2012, referencing rEFInd 0.5.0

+12/6/2012, referencing rEFInd 0.5.0

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 70da853..b9f41c3 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: -12/5/2012, referencing rEFInd 0.5.0

+12/6/2012, referencing rEFInd 0.5.0

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 5d95623..3da81ee 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: -12/5/2012, referencing rEFInd 0.5.0

+12/6/2012, referencing rEFInd 0.5.0

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/index.html b/docs/refind/index.html index 94a5367..bef175a 100644 --- a/docs/refind/index.html +++ b/docs/refind/index.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Originally written: 3/14/2012; last Web page update: -12/5/2012, referencing rEFInd 0.5.0

+12/6/2012, referencing rEFInd 0.5.0

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/installing.html b/docs/refind/installing.html index 4fc7bb7..f5acdfa 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: -12/5/2012, referencing rEFInd 0.5.0

+12/6/2012, referencing rEFInd 0.5.0

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/linux.html b/docs/refind/linux.html index 011611a..77cabc0 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: -12/5/2012, referencing rEFInd 0.5.0

+12/6/2012, referencing rEFInd 0.5.0

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 a87c5de..7ccd1c0 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: 12/5/2012

+

Last Web page update: 12/6/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!

diff --git a/docs/refind/secureboot.html b/docs/refind/secureboot.html index 5a10f09..d723758 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: -12/5/2012, referencing rEFInd 0.5.0

+12/6/2012, referencing rEFInd 0.5.0

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,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

-

If you're using a computer that supports Secure Boot, you may run into extra complications. This feature is intended to make it difficult for malware to insert itself early into the computer's boot process. Unfortunately, it also complicates multi-boot configurations such as those that rEFInd is intended to manage. This page describes some secure boot basics and two specific aspects of rEFInd and its interactions with Secure Boot: installation issues and known bugs and limitations in rEFInd's Secure Boot features.

+

If you're using a computer that supports Secure Boot, you may run into extra complications. This feature is intended to make it difficult for malware to insert itself early into the computer's boot process. Unfortunately, it also complicates multi-boot configurations such as those that rEFInd is intended to manage. This page describes some secure boot basics and two specific aspects of rEFInd and its interactions with Secure Boot: installation issues and MOK management. It concludes with a look at known bugs and limitations in rEFInd's Secure Boot features.

Basic Issues

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

Through 2012, it became obvious that Secure Boot would be a feature that was controlled, to a large extent, by Microsoft. This is because Microsoft requires that non-server computers that display Windows 8 logos ship with Secure Boot enabled. As a practical matter, this also means that such computers ship with Microsoft's keys in their firmware. In the absence of an industry-standard body to manage the signing of Secure Boot keys, this means that Microsoft's key is the only one that's more-or-less guaranteed to be installed on the computer, thus blocking the ability to boot any OS that lacks a boot path through Microsoft's signing key.

-

Fortunately, Microsoft will sign third-party binaries with their key. A payment of $99 to Verisign enables a software distributor to sign as many binaries as desired. Red Hat (Fedora), Novell (SUSE), and Canonical (Ubuntu) have all announced plans to take advantage of this system. Unfortunately, using a third-party signing service is an awkward solution for open source software. In fact, for this very reason Red Hat has developed a program that it calls shim that essentially shifts the Secure Boot "train" from Microsoft's proprietary "track" to one that's more convenient for open source authors. Shim is signed by Microsoft and redirects the boot process to another boot loader that can be signed with keys that the distribution maintains and that are built into shim. Fedora 18 is expected to use this system. SUSE has announced that it will use the same system, as does Ubuntu with version 12.10 and later. SUSE has contributed to the shim approach by supporting a set of keys that users can maintain themselves. These keys are known as Machine Owner Keys (MOKs), and managing them is described later, in Managing MOKs. To reiterate, then, there are potentially three ways to sign a binary that will get it launched on a system that uses shim:

+

Fortunately, Microsoft will sign third-party binaries with their key. A payment of $99 to Verisign enables a software distributor to sign as many binaries as desired. Red Hat (Fedora), Novell (SUSE), and Canonical (Ubuntu) have all announced plans to take advantage of this system. Unfortunately, using a third-party signing service is an awkward solution for open source software. In fact, for this very reason Red Hat has developed a program that it calls shim that essentially shifts the Secure Boot "train" from Microsoft's proprietary "track" to one that's more friendly to open source authors. Shim is signed by Microsoft and redirects the boot process to another boot loader that can be signed with keys that the distribution maintains and that are built into shim. Fedora 18 is expected to use this system. SUSE has announced that it will use the same system, as does Ubuntu with version 12.10 and later. SUSE has contributed to the shim approach by providing expansions to shim that support a set of keys that users can maintain themselves. These keys are known as Machine Owner Keys (MOKs), and managing them is described later, in Managing MOKs. To reiterate, then, there are potentially three ways to sign a binary that will get it launched on a system that uses shim:

-

My focus in testing rEFInd's Secure Boot capabilities has been on getting Linux kernels with EFI stub loaders to launch correctly.

+

My focus in testing rEFInd's Secure Boot capabilities has been on getting Linux kernels with EFI stub loaders to launch correctly. I've done some minimal testing with GRUB 2, though. I've also tested some self-signed binaries, such as an EFI shell and MokManager. (The EFI shell launches, but will not itself launch anything that's not been signed with a UEFI Secure Boot key. This of course limits its utility.)

-

At the moment, I consider rEFInd's shim/MOK support to be of alpha quality. I'm releasing it in this state in the hope of getting feedback from adventurous early adopters. I expect the improve the installation procedure, and with any luck fix some of the known bugs, in the next couple of versions. Some of the usability improvements are dependent upon MOK-capable versions of shim being released with major distributions; such versions of shim, with kernels signed with the key that matches the one built into shim, will greatly reduce the need for users to sign boot loaders.

+

At the moment, I consider rEFInd's shim/MOK support to be of alpha quality. I'm releasing it in this state in the hope of getting feedback from adventurous early adopters. I expect to improve the installation procedure, and with any luck fix some of the known bugs, in the next couple of versions. Some of the usability improvements are dependent upon MOK-capable versions of shim being released with major distributions; such versions of shim, with kernels signed with the key that matches the one built into shim, will greatly reduce the need for users to sign boot loaders.


diff --git a/docs/refind/themes.html b/docs/refind/themes.html index 4bca9c2..884401b 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: -12/5/2012, referencing rEFInd 0.5.0

+12/6/2012, referencing rEFInd 0.5.0

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/todo.html b/docs/refind/todo.html index fdfca00..2fc86a5 100644 --- a/docs/refind/todo.html +++ b/docs/refind/todo.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Originally written: 3/14/2012; last Web page update: -12/5/2012, referencing rEFInd 0.5.0

+12/6/2012, referencing rEFInd 0.5.0

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/using.html b/docs/refind/using.html index c47026e..341045d 100644 --- a/docs/refind/using.html +++ b/docs/refind/using.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Originally written: 3/14/2012; last Web page update: -12/5/2012, referencing rEFInd 0.5.0

+12/6/2012, referencing rEFInd 0.5.0

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/install.sh b/install.sh index 6328ea5..e210224 100755 --- a/install.sh +++ b/install.sh @@ -26,7 +26,7 @@ # # Revision history: # -# 0.4.8 -- Added --usedefault & --drivers options & changed "esp" option to "--esp" +# 0.5.0 -- Added --usedefault & --drivers options & changed "esp" option to "--esp" # 0.4.5 -- Fixed check for rEFItBlesser in OS X # 0.4.2 -- Added notice about BIOS-based OSes & made NVRAM changes in Linux smarter # 0.4.1 -- Added check for rEFItBlesser in OS X @@ -38,6 +38,8 @@ # with which they first appeared. TargetDir=/EFI/refind +EtcKeysDir=/etc/refind.d/keys +SBModeInstall=0 # # Functions used by both OS X and Linux.... @@ -57,8 +59,8 @@ GetParams() { --drivers) InstallDrivers=1 ;; * ) echo "Usage: $0 [--esp | --usedefault {device-file}] [--drivers]" - echo "Aborting!" - exit 1 + echo "Aborting!" + exit 1 esac shift done @@ -117,6 +119,8 @@ CopyRefindFiles() { cp -r $RefindDir/drivers_* $InstallDir/$TargetDir/ fi Refind="" + cp $ThisDir/refind.cer $InstallDir/$TargetDir + cp $ThisDir/refind.crt $InstallDir/$TargetDir elif [[ $Platform == 'EFI32' ]] ; then cp $RefindDir/refind_ia32.efi $InstallDir/$TargetDir if [[ $? != 0 ]] ; then @@ -137,6 +141,14 @@ CopyRefindFiles() { cp -r $RefindDir/drivers_x64/*_x64.efi $InstallDir/$TargetDir/drivers_x64/ fi Refind="refind_x64.efi" + cp $ThisDir/refind.cer $InstallDir/$TargetDir + cp $ThisDir/refind.crt $InstallDir/$TargetDir + if [[ $SBModeInstall == 1 ]] ; then + echo "Storing copies of rEFInd Secure Boot public keys in $EtcKeysDir" + mkdir -p $EtcKeysDir + cp $ThisDir/refind.cer $EtcKeysDir + cp $ThisDir/refind.crt $EtcKeysDir + fi else echo "Unknown platform! Aborting!" exit 1 @@ -246,7 +258,7 @@ InstallOnOSX() { read YesNo if [[ $YesNo == "Y" || $YesNo == "y" ]] ; then echo "Deleting /Library/StartupItems/rEFItBlesser..." - rm -r /Library/StartupItems/rEFItBlesser + rm -r /Library/StartupItems/rEFItBlesser else echo "Not deleting rEFItBlesser." fi @@ -263,6 +275,33 @@ InstallOnOSX() { # Now a series of Linux support functions.... # +# Check for evidence that we're running in Secure Boot mode. If so, warn the +# user and confirm installation. +# TODO: Perform a reasonable Secure Boot installation. +CheckSecureBoot() { + VarFile=`ls -ld /sys/firmware/efi/vars/SecureBoot* 2> /dev/null` + if [[ -n $VarFile && $TargetDir != '/EFI/BOOT' ]] ; then + echo "" + echo "CAUTION: The computer seems to have been booted with Secure Boot active." + echo "Although rEFInd, when installed in conjunction with the shim boot loader, can" + echo "work on a Secure Boot computer, this installation script doesn't yet support" + echo "direct installation in a way that will work on such a computer. You may" + echo "proceed with installation with this script, but if you intend to boot with" + echo "Secure Boot active, you must then reconfigure your boot programs to add shim" + echo "to the process. Alternatively, you may terminate this script and do a manual" + echo "installation, as described at http://www.rodsbooks.com/refind/secureboot.html." + echo "" + echo -n "Do you want to proceed with installation (Y/N)? " + read ContYN + if [[ $ContYN == "Y" || $ContYN == "y" ]] ; then + echo "OK; continuing with the installation..." + else + exit 0 + SBModeInstall=1 + fi + fi +} + # Identifies the ESP's location (/boot or /boot/efi); aborts if # the ESP isn't mounted at either location. # Sets InstallDir to the ESP mount point. @@ -359,6 +398,7 @@ InstallOnLinux() { echo "Unknown CPU type '$CpuType'; aborting!" exit 1 fi + CheckSecureBoot CopyRefindFiles if [[ $TargetDir != "/EFI/BOOT" ]] ; then AddBootEntry diff --git a/mkdistrib b/mkdistrib index b1701ec..2f894ed 100755 --- a/mkdistrib +++ b/mkdistrib @@ -3,15 +3,39 @@ # Script to prepare source code and binary distribution files of rEFInd. # By Rod Smith, 3/11/2012 # Updated 11/8/2012 to do more things automatically +# Updated 12/6/2012 to sign binaries with the rEFInd MOK # # Usage: ./mkdistrib version # where "version" is a version number # MUST be run from an x86-64 system, on which the TianoCore build # includes both X64 and IA32 build support ("TARGET_ARCH = IA32 X64" -# in Conf/target.txt). +# in Conf/target.txt). The MOK files must be available from a disk +# partition to be mounted via /etc/fstab at /mnt/refind. StartDir=`pwd` +SBSign=`which sbsign 2> /dev/null` +KeysDir=/mnt/refind + +KeysInfo=`df $KeysDir 2> /dev/null | grep $KeysDir` + +if [[ ! -n $SBSign ]] ; then + echo "Can't find sbsign binary! Aborting!" + exit 1 +fi + +if [[ ! -n $KeysInfo ]] ; then + mount /mnt/refind +fi + +if [[ $? -ne 0 ]] ; then + echo "Error mounting $KeysDir! Aborting!" + echo "" + exit 1 +fi + +# From here on, if there's an error, abort immediately. +set -e make clean @@ -19,6 +43,7 @@ make clean mkdir -p ../snapshots/$1/refind-$1/icons cp --preserve=timestamps icons/*icns ../snapshots/$1/refind-$1/icons/ cp -a docs images include EfiLib libeg refind filesystems install.sh CREDITS.txt NEWS.txt BUILDING.txt COPYING.txt LICENSE.txt README.txt refind.inf Make.tiano Make.common Makefile refind.conf-sample ../snapshots/$1/refind-$1 +cp $KeysDir/refind.cer $KeysDir/refind.crt ../snapshots/$1/refind-$1/ # Go there and prepare a souce code zip file.... cd ../snapshots/$1/ @@ -38,17 +63,22 @@ cp refind/refind_ia32.efi $StartDir/ make clean make make fs -mkdir -p refind-bin-$1/refind/drivers_x64 +mkdir -p refind-bin-$1/refind/drivers cp -a icons refind-bin-$1/refind/ -cp --preserve=timestamps drivers/*_x64.efi refind-bin-$1/refind/drivers_x64/ +for File in `ls drivers/*_x64.efi` ; do + $SBSign --key $KeysDir/refind.key --cert $KeysDir/refind.crt --output refind-bin-$1/refind/$File $File +done +mv refind-bin-$1/refind/drivers refind-bin-$1/refind/drivers_x64 cp --preserve=timestamps filesystems/LICENSE*txt refind-bin-$1/refind/drivers_x64/ cp --preserve=timestamps refind.conf-sample refind-bin-$1/refind/ -cp refind/refind_x64.efi refind-bin-$1/refind/refind_x64.efi -cp refind/refind_x64.efi $StartDir +$SBSign --key $KeysDir/refind.key --cert $KeysDir/refind.crt --output refind-bin-$1/refind/refind_x64.efi refind/refind_x64.efi +cp refind-bin-$1/refind/refind_x64.efi $StartDir cp -a COPYING.txt LICENSE.txt README.txt docs CREDITS.txt install.sh refind-bin-$1 # Prepare the final .zip file and clean up +cp $KeysDir/refind.cer $KeysDir/refind.crt refind-bin-$1/ zip -9r ../refind-bin-$1.zip refind-bin-$1 cd .. rm -r refind-$1 cd $StartDir +umount $KeysDir \ No newline at end of file diff --git a/refind/main.c b/refind/main.c index ec39e5a..18816e2 100644 --- a/refind/main.c +++ b/refind/main.c @@ -118,7 +118,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.7.12"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.5.0"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith"); -- 2.39.2