]> code.delx.au - refind/commitdiff
More cleanup relating to ARM64 support.
authorsrs5694 <srs5694@users.sourceforge.net>
Sun, 29 Nov 2015 21:04:17 +0000 (16:04 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Sun, 29 Nov 2015 21:04:17 +0000 (16:04 -0500)
debian/control
docs/man/refind-install.8
docs/refind/todo.html
mvrefind

index 3c130f3774a44781de1693ed7c1bf8bd214d23b8..fe66d1c7abe16b5b38ab1df153c75ffc262dcb92 100644 (file)
@@ -10,7 +10,7 @@ Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/refind.git
 Vcs-Git: git://anonscm.debian.org/collab-maint/refind.git
 
 Package: refind
-Architecture: amd64 i386
+Architecture: amd64 i386 arm64
 Depends: efibootmgr, openssl, parted, ${misc:Depends}
 Description: boot manager for EFI-based computers
  A graphical boot manager for EFI- and UEFI-based computers, such as all
index 5034051138bbe7c89abd91150489224256b22683..6c874f643e618840b3b606e2d24cde50eb129751 100644 (file)
@@ -149,8 +149,9 @@ logical volumes.
 .TP
 .B \-\-usedefault \fIdevice-file\fR
 You can install rEFInd to a disk using the default/fallback filename of
-\fBEFI/BOOT/bootx64.efi\fR (and \fBEFI/BOOT/bootia32.efi\fR, if the 32\-bit
-build is available) using this option. The device\-file should be an
+\fBEFI/BOOT/bootx64.efi\fR (as well as \fBEFI/BOOT/bootia32.efi\fR and
+\fBEFI/BOOT/bootaa64.efi\fR, if the IA\-32 and ARM64
+builds are available) using this option. The device\-file should be an
 unmounted ESP, or at least a FAT partition, as in \fB\-\-usedefault
 /dev/sdc1\fR. Your computer's NVRAM entries will not be modified when
 installing in this way. The intent is that you can create a bootable USB
index fafc9ef1909d5f0badf9d5d4be08d753a223fb02..351c2e2c57a8fd060573918d38724823305fc76c 100644 (file)
@@ -179,11 +179,16 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
        optical drives and uses generic icons rather than OS-specific
        icons.</li>
 
-    <li>Currently, rEFInd can detect whether it's compiled for <i>x</i>86
-       or <i>x</i>86-64 systems and displays this information in its
-       "About" screen (<tt>AboutrEFInd()</tt> in <tt>main.c</tt>). I'd
-       like to add detection for Itanium and ARM systems, but I have no
-       way to test such changes.</li>
+    <li>rEFInd's <tt>Makefile</tt>s and, to a lesser extent, C code,
+       support <i>x</i>86, <i>x</i>86-64, and ARM64 CPUs. EFI is also
+       available for Itanium (IA-64) and ARM32 CPUs, so I'd like to add
+       this support.</li>
+
+    <li>Currently, rEFInd can detect whether it's compiled for <i>x</i>86,
+       <i>x</i>86-64, or ARM64 systems and displays this information in
+       its "About" screen (<tt>AboutrEFInd()</tt> in <tt>main.c</tt>). I'd
+       like to add detection for Itanium and 32-bit ARM systems, but I
+       have no way to test such changes.</li>
 
     <li>Further to the preceding, rEFInd's GPT-scanning code (used to
        extract partition names) includes assumptions about byte order, and
index d910a555eee0499a5be58089cbd181c28b74a54a..1446e4cd7badfc62c1f137e48b2e35bc6324af64 100755 (executable)
--- a/mvrefind
+++ b/mvrefind
@@ -12,6 +12,7 @@
 #
 # Revision history:
 #
+# 0.10.1  -- Generalized to support ARM64 (aka AARCH64, aa64)
 # 0.10.0  -- Renamed from mvrefind.sh to mvrefind
 # 0.6.3   -- Initial release
 #
 # with which they first appeared.
 
 RootDir="/"
-SourceX64="refind_x64.efi"
-TargetX64=$SourceX64
-SourceIA32="refind_ia32.efi"
-TargetIA32=$SourceIA32
 SourceShim="shim.efi"
 TargetShim=$SourceShim
 SourceDir=`readlink -f ${1}`
@@ -76,14 +73,34 @@ FindLinuxESP() {
    fi
 } # FindLinuxESP
 
