blocks in ISO-9660 driver
+ rm -f *.o *.obj *~ *.lib
0.6.3 (?/?/2013):
-----------------
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.
- 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.
/** Helper macro for stringification. */
#define FSW_EFI_STRINGIFY(x) #x
/** Expands to the EFI driver name given the file system type name. */
/** 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"
if (vol->primary_voldesc == NULL)
return FSW_UNSUPPORTED;
pvoldesc = vol->primary_voldesc;
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--)
// get volume name
for (i = 32; i > 0; i--)
EntryFilename=$TargetDir/$Refind
EfiEntryFilename=`echo ${EntryFilename//\//\\\}`
EfiEntryFilename2=`echo ${EfiEntryFilename} | sed s/\\\\\\\\/\\\\\\\\\\\\\\\\/g`
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`
if [[ $ExistingEntry ]] ; then
ExistingEntryBootNum=`echo $ExistingEntry | cut -c 5-8`
+ else # efibootmgr not found
EfibootmgrProblems=1
Problems=1
fi
EfibootmgrProblems=1
Problems=1
fi
# Adjust filename variables appropriately for their locations and detected
# presence (or lack thereof) of shim installation
AdjustFilenames() {
# 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
if [[ -f $SourceDir/grubx64.efi ]] ; then
SourceX64="grubx64.efi"
TargetX64=$SourceX64
TargetShim="bootmgfw.efi"
fi
fi
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() {
} # 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
if [[ (! -f $SourceDir/$SourceX64 && ! -f $SourceDir/$SourceIA32) ||
($SourceShim != "none" && ! -f $SourceDir/SourceShim) ||
! -f $SourceDir/refind.conf ]] ; then
# Do final checks & then move the files!
MoveFiles() {
# 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!"
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!"
# If necessary, create a new NVRAM entry for the new location
AddNvramEntry() {
# 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
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
else
CpuType=`uname -m`
if [[ $CpuType == 'x86_64' ]] ; then
- EntryFilename=$TargetDir/$TargetX64
+ EntryFilename=$EspTargetDir/$TargetX64
- EntryFilename=$TargetDir/$TargetIA32
+ EntryFilename=$EspTargetDir/$TargetIA32
fi
fi # if/else
EfiEntryFilename=`echo ${EntryFilename//\//\\\}`
EfiEntryFilename2=`echo ${EfiEntryFilename} | sed s/\\\\\\\\/\\\\\\\\\\\\\\\\/g`
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
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
$Efibootmgr -b $ExistingEntryBootNum -B &> /dev/null
InstallIt="1"
fi
fi
if [[ $InstallIt == "1" ]] ; then
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
if [[ $? != 0 ]] ; then
EfibootmgrProblems=1
fi
CheckForFiles
MoveFiles
PostMoveCleanup
CheckForFiles
MoveFiles
PostMoveCleanup
-echo "EspTargetDir == \"$EspTargetDir\""
-if [[ $EspTargetDir != "/efi/boot" && $EspTargetDir != "/efi/microsoft/boot" ]] ; then
- AddNvramEntry
-fi