usbmgmt/usbmgrtest/automation/makerom.pl
changeset 0 c9bc50fca66e
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 #!/usr/bin/perl -w
       
     2 # Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of "Eclipse Public License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description:
       
    15 #
       
    16 
       
    17 prebuildrom();
       
    18 open ROMCONF, $ARGV[0] or die "Cannot open $ARGV[0]";
       
    19 while (<ROMCONF>) {
       
    20 	($name, $type, $flags, $obylist) = split /,/,;
       
    21 	buildrom($name, $flags, $type, $obylist);
       
    22 }
       
    23 close ROMCONF;
       
    24 
       
    25 sub prebuildrom {
       
    26 	# Rebuild start.rsc to start stauto on startup
       
    27 	unlink("\\epoc32\\data\\z\\System\\PROGRAMS\\start.rsc");
       
    28 	system("attrib -r \\techview\\toolkit\\startup\\group\\start.rss");
       
    29 	system("xcopy start.rss \\techview\\toolkit\\startup\\group\\start.rss /S/C/Y");
       
    30 	system("attrib +r \\techview\\toolkit\\startup\\group\\start.rss");
       
    31 	system("metabld start.mbc");
       
    32 }
       
    33 
       
    34 sub buildrom {
       
    35 	my($name, $flags, $type, $obylist) = @_;
       
    36 
       
    37 	chdir("\\epoc32\\rom");
       
    38 	# Delete Existing Files
       
    39 	unlink("$name.dir");
       
    40 	unlink("$name.img");
       
    41 	unlink("$name.log");
       
    42 	unlink("$name.oby");
       
    43 	unlink("$name.symbol");
       
    44 	unlink("rombuild.txt");
       
    45 	unlink("$name.zip");
       
    46 	unlink("tmp1.oby");
       
    47 
       
    48 	#Build and zip the rom
       
    49 	system("buildrom.cmd $flags $type $obylist -o$name.img");
       
    50 	print "Zipping the rom\n";
       
    51 	system("zip -q -m -9 $name.zip $name.img");
       
    52 }
       
    53