From: srs5694 Date: Sat, 5 Jan 2013 00:11:01 +0000 (-0500) Subject: Fix to install.sh's efibootmgr filename; disable check for 2048-byte X-Git-Url: https://code.delx.au/refind/commitdiff_plain/da80923f62aa284dde891d0bff8c42cf791bd95c Fix to install.sh's efibootmgr filename; disable check for 2048-byte blocks in ISO-9660 driver --- diff --git a/EfiLib/Makefile b/EfiLib/Makefile index d832893..8487805 100644 --- a/EfiLib/Makefile +++ b/EfiLib/Makefile @@ -3,4 +3,4 @@ # clean: - rm -f $(OBJS) *~ *.lib + rm -f *.o *.obj *~ *.lib diff --git a/NEWS.txt b/NEWS.txt index 2abfe82..a6a8859 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,6 +1,10 @@ 0.6.3 (?/?/2013): ----------------- +- Modified ISO-9660 driver so that it can handle discs with other than + 2048-byte sectors. This makes it useful for reading "hybrid ISO" images + burned to USB flash disks. + - New mvrefind.sh script to move a rEFInd installation between a standard location (typically EFI/refind) or one of the fallback locations (EFI/BOOT or EFI/Microsoft/Boot). It can also do more exotic locations. diff --git a/filesystems/fsw_efi.c b/filesystems/fsw_efi.c index d7631de..21dafd4 100644 --- a/filesystems/fsw_efi.c +++ b/filesystems/fsw_efi.c @@ -98,7 +98,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.6.2 " FSW_EFI_STRINGIFY(t) L" File System Driver" +#define FSW_EFI_DRIVER_NAME(t) L"rEFInd 0.6.2.1 " FSW_EFI_STRINGIFY(t) L" File System Driver" // function prototypes diff --git a/filesystems/fsw_iso9660.c b/filesystems/fsw_iso9660.c index 271c924..9c1fa54 100644 --- a/filesystems/fsw_iso9660.c +++ b/filesystems/fsw_iso9660.c @@ -323,8 +323,8 @@ static fsw_status_t fsw_iso9660_volume_mount(struct fsw_iso9660_volume *vol) if (vol->primary_voldesc == NULL) return FSW_UNSUPPORTED; pvoldesc = vol->primary_voldesc; - if (ISOINT(pvoldesc->logical_block_size) != 2048) - return FSW_UNSUPPORTED; +// if (ISOINT(pvoldesc->logical_block_size) != 2048) +// return FSW_UNSUPPORTED; // get volume name for (i = 32; i > 0; i--) diff --git a/install.sh b/install.sh index 2aa1491..e5fd604 100755 --- a/install.sh +++ b/install.sh @@ -602,7 +602,7 @@ AddBootEntry() { EntryFilename=$TargetDir/$Refind EfiEntryFilename=`echo ${EntryFilename//\//\\\}` EfiEntryFilename2=`echo ${EfiEntryFilename} | sed s/\\\\\\\\/\\\\\\\\\\\\\\\\/g` - ExistingEntry=`$Efibootmgr -v | grep $EfiEntryFilename2` + ExistingEntry=`$Efibootmgr -v | grep -i $EfiEntryFilename2` if [[ $ExistingEntry ]] ; then ExistingEntryBootNum=`echo $ExistingEntry | cut -c 5-8` @@ -628,7 +628,7 @@ AddBootEntry() { fi fi - else + else # efibootmgr not found EfibootmgrProblems=1 Problems=1 fi diff --git a/mvrefind.sh b/mvrefind.sh index bdab41a..7c955bd 100755 --- a/mvrefind.sh +++ b/mvrefind.sh @@ -78,7 +78,6 @@ FindLinuxESP() { # Adjust filename variables appropriately for their locations and detected # presence (or lack thereof) of shim installation AdjustFilenames() { - echo "Entering AdjustFilenames()" if [[ -f $SourceDir/grubx64.efi ]] ; then SourceX64="grubx64.efi" TargetX64=$SourceX64 @@ -112,17 +111,11 @@ AdjustFilenames() { TargetShim="bootmgfw.efi" fi fi - - echo "Leaving AdjustFilenames():" - echo " SourceX64 = $SourceX64, TargetX64 = $TargetX64" - echo " SourceIA32 = $SourceIA32, TargetIA32 = $TargetIA32" - echo " SourceShim = $SourceShim, TargetShim = $TargetShim" } # AdjustFilenames() # Checks for the presence of necessary files, including both boot loaders # and support utilities (efibootmgr, etc.) CheckForFiles() { - echo "Entering CheckForFiles()" if [[ (! -f $SourceDir/$SourceX64 && ! -f $SourceDir/$SourceIA32) || ($SourceShim != "none" && ! -f $SourceDir/SourceShim) || ! -f $SourceDir/refind.conf ]] ; then @@ -146,7 +139,6 @@ CheckForFiles() { # Do final checks & then move the files! MoveFiles() { - echo "Entering MoveFiles()" ExistingFiles=`find $TargetDir -name "*.efi" 2> /dev/null` if [[ -n $ExistingFiles && $EspTargetDir != "/efi/boot" && $EspTargetDir != "/efi/microsoft/boot" ]] ; then echo "$TargetDir isn't empty! Aborting!" @@ -200,35 +192,30 @@ PostMoveCleanup() { # If necessary, create a new NVRAM entry for the new location AddNvramEntry() { - echo "Entering AddNvramEntry()" InstallIt="0" Efibootmgr=`which efibootmgr 2> /dev/null` InstallDisk=`grep $InstallDir /etc/mtab | cut -d " " -f 1 | cut -c 1-8` PartNum=`grep $InstallDir /etc/mtab | cut -d " " -f 1 | cut -c 9-10` if [[ $TargetShim != "none" ]] ; then - EntryFilename=$TargetDir/$TargetShim + EntryFilename=$EspTargetDir/$TargetShim else CpuType=`uname -m` if [[ $CpuType == 'x86_64' ]] ; then - EntryFilename=$TargetDir/$TargetX64 + EntryFilename=$EspTargetDir/$TargetX64 else - EntryFilename=$TargetDir/$TargetIA32 + EntryFilename=$EspTargetDir/$TargetIA32 fi fi # if/else EfiEntryFilename=`echo ${EntryFilename//\//\\\}` EfiEntryFilename2=`echo ${EfiEntryFilename} | sed s/\\\\\\\\/\\\\\\\\\\\\\\\\/g` - ExistingEntry=`$Efibootmgr -v | grep $EfiEntryFilename2` + ExistingEntry=`$Efibootmgr -v | grep -i $EfiEntryFilename2` if [[ $ExistingEntry ]] ; then ExistingEntryBootNum=`echo $ExistingEntry | cut -c 5-8` FirstBoot=`$Efibootmgr | grep BootOrder | cut -c 12-15` if [[ $ExistingEntryBootNum != $FirstBoot ]] ; then - echo "An existing rEFInd boot entry exists, but isn't set as the default boot" - echo "manager. The boot order is being adjusted to make rEFInd the default boot" - echo "manager. If this is NOT what you want, you should use efibootmgr to" - echo "manually adjust your EFI's boot order." $Efibootmgr -b $ExistingEntryBootNum -B &> /dev/null InstallIt="1" fi @@ -237,7 +224,12 @@ AddNvramEntry() { fi if [[ $InstallIt == "1" ]] ; then - $Efibootmgr -c -l $EfiEntryFilename -L "rEFInd Boot Manager" -d $InstallDisk -p $PartNum &> /dev/null + if [[ $EfiTargetDir == "/efi/microsoft/boot" ]] ; then + # Name it the way some firmware expects -- see http://mjg59.dreamwidth.org/20187.html + $Efibootmgr -c -l $EfiEntryFilename -L "Windows Boot Manager" -d $InstallDisk -p $PartNum &> /dev/null + else + $Efibootmgr -c -l $EfiEntryFilename -L "rEFInd Boot Manager" -d $InstallDisk -p $PartNum &> /dev/null + fi if [[ $? != 0 ]] ; then EfibootmgrProblems=1 fi @@ -269,7 +261,4 @@ AdjustFilenames CheckForFiles MoveFiles PostMoveCleanup -echo "EspTargetDir == \"$EspTargetDir\"" -if [[ $EspTargetDir != "/efi/boot" && $EspTargetDir != "/efi/microsoft/boot" ]] ; then - AddNvramEntry -fi +AddNvramEntry