]> code.delx.au - refind/blobdiff - refind-install
Updated NEWS and docs for 0.10.6
[refind] / refind-install
index 19da6a0b09d225cfbfde70caff12b70b3dd7b649..5936dc340bdc2d42577251acaefcfc3de5db1694 100755 (executable)
@@ -39,6 +39,7 @@
 
 # Revision history:
 #
+# 0.10.5  -- More improvement to handling of disks (other than /dev/[sh]d? disks).
 # 0.10.4  -- Improved handling of disks (other than /dev/[sh]d? disks).
 # 0.10.2  -- Improved Secure Boot detection in Linux, fixed --usedefault in OS X,
 #            and fixed bug that could cause mountesp to be installed as a FILE
@@ -795,7 +796,7 @@ SetupMacHfs() {
         <key>ProductName</key>
         <string>rEFInd</string>
         <key>ProductVersion</key>
-        <string>0.10.3</string>
+        <string>0.10.5</string>
 </dict>
 </plist>
 ENDOFHERE
@@ -1127,10 +1128,25 @@ FindMountedESP() {
 # If this fails, sets Problems=1
 AddBootEntry() {
    local PartNum
+   local InstallDisk
+   local InstallPart
+   local Name
    Efibootmgr=`which efibootmgr 2> /dev/null`
    if [[ "$Efibootmgr" ]] ; then
-      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`
+      InstallPart=`grep "$InstallDir" /etc/mtab | cut -d " " -f 1`
+      for Name in `lsblk -r | grep disk | cut -f 1 -d " "` ; do
+         if [[ $InstallPart == *"$Name"* ]] ; then
+            InstallDisk="/dev/"$Name
+            PartNum=${InstallPart#$InstallDisk}
+            PartNum=`echo "${PartNum//[!0-9]/}"`
+            break
+         fi
+      done
+      if [[ -z $InstallDisk || -z $PartNum ]] ; then
+         echo "Could not identify ESP in AddBootEntry()!"
+         Problems=1
+         return 1
+      fi
       EntryFilename="$TargetDir/$Refind"
       EfiEntryFilename=`echo ${EntryFilename//\//\\\}`
       EfiEntryFilename2=`echo ${EfiEntryFilename} | sed s/\\\\\\\\/\\\\\\\\\\\\\\\\/g`