buildframework/helium/tools/compile/ImageCreation.pl
changeset 307 22ecbfc20eb4
parent 215 b61c19d4168d
parent 217 0f5e3a7fb6af
child 308 7830b8253b5a
equal deleted inserted replaced
215:b61c19d4168d 307:22ecbfc20eb4
     1 #============================================================================ 
       
     2 #Name        : ImageCreation.pl 
       
     3 #Part of     : Helium 
       
     4 
       
     5 #Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     6 #All rights reserved.
       
     7 #This component and the accompanying materials are made available
       
     8 #under the terms of the License "Eclipse Public License v1.0"
       
     9 #which accompanies this distribution, and is available
       
    10 #at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    11 #
       
    12 #Initial Contributors:
       
    13 #Nokia Corporation - initial contribution.
       
    14 #
       
    15 #Contributors:
       
    16 #
       
    17 #Description: 
       
    18 #============================================================================
       
    19 
       
    20 use warnings;
       
    21 #use strict;
       
    22 use IPC::Open2;
       
    23 use FileHandle;
       
    24 use File::Copy;
       
    25 use Cwd;
       
    26 use Getopt::Long;
       
    27 
       
    28 my($copyto,$MyTraces,$Drive,$product,$type);
       
    29 my $result = GetOptions(
       
    30         "copyto=s"  => \$copyto,
       
    31         "mytraces=s"  => \$Mytraces,
       
    32         "Drive=s"=> \$Drive,
       
    33         "product=s"=> \$product,
       
    34         "type=s"=> \$type
       
    35         );
       
    36 if((!$copyto) or (!$product) or (!$type))
       
    37   {
       
    38     &Usage;
       
    39     }
       
    40 
       
    41 my $imagedes=$copyto;
       
    42 my $Traces="\\epoc32\\rombuild";
       
    43 my $pid;
       
    44 
       
    45 if($Drive)
       
    46 {
       
    47 	chdir "$Drive" or die "Cannot change Directory to $Drive\n";
       
    48 }
       
    49 
       
    50 chdir ("/epoc32/rom/") or die "Cannot Change Directory to /epoc32/rom/";
       
    51 
       
    52 if($Mytraces)
       
    53 	{
       
    54 		print "Removing $Traces \n";
       
    55 		print unlink "$Traces\\mytraces.txt";
       
    56     `echo " " > $Traces\\mytraces.txt`;
       
    57 	}
       
    58 AGAIN:
       
    59 #system("del *$product* 2>&1");
       
    60 
       
    61 
       
    62 print system("perl BuildS60Rom.pl -product $product -type $type -b -dir $imagedes") or die "cannot open BuildS60Rom.pl";
       
    63 
       
    64 #system("move *$product*.* $copyto");
       
    65 system("move \\flash_temp\\*erase_userdisk.fpsx $copyto");
       
    66 if($Mytraces)
       
    67   {
       
    68     print copy ($Mytraces,"$Traces\\myTraces.txt");;
       
    69     
       
    70     $imagedes="$copyto\\udeb";
       
    71     system ("mkdir $copyto");
       
    72     $Mytraces=();
       
    73     goto AGAIN;
       
    74   }
       
    75 
       
    76 #system("7za a $copyto\\images.zip  $copyto\\*%USERNAME%*.*");
       
    77 
       
    78 sub Usage
       
    79 {
       
    80   print "Usage:
       
    81               imagecreation.pl -copyto <1> -MyTraces <2> -Drive <3> -product <4> -type <5>
       
    82               
       
    83                 <1> Create images to specified directory [Mandatory]
       
    84                 <2> Location to Mytraces.txt or any other file to-be used as mytraces
       
    85                 <3> Drive where SDK is Istalled on which Image needs to be created
       
    86                 <4> Supported for particular release [Mandatory]
       
    87                 <5> [rnd|prd|subcon]  Set the image type [Mandatory]
       
    88         ";
       
    89         exit 0
       
    90   }