os/persistentdata/persistentstorage/centralrepository/test/multirofs/group/buildMultiRofs.pl
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/centralrepository/test/multirofs/group/buildMultiRofs.pl	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,114 @@
     1.4 +# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +# All rights reserved.
     1.6 +# This component and the accompanying materials are made available
     1.7 +# under the terms of "Eclipse Public License v1.0"
     1.8 +# which accompanies this distribution, and is available
     1.9 +# at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +#
    1.11 +# Initial Contributors:
    1.12 +# Nokia Corporation - initial contribution.
    1.13 +#
    1.14 +# Contributors:
    1.15 +#
    1.16 +# Description:
    1.17 +#
    1.18 +
    1.19 +#!perl
    1.20 +use strict;
    1.21 +use warnings;
    1.22 +use File::Copy;
    1.23 +
    1.24 +## THIS SCRIPT NEEDS TO BE RUN FROM \epoc32\rom\tools ONLY
    1.25 +
    1.26 +## Perform cleanup first
    1.27 +rmdir("rom_images");
    1.28 +mkdir("rom_images");
    1.29 +
    1.30 +## Number of ROFS to build specify number max 7
    1.31 +my $no_rofs = $ARGV[0];
    1.32 +
    1.33 +## Udeb/Urel configuration	1 means udeb
    1.34 +my $udeb =$ARGV[1];
    1.35 +
    1.36 +## Textshell/Techview configuration 1 means textshell
    1.37 +my $shell=$ARGV[2];
    1.38 +
    1.39 +## Last argument check whether txt or cre test mode
    1.40 +my $txt=$ARGV[3];
    1.41 +
    1.42 +my $buildrom_com="-D_NAND2 h4hrp";
    1.43 +
    1.44 +## Append the full debug option
    1.45 +if ($udeb==1)
    1.46 +	{
    1.47 +	$buildrom_com.=" -D_FULL_DEBUG";
    1.48 +	}
    1.49 +if ($txt==1)
    1.50 +	{
    1.51 +	$buildrom_com.=" -DPDS_PERFTEST_TXT";
    1.52 +	}
    1.53 +
    1.54 +## Append whether textshell or techview and also add the centrep patchable constant
    1.55 +if ($shell==1)
    1.56 +	{
    1.57 +	$buildrom_com.=" syslibs_textshell.oby syslibs_utils centreptesthelper.iby";
    1.58 +	my $patchconst=" t_centrepPatchConst".$no_rofs.".iby";
    1.59 +	$buildrom_com.=$patchconst;
    1.60 +	}
    1.61 +else
    1.62 +	{
    1.63 +#	$buildrom_com.=" techview centrepPatchConst.iby centreptesthelper.iby"; 
    1.64 +	$buildrom_com.=" techview centreptesthelper.iby"; 
    1.65 +	}
    1.66 +
    1.67 +if ($txt==1)
    1.68 +	{
    1.69 +	$buildrom_com.=" t_centrepPerfPatchConstTxt.iby";
    1.70 +	}
    1.71 +else
    1.72 +	{
    1.73 +	$buildrom_com.=" t_centrepPerfPatchConstCre.iby";
    1.74 +	}
    1.75 +
    1.76 +## Make a copy of the estart for backup
    1.77 +unlink("../h4hrp/unistore2/estartnandcomp.txt_bak");
    1.78 +copy("../h4hrp/unistore2/estartnandcomp.txt","../h4hrp/unistore2/estartnandcomp.txt_bak") or die("Cannot backup");
    1.79 +
    1.80 +## Need to copy the corresponding estart to the right location
    1.81 +my $estartfile_name="estartnandcomp".$no_rofs.".txt";
    1.82 +copy ($estartfile_name,"../h4hrp/unistore2/estartnandcomp.txt") or die("Cannot copy estart");
    1.83 +
    1.84 +
    1.85 +## Now call the buildrom
    1.86 +my $command="buildrom.cmd ".$buildrom_com;
    1.87 +print $command;
    1.88 +
    1.89 +## build the core and ROFS1.img
    1.90 +if ($no_rofs>=1)
    1.91 +	{
    1.92 +	$command.=" PREQ2112_ROFS1.iby";
    1.93 +	}
    1.94 +system($command);
    1.95 +## rename the image files
    1.96 +
    1.97 +if ($shell==1)
    1.98 +	{
    1.99 +	copy("h4hrp_001.textshell_rom.nand.IMG","./rom_images/core.img") or die("Cannot copy core.img");
   1.100 +	copy("h4hrp_001.textshell_rom.nand.rofs.img","./rom_images/rofs1.img") or die("Cannot copy rofs1.img");
   1.101 +	}
   1.102 +else
   1.103 +	{
   1.104 +	copy("h4hrp_001.techview.nand.IMG","./rom_images/core.img") or die("Cannot copy");
   1.105 +	copy("h4hrp_001.techview.nand.rofs.img","./rom_images/rofs1.img") or die("Cannot copy");
   1.106 +	}
   1.107 +
   1.108 +## Now build the rest ROFS images
   1.109 +for (my $i=2;$i<=$no_rofs;$i++)
   1.110 +	{
   1.111 +	my $rofs_comm="../../tools/rofsbuild.exe ../include/PREQ2112_ROFS".$i.".iby";
   1.112 +	system($rofs_comm);
   1.113 +	copy("rofs".$i.".img","rom_images/rofs".$i.".img") or die("Cannot copy rofs2 etc");
   1.114 +	}
   1.115 +
   1.116 +## Restore the estart we have overriden
   1.117 +copy("../h4hrp/unistore2/estartnandcomp.txt_bak","../h4hrp/unistore2/estartnandcomp.txt");
   1.118 \ No newline at end of file