os/persistentdata/persistentstorage/centralrepository/test/multirofs/group/buildMultiRofs.pl
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 # Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 # All rights reserved.
     3 # This component and the accompanying materials are made available
     4 # under the terms of "Eclipse Public License v1.0"
     5 # which accompanies this distribution, and is available
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 #
     8 # Initial Contributors:
     9 # Nokia Corporation - initial contribution.
    10 #
    11 # Contributors:
    12 #
    13 # Description:
    14 #
    15 
    16 #!perl
    17 use strict;
    18 use warnings;
    19 use File::Copy;
    20 
    21 ## THIS SCRIPT NEEDS TO BE RUN FROM \epoc32\rom\tools ONLY
    22 
    23 ## Perform cleanup first
    24 rmdir("rom_images");
    25 mkdir("rom_images");
    26 
    27 ## Number of ROFS to build specify number max 7
    28 my $no_rofs = $ARGV[0];
    29 
    30 ## Udeb/Urel configuration	1 means udeb
    31 my $udeb =$ARGV[1];
    32 
    33 ## Textshell/Techview configuration 1 means textshell
    34 my $shell=$ARGV[2];
    35 
    36 ## Last argument check whether txt or cre test mode
    37 my $txt=$ARGV[3];
    38 
    39 my $buildrom_com="-D_NAND2 h4hrp";
    40 
    41 ## Append the full debug option
    42 if ($udeb==1)
    43 	{
    44 	$buildrom_com.=" -D_FULL_DEBUG";
    45 	}
    46 if ($txt==1)
    47 	{
    48 	$buildrom_com.=" -DPDS_PERFTEST_TXT";
    49 	}
    50 
    51 ## Append whether textshell or techview and also add the centrep patchable constant
    52 if ($shell==1)
    53 	{
    54 	$buildrom_com.=" syslibs_textshell.oby syslibs_utils centreptesthelper.iby";
    55 	my $patchconst=" t_centrepPatchConst".$no_rofs.".iby";
    56 	$buildrom_com.=$patchconst;
    57 	}
    58 else
    59 	{
    60 #	$buildrom_com.=" techview centrepPatchConst.iby centreptesthelper.iby"; 
    61 	$buildrom_com.=" techview centreptesthelper.iby"; 
    62 	}
    63 
    64 if ($txt==1)
    65 	{
    66 	$buildrom_com.=" t_centrepPerfPatchConstTxt.iby";
    67 	}
    68 else
    69 	{
    70 	$buildrom_com.=" t_centrepPerfPatchConstCre.iby";
    71 	}
    72 
    73 ## Make a copy of the estart for backup
    74 unlink("../h4hrp/unistore2/estartnandcomp.txt_bak");
    75 copy("../h4hrp/unistore2/estartnandcomp.txt","../h4hrp/unistore2/estartnandcomp.txt_bak") or die("Cannot backup");
    76 
    77 ## Need to copy the corresponding estart to the right location
    78 my $estartfile_name="estartnandcomp".$no_rofs.".txt";
    79 copy ($estartfile_name,"../h4hrp/unistore2/estartnandcomp.txt") or die("Cannot copy estart");
    80 
    81 
    82 ## Now call the buildrom
    83 my $command="buildrom.cmd ".$buildrom_com;
    84 print $command;
    85 
    86 ## build the core and ROFS1.img
    87 if ($no_rofs>=1)
    88 	{
    89 	$command.=" PREQ2112_ROFS1.iby";
    90 	}
    91 system($command);
    92 ## rename the image files
    93 
    94 if ($shell==1)
    95 	{
    96 	copy("h4hrp_001.textshell_rom.nand.IMG","./rom_images/core.img") or die("Cannot copy core.img");
    97 	copy("h4hrp_001.textshell_rom.nand.rofs.img","./rom_images/rofs1.img") or die("Cannot copy rofs1.img");
    98 	}
    99 else
   100 	{
   101 	copy("h4hrp_001.techview.nand.IMG","./rom_images/core.img") or die("Cannot copy");
   102 	copy("h4hrp_001.techview.nand.rofs.img","./rom_images/rofs1.img") or die("Cannot copy");
   103 	}
   104 
   105 ## Now build the rest ROFS images
   106 for (my $i=2;$i<=$no_rofs;$i++)
   107 	{
   108 	my $rofs_comm="../../tools/rofsbuild.exe ../include/PREQ2112_ROFS".$i.".iby";
   109 	system($rofs_comm);
   110 	copy("rofs".$i.".img","rom_images/rofs".$i.".img") or die("Cannot copy rofs2 etc");
   111 	}
   112 
   113 ## Restore the estart we have overriden
   114 copy("../h4hrp/unistore2/estartnandcomp.txt_bak","../h4hrp/unistore2/estartnandcomp.txt");