[PATCH anaconda/master] Add support to determine the ARM processor variety and select the correct kernel to install.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "d.marlin" <dmarlin@xxxxxxxxxx>

Signed-off-by: David A. Marlin <dmarlin@xxxxxxxxxx>
---
 pyanaconda/iutil.py      |   36 ++++++++++++++++++++++++++++++++++++
 pyanaconda/platform.py   |    5 +++++
 pyanaconda/yuminstall.py |    6 ++++++
 3 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index dd691dc..2864980 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -656,6 +656,42 @@ def getPPCMacBook():
         return 1
     return 0
 
+## Get the ARM processor variety.
+# @return The ARM processor variety type, or 0 if not ARM.
+def getARMMachine():
+    if not os.uname()[4].startswith('arm'):
+        return 0
+
+    armMachine = None
+    machine = None
+
+    # ARM machine hash
+    armType = {
+                'OMAP3 Beagle Board'                  : 'omap',
+                'OMAP4 Panda board'                   : 'omap',
+                'trimslice'                           : 'tegra',
+                'Marvell GuruPlug Reference Board'    : 'kirkwood',
+                'Efika MX'                            : 'imx',
+                'Genesi Efika MX'                     : 'imx',
+                'Genesi Efika MX (Smartbook)'         : 'imx',
+                'Highbank'                            : 'highbank',
+              }
+
+    f = open('/proc/cpuinfo', 'r')
+    lines = f.readlines()
+    f.close()
+    for line in lines:
+        if line.find('Hardware') != -1:
+            machine = line.split(':')[1]
+
+    if machine is not None:
+        for type in armType.items():
+            if machine.find(type[0]) != -1:
+                armMachine = type[1]
+
+    return armMachine
+
+
 cell = None
 ## Determine if the hardware is the Cell platform.
 # @return True if so, False otherwise.
diff --git a/pyanaconda/platform.py b/pyanaconda/platform.py
index 335ab5c..5c6ddea 100644
--- a/pyanaconda/platform.py
+++ b/pyanaconda/platform.py
@@ -348,6 +348,7 @@ class Sparc(Platform):
         return start+1
 
 class ARM(Platform):
+    _armMachine = iutil.getARMMachine()
     _bootloaderClass = bootloader.GRUB2
     _boot_stage1_device_types = ["disk"]
     _boot_mbr_description = N_("Master Boot Record")
@@ -356,6 +357,10 @@ class ARM(Platform):
 
     _disklabel_types = ["msdos"]
 
+    @property
+    def armMachine(self):
+        return self._armMachine
+
 def getPlatform(anaconda):
     """Check the architecture of the system and return an instance of a
        Platform subclass to match.  If the architecture could not be determined,
diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
index 109daec..d762959 100644
--- a/pyanaconda/yuminstall.py
+++ b/pyanaconda/yuminstall.py
@@ -1452,6 +1452,12 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
             if selectKernel("kernel-PAE"):
                 foundkernel = True
 
+        if not foundkernel and iutil.isARM():
+            armMachine = iutil.getARMMachine()
+            if armMachine is not None:
+                selectKernel("kernel-" + armMachine)
+                foundkernel = True
+
         if not foundkernel:
             selectKernel("kernel")
 
-- 
1.7.6.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux