[Avila] fail over mechanism strategy (Avila IXP425 ) - need suggestion

David Acker dacker at roinet.com
Thu Feb 22 11:28:37 EST 2007


--------------070402090108020405030104
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Bhanu Prakash Adhikari wrote:
> Folks,
> 
> I'm working on a fail over mechanism on Avila board with IXP425
> processor.
> 
> My new requirement is to have a robust fail over mechanism - for example
> - when the CF card or the image it has got corrupted for some reason, I
> must have a light thin version (may be uClinux or snapgear) of image
> should be loaded on the board and continue working with the new
> (uClinux/snapgear) image. With the thin image the CF will be rewritten
> or reformatted with new image.
> 
> My strategy is to have uClinux/snapgear image on the inbuilt flash and
> would be invoked when CF is corrupted.
> 

We have a setup with a failsafe kernel and production kernel and a 
failsafe ramdisk and a production ramdisk all on the built in flash.  It 
is a busybox based setup with just the other commands we need.  The 
failsafe's only job in life is to allow for USB based upgrading and is 
this a stipped down kernel and ramdisk.  When we do an upgrade we change 
redboot's startup config to point to the failsafe area.  Only after we 
have confirmed that the new flash is totally written correctly do we 
switch the boot line to the production flash.
To change redboot's startup line from linux use fconfig from 
http://andrzejekiert.ovh.org/software.html.en

The mailing list website appears to be down, so I will reproduce the 
notes I had about this from some time ago.

The fconfig author states that it will not work for flash stored 
settings but I believe he just hit a setup issue...the partitions are 
not setup the way the MTD layer wants them by the default redboot so 
that they are not writable.  It puts the "RedBoot config" and the "FIS 
directory" into one flash block.  The MTD code wants all partitions to 
end on a flash block.  It is pretty easy to fix though.  First, Redboot 
has a config parameter to control it.  Turn off:
CYGSEM_REDBOOT_FLASH_COMBINED_FIS_AND_CONFIG

Next, I patched redboot to size the "RedBoot config" so that it was at 
least a flash block.  MTD will not let you write to partitions that end 
before the flash block does.

Checkout the attached patch...it fixes both issues.  Note, you will have 
  to fis init after this.

You will also need to use flash_unlock to open the flash.

After that you can use fconfig to change to boot script.
-Ack

--------------070402090108020405030104
Content-Type: text/x-patch;
 name="redbootConfig.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="redbootConfig.diff"

diff -urpN redboot.orig/packages/redboot/current/cdl/redboot.cdl redboot/packages/redboot/current/cdl/redboot.cdl
--- redboot.orig/packages/redboot/current/cdl/redboot.cdl	2005-10-08 15:16:50.000000000 -0400
+++ redboot/packages/redboot/current/cdl/redboot.cdl	2006-10-17 17:46:54.000000000 -0400
@@ -849,7 +849,7 @@ cdl_package CYGPKG_REDBOOT {
                 display       "Merged config data and FIS directory"
                 flavor        bool              
                 active_if     { CYGOPT_REDBOOT_FIS && (CYGHWR_REDBOOT_FLASH_CONFIG_MEDIA == "FLASH") }
-                default_value 1
+                default_value 0
                 description "
                   If this option is set, then the FIS directory and FLASH 
                   configuration database will be stored in the same physical
diff -urpN redboot.orig/packages/redboot/current/src/fconfig.c redboot/packages/redboot/current/src/fconfig.c
--- redboot.orig/packages/redboot/current/src/fconfig.c	2005-04-25 16:28:54.000000000 -0400
+++ redboot/packages/redboot/current/src/fconfig.c	2006-10-17 17:45:44.000000000 -0400
@@ -1143,7 +1143,7 @@ load_flash_config(void)
     fisdir_size -= cfg_size;
 #else
     cfg_size = (flash_block_size > sizeof(struct _config)) ? 
-        sizeof(struct _config) : 
+        flash_block_size : 
         _rup(sizeof(struct _config), flash_block_size);
     if (CYGNUM_REDBOOT_FLASH_CONFIG_BLOCK < 0) {
         cfg_base = (void *)((CYG_ADDRESS)flash_end + 1 -

--------------070402090108020405030104--





More information about the Avila mailing list