From: srs5694 Date: Sat, 21 Mar 2015 18:08:28 +0000 (-0400) Subject: Added OS check to mkrlconf.sh. Bypass checks for BIOS-mode boot X-Git-Url: https://code.delx.au/refind/commitdiff_plain/d738a7a9d29a6a09673f1d9cad6155c07d0d3875 Added OS check to mkrlconf.sh. Bypass checks for BIOS-mode boot loaders when run on a UEFI-based PC, since these checks are useful only on Macs. --- diff --git a/NEWS.txt b/NEWS.txt index 39316dc..71d48ad 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,6 +1,14 @@ 0.8.8 (3/??/2015): ------------------ +- The mkrlconf.sh script now checks the OS on which it's running, which + should help avoid confusion or problems by users who mistakenly run it + under OS X. + +- rEFInd now skips checking for various BIOS-mode boot sector signatures + when running on a UEFI-based PC; these checks are run only on Macs. This + may reduce startup time on systems with many partitions. + - Fixed Debian debinstall script to work correctly on IA32 systems. It had a bug that caused filesystem drivers and gptsync to not be packaged for IA32. diff --git a/mkrlconf.sh b/mkrlconf.sh index 0a5d307..9028ef0 100755 --- a/mkrlconf.sh +++ b/mkrlconf.sh @@ -18,6 +18,7 @@ # Revision history: # +# 0.8.8 -- Added check for OS type, to keep from running pointlessly on OS X # 0.7.7 -- Fixed bug that caused stray PARTUUID= and line breaks in generated file # 0.5.1 -- Initial release # @@ -26,6 +27,12 @@ RLConfFile="/boot/refind_linux.conf" +if [[ `uname -s` != "Linux" ]] ; then + echo "This script is intended to be run from Linux. Aborting!" + echo "" + exit 1 +fi + if [[ ! -f $RLConfFile || $1 == "--force" ]] ; then if [[ -f /etc/default/grub ]] ; then # We want the default options used by the distribution, stored here.... diff --git a/refind/lib.c b/refind/lib.c index 492541a..7075630 100644 --- a/refind/lib.c +++ b/refind/lib.c @@ -576,6 +576,13 @@ static VOID SetFilesystemData(IN UINT8 *Buffer, IN UINTN BufferSize, IN OUT REFI } // if } // search for FAT and NTFS magic + // If no other filesystem is identified and block size is right, assume + // it's ISO-9660.... + if (Volume->BlockIO->Media->BlockSize == 2048) { + Volume->FSType = FS_TYPE_ISO9660; + return; + } + } // if ((Buffer != NULL) && (Volume != NULL)) } // UINT32 SetFilesystemData() @@ -603,8 +610,9 @@ static VOID ScanVolumeBootcode(REFIT_VOLUME *Volume, BOOLEAN *Bootable) Volume->BlockIO, Volume->BlockIO->Media->MediaId, Volume->BlockIOOffset, SAMPLE_SIZE, Buffer); if (!EFI_ERROR(Status)) { - SetFilesystemData(Buffer, SAMPLE_SIZE, Volume); + } + if ((Status == EFI_SUCCESS) && (GlobalConfig.LegacyType == LEGACY_TYPE_MAC)) { if ((*((UINT16 *)(Buffer + 510)) == 0xaa55 && Buffer[0] != 0) && (FindMem(Buffer, 512, "EXFAT", 5) == -1)) { *Bootable = TRUE; Volume->HasBootCode = TRUE; @@ -624,15 +632,6 @@ static VOID ScanVolumeBootcode(REFIT_VOLUME *Volume, BOOLEAN *Bootable) Volume->OSIconName = L"grub,linux"; Volume->OSName = L"Linux"; -// // Below doesn't produce a bootable entry, so commented out for the moment.... -// // GRUB in BIOS boot partition: -// } else if (FindMem(Buffer, 512, "Geom\0Read\0 Error", 16) >= 0) { -// Volume->HasBootCode = TRUE; -// Volume->OSIconName = L"grub,linux"; -// Volume->OSName = L"Linux"; -// Volume->VolName = L"BIOS Boot Partition"; -// *Bootable = TRUE; - } else if ((*((UINT32 *)(Buffer + 502)) == 0 && *((UINT32 *)(Buffer + 506)) == 50000 && *((UINT16 *)(Buffer + 510)) == 0xaa55) || diff --git a/refind/main.c b/refind/main.c index 4c8bce1..3f40c12 100644 --- a/refind/main.c +++ b/refind/main.c @@ -166,7 +166,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.7"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.7.3"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith");