From 300e67d4b35f795953cbd8e3eaaec58034ab8c18 Mon Sep 17 00:00:00 2001 From: srs5694 Date: Sun, 24 Apr 2016 13:47:51 -0400 Subject: [PATCH] Split off fwupx64.efi file from main loaders into second-row loaders; also added "(Legacy)" to descriptions of all BIOS/CSM/legacy-mode loaders on Macs. --- Makefile | 2 +- NEWS.txt | 14 +++++++++++++- debian/changelog | 6 ++++++ debian/copyright | 1 + docs/man/mkrlconf.8 | 2 +- docs/man/mvrefind.8 | 2 +- docs/man/refind-install.8 | 2 +- docs/refind/configfile.html | 6 +++--- filesystems/fsw_efi.c | 2 +- icons/README | 1 + refind-install | 2 +- refind.conf-sample | 6 ++++-- refind.spec | 4 +++- refind/config.c | 3 +++ refind/global.h | 13 ++++++++++++- refind/icns.c | 1 + refind/icns.h | 15 ++++++++------- refind/lib.c | 26 +++++++++++++------------- refind/main.c | 6 +++++- 19 files changed, 79 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index d1158ef..bc6e84f 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ MOK_DIR=mok GPTSYNC_DIR=gptsync EFILIB_DIR=EfiLib export EDK2BASE=/usr/local/UDK2014/MyWorkSpace -export REFIND_VERSION='L"0.10.2.1"' +export REFIND_VERSION='L"0.10.3"' # The "all" target builds with the TianoCore library if possible, but falls # back on the more easily-installed GNU-EFI library if TianoCore isn't diff --git a/NEWS.txt b/NEWS.txt index 9beb316..1d26c57 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,6 +1,18 @@ -0.10.3 (?/??/2016): +0.10.3 (4/24/2016): ------------------- +- Changed description of BIOS/CSM/legacy OS loaders on Macs to include the + string "(Legacy)", so as to more easily identify BIOS/CSM/legacy-mode OSes + in the rEFInd main menu. + +- Added recognition of the fwupx64.efi file as a firmware update tool. + This filename is excluded from the first-row launchers, and is instead + presented on the second row, controlled by the "fwupdate" item on the + "showtools" option line. It's enabled by default. Note that it's still a + bit unclear to me how this tool is supposed to be used. rEFInd launches it + with no options, but if it should take options, this will have to be + changed in the future. + - Tightened exclusion of shell binary filenames from boot loader scan. Previously, any filename containing the substring "shell" was excluded from scans. Now it's tighter; only files matching one of the filenames in diff --git a/debian/changelog b/debian/changelog index 0775aa7..0256184 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +refind (0.10.3-0ppa1) wily; urgency=medium + + * Version bump + + -- Roderick Smith Sun, 24 Apr 2016 11:51:14 -0400 + refind (0.10.2-0ppa1) wily; urgency=medium * Version bump diff --git a/debian/copyright b/debian/copyright index d1f0300..7247a08 100644 --- a/debian/copyright +++ b/debian/copyright @@ -339,6 +339,7 @@ Files: icons/boot_win.png icons/os_refit.png icons/os_win.png icons/tool_apple_rescue.png + icons/tool_fwupdate.png icons/tool_memtest.png icons/tool_rescue.png icons/transparent.png diff --git a/docs/man/mkrlconf.8 b/docs/man/mkrlconf.8 index d6b1328..7cf38b7 100644 --- a/docs/man/mkrlconf.8 +++ b/docs/man/mkrlconf.8 @@ -1,7 +1,7 @@ .\" Copyright 2015-2016 Roderick W. Smith (rodsmith@rodsbooks.com) .\" May be distributed under the GNU Free Documentation License version 1.3 or any later version -.TH "MKRLCONF" "8" "0.10.2" "Roderick W. Smith" "rEFInd Manual" +.TH "MKRLCONF" "8" "0.10.3" "Roderick W. Smith" "rEFInd Manual" .SH "NAME" mkrlconf \- Create a Linux kernel configuration file for rEFInd .SH "SYNOPSIS" diff --git a/docs/man/mvrefind.8 b/docs/man/mvrefind.8 index 606d874..dc04d9d 100644 --- a/docs/man/mvrefind.8 +++ b/docs/man/mvrefind.8 @@ -1,7 +1,7 @@ .\" Copyright 2015-2016 Roderick W. Smith (rodsmith@rodsbooks.com) .\" May be distributed under the GNU Free Documentation License version 1.3 or any later version -.TH "MVREFIND" "8" "0.10.2" "Roderick W. Smith" "rEFInd Manual" +.TH "MVREFIND" "8" "0.10.3" "Roderick W. Smith" "rEFInd Manual" .SH "NAME" mvrefind \- Move a rEFInd installation from one location to another .SH "SYNOPSIS" diff --git a/docs/man/refind-install.8 b/docs/man/refind-install.8 index 7acb60f..857c3a0 100644 --- a/docs/man/refind-install.8 +++ b/docs/man/refind-install.8 @@ -1,7 +1,7 @@ .\" Copyright 2015-2016 Roderick W. Smith (rodsmith@rodsbooks.com) .\" May be distributed under the GNU Free Documentation License version 1.3 or any later version -.TH "REFIND-INSTALL" "8" "0.10.2" "Roderick W. Smith" "rEFInd Manual" +.TH "REFIND-INSTALL" "8" "0.10.3" "Roderick W. Smith" "rEFInd Manual" .SH "NAME" refind-install \- Install rEFInd to the ESP and create an NVRAM entry .SH "SYNOPSIS" diff --git a/docs/refind/configfile.html b/docs/refind/configfile.html index 94905c0..7191808 100644 --- a/docs/refind/configfile.html +++ b/docs/refind/configfile.html @@ -17,7 +17,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Originally written: 3/14/2012; last Web page update: -1/26/2016, referencing rEFInd 0.10.2

+4/24/2016, referencing rEFInd 0.10.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!

@@ -286,8 +286,8 @@ timeout 20 showtools - shell, memtest, gdisk, gptsync, apple_recovery, csr_rotate, mok_tool, netboot, about, exit, shutdown, reboot, and firmware - Specifies which tool tags to display on the second row. shell launches an EFI shell, memtest (or memtest86) launches the Memtest86 program, gdisk launches the partitioning tool of the same name, gptsync launches a tool that creates a hybrid MBR, apple_recovery boots the OS X Recovery HD, csr_rotate rotates through System Integrity Protection (SIP) values specified by csr_values, windows_recovery boots a Windows recovery tool, mok_tool launches a tool to manage Machine Owner Keys (MOKs) on systems with Secure Boot active, netboot launches the network boot tool (iPXE), about displays information about rEFInd, exit terminates rEFInd, shutdown shuts down the computer (or reboots it, on some UEFI PCs), reboot reboots the computer, and firmware reboots the computer into the computer's own setup utility. The tags appear in the order in which you specify them. The default is shell, memtest, gdisk, apple_recovery, mok_tool, about, shutdown, reboot, firmware. Note that the shell, memtest, apple_recovery, and mok_tool options all require the presence of programs not included with rEFInd. The gptsync option requires use of a like-named program which, although it ships with rEFInd 0.6.9 and later, is not installed by default except under OS X. See the "Installing Additional Components" section of the Installing rEFInd page for pointers to the shell, Memtest86, and gptsync programs. The apple_recovery option will appear only if you've got an Apple Recovery HD partition (which has a boot loader called com.apple.recovery.boot/boot.efi). The firmware option works only on computers that support this option; on other computers, the option is quietly ignored. See the Secure Boot page for information on Secure Boot and MOK management. + shell, memtest, gdisk, gptsync, apple_recovery, csr_rotate, mok_tool, fwupdate, netboot, about, exit, shutdown, reboot, and firmware + Specifies which tool tags to display on the second row. shell launches an EFI shell, memtest (or memtest86) launches the Memtest86 program, gdisk launches the partitioning tool of the same name, gptsync launches a tool that creates a hybrid MBR, apple_recovery boots the OS X Recovery HD, csr_rotate rotates through System Integrity Protection (SIP) values specified by csr_values, windows_recovery boots a Windows recovery tool, mok_tool launches a tool to manage Machine Owner Keys (MOKs) on systems with Secure Boot active, fwupdate launches a firmware-update tool, netboot launches the network boot tool (iPXE), about displays information about rEFInd, exit terminates rEFInd, shutdown shuts down the computer (or reboots it, on some UEFI PCs), reboot reboots the computer, and firmware reboots the computer into the computer's own setup utility. The tags appear in the order in which you specify them. The default is shell, memtest, gdisk, apple_recovery, mok_tool, about, shutdown, reboot, firmware. Note that the shell, memtest, apple_recovery, and mok_tool options all require the presence of programs not included with rEFInd. The gptsync option requires use of a like-named program which, although it ships with rEFInd 0.6.9 and later, is not installed by default except under OS X. See the "Installing Additional Components" section of the Installing rEFInd page for pointers to the shell, Memtest86, and gptsync programs. The apple_recovery option will appear only if you've got an Apple Recovery HD partition (which has a boot loader called com.apple.recovery.boot/boot.efi). The firmware option works only on computers that support this option; on other computers, the option is quietly ignored. See the Secure Boot page for information on Secure Boot and MOK management. font diff --git a/filesystems/fsw_efi.c b/filesystems/fsw_efi.c index 897ddde..3ec6494 100644 --- a/filesystems/fsw_efi.c +++ b/filesystems/fsw_efi.c @@ -78,7 +78,7 @@ EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO /** Helper macro for stringification. */ #define FSW_EFI_STRINGIFY(x) #x /** Expands to the EFI driver name given the file system type name. */ -#define FSW_EFI_DRIVER_NAME(t) L"rEFInd 0.10.1 " FSW_EFI_STRINGIFY(t) L" File System Driver" +#define FSW_EFI_DRIVER_NAME(t) L"rEFInd 0.10.3 " FSW_EFI_STRINGIFY(t) L" File System Driver" // function prototypes diff --git a/icons/README b/icons/README index e7950df..a26be94 100644 --- a/icons/README +++ b/icons/README @@ -108,6 +108,7 @@ os_refind.png os_refit.png os_win.png tool_apple_rescue.png +tool_fwupdate.png tool_memtest.png tool_rescue.png transparent.png diff --git a/refind-install b/refind-install index 68ab959..b28a79e 100755 --- a/refind-install +++ b/refind-install @@ -794,7 +794,7 @@ SetupMacHfs() { ProductName rEFInd ProductVersion - 0.10.2 + 0.10.3 ENDOFHERE diff --git a/refind.conf-sample b/refind.conf-sample index a1c57b5..bbdc904 100644 --- a/refind.conf-sample +++ b/refind.conf-sample @@ -180,10 +180,12 @@ timeout 20 # reboot - a tag to reboot the computer # firmware - a tag to reboot the computer into the firmware's # user interface (ignored on older computers) +# fwupdate - a tag to update the firmware; launches the fwupx64.efi +# (or similar) program # netboot - launch the ipxe.efi tool for network (PXE) booting -# Default is shell,memtest,gdisk,apple_recovery,windows_recovery,mok_tool,about,shutdown,reboot,firmware +# Default is shell,memtest,gdisk,apple_recovery,windows_recovery,mok_tool,about,shutdown,reboot,firmware,fwupdate # -#showtools shell, gdisk, memtest, mok_tool, apple_recovery, windows_recovery, about, reboot, exit, firmware +#showtools shell, gdisk, memtest, mok_tool, apple_recovery, windows_recovery, about, reboot, exit, firmware, fwupdate # Boot loaders that can launch a Windows restore or emergency system. # These tend to be OEM-specific. diff --git a/refind.spec b/refind.spec index 29bbd84..0121b4d 100644 --- a/refind.spec +++ b/refind.spec @@ -1,6 +1,6 @@ Summary: EFI boot manager software Name: refind -Version: 0.10.2 +Version: 0.10.3 Release: 1%{?dist} Summary: EFI boot manager software License: GPLv3 @@ -181,6 +181,8 @@ fi # thus wiping out the just-updated files. %changelog +* Sun Apr 24 2016 R Smith - 0.10.3 +- Updated spec file for 0.10.3 * Tue Jan 26 2016 R Smith - 0.10.2 - Updated spec file for 0.10.2 * Sat Dec 12 2015 R Smith - 0.10.1 diff --git a/refind/config.c b/refind/config.c index 8aa2850..658f8eb 100644 --- a/refind/config.c +++ b/refind/config.c @@ -524,6 +524,7 @@ VOID ReadConfig(CHAR16 *FileName) MyFreePool(GlobalConfig.DontScanFiles); GlobalConfig.DontScanFiles = StrDuplicate(DONT_SCAN_FILES); MergeStrings(&(GlobalConfig.DontScanFiles), MOK_NAMES, L','); + MergeStrings(&(GlobalConfig.DontScanFiles), FWUPDATE_NAMES, L','); MyFreePool(GlobalConfig.DontScanVolumes); GlobalConfig.DontScanVolumes = StrDuplicate(DONT_SCAN_VOLUMES); GlobalConfig.WindowsRecoveryFiles = StrDuplicate(WINDOWS_RECOVERY_FILES); @@ -649,6 +650,8 @@ VOID ReadConfig(CHAR16 *FileName) GlobalConfig.ShowTools[i - 1] = TAG_WINDOWS_RECOVERY; } else if (MyStriCmp(FlagName, L"mok_tool")) { GlobalConfig.ShowTools[i - 1] = TAG_MOK_TOOL; + } else if (MyStriCmp(FlagName, L"fwupdate")) { + GlobalConfig.ShowTools[i - 1] = TAG_FWUPDATE_TOOL; } else if (MyStriCmp(FlagName, L"csr_rotate")) { GlobalConfig.ShowTools[i - 1] = TAG_CSR_ROTATE; } else if (MyStriCmp(FlagName, L"firmware")) { diff --git a/refind/global.h b/refind/global.h index d35f9b0..ad8e172 100644 --- a/refind/global.h +++ b/refind/global.h @@ -76,7 +76,8 @@ #define TAG_GDISK (16) #define TAG_NETBOOT (17) #define TAG_CSR_ROTATE (18) -#define NUM_TOOLS (19) +#define TAG_FWUPDATE_TOOL (19) +#define NUM_TOOLS (20) #define NUM_SCAN_OPTIONS 10 @@ -150,6 +151,16 @@ // Names of binaries that can manage MOKs.... #define MOK_NAMES L"MokManager.efi,HashTool.efi,HashTool-signed.efi,KeyTool.efi,KeyTool-signed.efi" +// Names of binaries that can update firmware.... +#if defined (EFIX64) +#define FWUPDATE_NAMES L"fwupx64.efi" +#elif defined(EFI32) +#define FWUPDATE_NAMES L"fwupia32.efi" +#elif defined(EFIAARCH64) +#define FWUPDATE_NAMES L"fwupaa64.efi" +#else +#define FWUPDATE_NAMES L"fwup.efi" +#endif // Directories to search for these MOK-managing programs. Note that SelfDir is // searched in addition to these locations.... #define MOK_LOCATIONS L"\\,EFI\\tools,EFI\\fedora,EFI\\redhat,EFI\\ubuntu,EFI\\suse,EFI\\opensuse,EFI\\altlinux" diff --git a/refind/icns.c b/refind/icns.c index 5e74bb2..f29d551 100644 --- a/refind/icns.c +++ b/refind/icns.c @@ -64,6 +64,7 @@ BUILTIN_ICON BuiltinIconTable[BUILTIN_ICON_COUNT] = { { NULL, L"tool_apple_rescue", ICON_SIZE_SMALL }, { NULL, L"tool_windows_rescue", ICON_SIZE_SMALL }, { NULL, L"tool_mok_tool", ICON_SIZE_SMALL }, + { NULL, L"tool_fwupdate", ICON_SIZE_SMALL }, { NULL, L"tool_memtest", ICON_SIZE_SMALL }, { NULL, L"tool_netboot", ICON_SIZE_SMALL }, { NULL, L"vol_internal", ICON_SIZE_BADGE }, diff --git a/refind/icns.h b/refind/icns.h index 2a6f92b..60342ea 100644 --- a/refind/icns.h +++ b/refind/icns.h @@ -67,13 +67,14 @@ EG_IMAGE * BuiltinIcon(IN UINTN Id); #define BUILTIN_ICON_TOOL_APPLE_RESCUE (9) #define BUILTIN_ICON_TOOL_WINDOWS_RESCUE (10) #define BUILTIN_ICON_TOOL_MOK_TOOL (11) -#define BUILTIN_ICON_TOOL_MEMTEST (12) -#define BUILTIN_ICON_TOOL_NETBOOT (13) -#define BUILTIN_ICON_VOL_INTERNAL (14) -#define BUILTIN_ICON_VOL_EXTERNAL (15) -#define BUILTIN_ICON_VOL_OPTICAL (16) -#define BUILTIN_ICON_VOL_NET (17) -#define BUILTIN_ICON_COUNT (18) +#define BUILTIN_ICON_TOOL_FWUPDATE (12) +#define BUILTIN_ICON_TOOL_MEMTEST (13) +#define BUILTIN_ICON_TOOL_NETBOOT (14) +#define BUILTIN_ICON_VOL_INTERNAL (15) +#define BUILTIN_ICON_VOL_EXTERNAL (16) +#define BUILTIN_ICON_VOL_OPTICAL (17) +#define BUILTIN_ICON_VOL_NET (18) +#define BUILTIN_ICON_COUNT (19) #endif diff --git a/refind/lib.c b/refind/lib.c index f38ac64..c60615b 100644 --- a/refind/lib.c +++ b/refind/lib.c @@ -607,12 +607,12 @@ static VOID ScanVolumeBootcode(REFIT_VOLUME *Volume, BOOLEAN *Bootable) FindMem(Buffer, SECTOR_SIZE, "ISOLINUX", 8) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"linux"; - Volume->OSName = L"Linux"; + Volume->OSName = L"Linux (Legacy)"; } else if (FindMem(Buffer, 512, "Geom\0Hard Disk\0Read\0 Error", 26) >= 0) { // GRUB Volume->HasBootCode = TRUE; Volume->OSIconName = L"grub,linux"; - Volume->OSName = L"Linux"; + Volume->OSName = L"Linux (Legacy)"; } else if ((*((UINT32 *)(Buffer + 502)) == 0 && *((UINT32 *)(Buffer + 506)) == 50000 && @@ -620,7 +620,7 @@ static VOID ScanVolumeBootcode(REFIT_VOLUME *Volume, BOOLEAN *Bootable) FindMem(Buffer, SECTOR_SIZE, "Starting the BTX loader", 23) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"freebsd"; - Volume->OSName = L"FreeBSD"; + Volume->OSName = L"FreeBSD (Legacy)"; // If more differentiation needed, also search for // "Invalid partition table" &/or "Missing boot loader". @@ -629,59 +629,59 @@ static VOID ScanVolumeBootcode(REFIT_VOLUME *Volume, BOOLEAN *Bootable) (FindMem(Buffer, SECTOR_SIZE, "I/O error loading boot loader", 29) >= 0)) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"freebsd"; - Volume->OSName = L"FreeBSD"; + Volume->OSName = L"FreeBSD (Legacy)"; } else if (FindMem(Buffer, 512, "!Loading", 8) >= 0 || FindMem(Buffer, SECTOR_SIZE, "/cdboot\0/CDBOOT\0", 16) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"openbsd"; - Volume->OSName = L"OpenBSD"; + Volume->OSName = L"OpenBSD (Legacy)"; } else if (FindMem(Buffer, 512, "Not a bootxx image", 18) >= 0 || *((UINT32 *)(Buffer + 1028)) == 0x7886b6d1) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"netbsd"; - Volume->OSName = L"NetBSD"; + Volume->OSName = L"NetBSD (Legacy)"; // Windows NT/200x/XP } else if (FindMem(Buffer, SECTOR_SIZE, "NTLDR", 5) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"win"; - Volume->OSName = L"Windows"; + Volume->OSName = L"Windows (Legacy)"; // Windows Vista/7/8 } else if (FindMem(Buffer, SECTOR_SIZE, "BOOTMGR", 7) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"win8,win"; - Volume->OSName = L"Windows"; + Volume->OSName = L"Windows (Legacy)"; } else if (FindMem(Buffer, 512, "CPUBOOT SYS", 11) >= 0 || FindMem(Buffer, 512, "KERNEL SYS", 11) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"freedos"; - Volume->OSName = L"FreeDOS"; + Volume->OSName = L"FreeDOS (Legacy)"; } else if (FindMem(Buffer, 512, "OS2LDR", 6) >= 0 || FindMem(Buffer, 512, "OS2BOOT", 7) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"ecomstation"; - Volume->OSName = L"eComStation"; + Volume->OSName = L"eComStation (Legacy)"; } else if (FindMem(Buffer, 512, "Be Boot Loader", 14) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"beos"; - Volume->OSName = L"BeOS"; + Volume->OSName = L"BeOS (Legacy)"; } else if (FindMem(Buffer, 512, "yT Boot Loader", 14) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"zeta,beos"; - Volume->OSName = L"ZETA"; + Volume->OSName = L"ZETA (Legacy)"; } else if (FindMem(Buffer, 512, "\x04" "beos\x06" "system\x05" "zbeos", 18) >= 0 || FindMem(Buffer, 512, "\x06" "system\x0c" "haiku_loader", 20) >= 0) { Volume->HasBootCode = TRUE; Volume->OSIconName = L"haiku,beos"; - Volume->OSName = L"Haiku"; + Volume->OSName = L"Haiku (Legacy)"; } diff --git a/refind/main.c b/refind/main.c index 0cbf538..f10fb6f 100644 --- a/refind/main.c +++ b/refind/main.c @@ -166,7 +166,7 @@ REFIT_CONFIG GlobalConfig = { FALSE, TRUE, FALSE, FALSE, TRUE, 0, 0, 0, DONT_CHA BANNER_NOSCALE, NULL, NULL, NULL, NULL, CONFIG_FILE_NAME, NULL, NULL, 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, + TAG_MOK_TOOL, TAG_ABOUT, TAG_SHUTDOWN, TAG_REBOOT, TAG_FIRMWARE, TAG_FWUPDATE_TOOL, 0, 0, 0, 0, 0, 0, 0, 0 } }; @@ -1921,6 +1921,10 @@ static VOID ScanForTools(VOID) { FindTool(MokLocations, MOK_NAMES, L"MOK utility", BUILTIN_ICON_TOOL_MOK_TOOL); break; + case TAG_FWUPDATE_TOOL: + FindTool(MokLocations, FWUPDATE_NAMES, L"firmware update utility", BUILTIN_ICON_TOOL_FWUPDATE); + break; + case TAG_CSR_ROTATE: if ((GetCsrStatus(&CsrValue) == EFI_SUCCESS) && (GlobalConfig.CsrValues)) { TempMenuEntry = CopyMenuEntry(&MenuEntryRotateCsr); -- 2.39.2