apex-env: Find partition named 'apex' for environment link.
authorRod Whitby <rod@whitby.id.au>
Sun, 23 Dec 2007 10:09:00 +0000 (10:09 +0000)
committerRod Whitby <rod@whitby.id.au>
Sun, 23 Dec 2007 10:09:00 +0000 (10:09 +0000)
packages/apex/apex-env_1.5.8.bb
packages/apex/files/find-apex-partition.patch [new file with mode: 0644]

index 0f310f1..a0e4434 100644 (file)
@@ -3,9 +3,11 @@ SECTION = "util"
 PRIORITY = "optional"
 HOMEPAGE = "http://wiki.buici.com/twiki/bin/view/Main/ApexBootloader"
 LICENSE = "GPL"
-PR = "r1"
+PR = "r1"
 
-SRC_URI = "ftp://ftp.buici.com/pub/apex/apex-${PV}.tar.gz"
+SRC_URI = "ftp://ftp.buici.com/pub/apex/apex-${PV}.tar.gz \
+       file://find-apex-partition.patch;patch=1 \
+       "
 S = ${WORKDIR}/apex-${PV}/usr
 
 EXTRA_OEMAKE_append = " CROSS_COMPILE=${CROSS_DIR}/bin/${HOST_PREFIX}"
diff --git a/packages/apex/files/find-apex-partition.patch b/packages/apex/files/find-apex-partition.patch
new file mode 100644 (file)
index 0000000..3aa62a1
--- /dev/null
@@ -0,0 +1,34 @@
+*** usr/link.cc.orig   Sun Dec 23 20:31:49 2007
+--- usr/link.cc        Sun Dec 23 20:32:46 2007
+***************
+*** 278,285 ****
+     fixed-up env_link structure, scanning for the environment variables
+     and their defaults, and opening the flash instance of the
+     environment.  It first looks for the "Loader" partition.  If there
+!    is none, it uses the first partition with the assumption that APEX
+!    may be the primary boot loader.
+  
+  */
+  
+--- 278,286 ----
+     fixed-up env_link structure, scanning for the environment variables
+     and their defaults, and opening the flash instance of the
+     environment.  It first looks for the "Loader" partition.  If there
+!    is none, it then looks for the "apex" partition.  If there is none,
+!    it uses the first partition with the assumption that APEX  may be
+!    the primary boot loader.
+  
+  */
+  
+***************
+*** 289,294 ****
+--- 290,298 ----
+    MTDPartition mtd = MTDPartition::find ("Loader");
+  
+    if (!mtd.is ())
++     mtd = MTDPartition::find ("apex");
++ 
++   if (!mtd.is ())
+      mtd = MTDPartition::first ();
+  
+    bool fFound = mtd.is () && open_apex (mtd);