[PATCH 3/4] ARM: break out the setup of OMAP systems as they need to have a vfat partition at the start of the disk in order for the SOC to load u-boot from.

Dennis Gilmore dennis at ausil.us
Wed Aug 1 07:42:05 UTC 2012


Signed-off-by: Dennis Gilmore <dennis at ausil.us>
---
 pyanaconda/platform.py | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/platform.py b/pyanaconda/platform.py
index 1611797..05a496f 100644
--- a/pyanaconda/platform.py
+++ b/pyanaconda/platform.py
@@ -348,6 +348,32 @@ class ARM(Platform):
     def armMachine(self):
         return self._armMachine
 
+class omapARM(ARM):
+    _bootloaderClass = bootloader.UBOOTuEnv
+    _boot_stage1_format_types = ["vfat"]
+    _boot_stage1_device_types = ["partition"]
+    _boot_stage1_mountpoints = ["/boot/uboot"]
+    _boot_mbr_description = N_("Master Boot Record")
+    _boot_descriptions = {"disk": _boot_mbr_description,
+                          "partition": Platform._boot_partition_description}
+
+    def setDefaultPartitioning(self):
+        from storage.partspec import PartSpec
+        ret = Platform.setDefaultPartitioning(self)
+        ret.append(PartSpec(mountpoint="/boot/uboot", fstype="vfat", size=20,
+                            maxSize=20,
+                            grow=True, weight=self.weight(fstype="vfat")))
+        return ret
+
+    def weight(self, fstype=None, mountpoint=None):
+        score = Platform.weight(self, fstype=fstype, mountpoint=mountpoint)
+        if score:
+            return score
+        elif fstype == "vfat" and mountpoint == "/boot/uboot":
+            return 6000
+        else:
+            return 0
+
 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,
@@ -375,6 +401,11 @@ def getPlatform(anaconda):
     elif iutil.isX86():
         return X86(anaconda)
     elif iutil.isARM():
-        return ARM(anaconda)
+        armMachine = iutil.getARMMachine()
+
+        if (armMachine == "omap" ):
+            return omapARM(anaconda)
+        else:
+            return ARM(anaconda)
     else:
         raise SystemError, "Could not determine system architecture."
-- 
1.7.11.2



More information about the anaconda-patches mailing list