+DeterminePlatform() {
+    CpuType=`uname -m`
+    case "$CpuType" in
+    aarch64)
+        Platform="aa64"
+        ;;
+    x86_64)
+        Platform="x64"
+        ;;
+    i?86)
+        Platform="ia32"
+        ;;
+    *)
+        echo "Unsupported CPU type; aborting!"
+        exit 1
+    esac
+    Source="refind_$Platform.efi"
+    Target=$Source
+}
+
 # Adjust filename variables appropriately for their locations and detected
 # presence (or lack thereof) of shim installation
 AdjustFilenames() {
-   if [[ -f $SourceDir/grubx64.efi ]] ; then
-      SourceX64="grubx64.efi"
-      TargetX64=$SourceX64
+   if [[ -f $SourceDir/grub$Platform.efi ]] ; then
+      Source="grub$Platform.efi"
+      Target=$Source
       if [[ $EspSourceDir == "/efi/boot" ]] ; then
-         SourceShim="bootx64.efi"
+         SourceShim="boot$Platform.efi"
       elif [[ $EspSourceDir == "/efi/microsoft/boot" ]] ; then
          SourceShim="bootmgfw.efi"
       fi
@@ -91,23 +108,21 @@ AdjustFilenames() {
       SourceShim="none"
       TargetShim="none"
       if [[ $EspSourceDir == "/efi/boot" ]] ; then
-         SourceX64="bootx64.efi"
-         SourceIA32="bootia32.efi"
+         Source="boot$Platform.efi"
       elif [[ $EspSourceDir == "/efi/microsoft/boot" ]] ; then
-         SourceX64="bootmgfw.efi"
+         Source="bootmgfw.efi"
       fi
    fi
 
    if [[ $EspTargetDir == "/efi/boot" ]] ; then
       if [[ $TargetShim == "none" ]] ; then
-         TargetX64="bootx64.efi"
-         TargetIA32="bootia32.efi"
+         Target="boot$Platform.efi"
       else
-         TargetShim="bootx64.efi"
+         TargetShim="boot$Platform.efi"
       fi
    elif [[ $EspTargetDir == "/efi/microsoft/boot" ]] ; then
       if [[ $TargetShim == "none" ]] ; then
-         TargetX64="bootmgfw.efi"
+         Target="bootmgfw.efi"
       else
          TargetShim="bootmgfw.efi"
       fi
@@ -117,7 +132,7 @@ AdjustFilenames() {
 # Checks for the presence of necessary files, including both boot loaders
 # and support utilities (efibootmgr, etc.)
 CheckForFiles() {
-   if [[ (! -f $SourceDir/$SourceX64 && ! -f $SourceDir/$SourceIA32) ||
+   if [[ (! -f $SourceDir/$Source) ||
          ($SourceShim != "none" && ! -f $SourceDir/SourceShim) ||
          ! -f $SourceDir/refind.conf ]] ; then
       echo "There doesn't seem to be a rEFInd installation at $SourceDir!"
@@ -174,8 +189,7 @@ MoveFiles() {
    mv $SourceDir/icons-backup $TargetDir/ 2> /dev/null
    mv $SourceDir/drivers_* $TargetDir/ 2> /dev/null
    mv $SourceDir/keys $TargetDir 2> /dev/null
-   mv $SourceDir/$SourceX64 $TargetDir/$TargetX64 2> /dev/null
-   mv $SourceDir/$SourceIA32 $TargetDir/$TargetIA32 2> /dev/null
+   mv $SourceDir/$Source $TargetDir/$Target 2> /dev/null
    mv $SourceDir/$SourceShim $TargetDir/$TargetShim 2> /dev/null
    mv $SourceDir/refind.conf* $TargetDir/ 2> /dev/null
    rmdir $SourceDir 2> /dev/null
@@ -201,12 +215,7 @@ AddNvramEntry() {
    if [[ $TargetShim != "none" ]] ; then
       EntryFilename=$EspTargetDir/$TargetShim
    else
-      CpuType=`uname -m`
-      if [[ $CpuType == 'x86_64' ]] ; then
-         EntryFilename=$EspTargetDir/$TargetX64
-      else
-         EntryFilename=$EspTargetDir/$TargetIA32
-      fi
+      EntryFilename=$EspTargetDir/$Target
    fi # if/else
 
    EfiEntryFilename=`echo ${EntryFilename//\//\\\}`
@@ -258,6 +267,7 @@ if [[ `whoami` != "root" ]] ; then
 fi
 
 FindLinuxESP
+DeterminePlatform
 AdjustFilenames
 CheckForFiles
 MoveFiles