sl@0: # Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: # All rights reserved. sl@0: # This component and the accompanying materials are made available sl@0: # under the terms of "Eclipse Public License v1.0" sl@0: # which accompanies this distribution, and is available sl@0: # at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: # sl@0: # Initial Contributors: sl@0: # Nokia Corporation - initial contribution. sl@0: # sl@0: # Contributors: sl@0: # sl@0: # Description: sl@0: # sl@0: sl@0: #!perl sl@0: use strict; sl@0: use warnings; sl@0: use File::Copy; sl@0: sl@0: ## THIS SCRIPT NEEDS TO BE RUN FROM \epoc32\rom\tools ONLY sl@0: sl@0: ## Perform cleanup first sl@0: rmdir("rom_images"); sl@0: mkdir("rom_images"); sl@0: sl@0: ## Number of ROFS to build specify number max 7 sl@0: my $no_rofs = $ARGV[0]; sl@0: sl@0: ## Udeb/Urel configuration 1 means udeb sl@0: my $udeb =$ARGV[1]; sl@0: sl@0: ## Textshell/Techview configuration 1 means textshell sl@0: my $shell=$ARGV[2]; sl@0: sl@0: ## Last argument check whether txt or cre test mode sl@0: my $txt=$ARGV[3]; sl@0: sl@0: my $buildrom_com="-D_NAND2 h4hrp"; sl@0: sl@0: ## Append the full debug option sl@0: if ($udeb==1) sl@0: { sl@0: $buildrom_com.=" -D_FULL_DEBUG"; sl@0: } sl@0: if ($txt==1) sl@0: { sl@0: $buildrom_com.=" -DPDS_PERFTEST_TXT"; sl@0: } sl@0: sl@0: ## Append whether textshell or techview and also add the centrep patchable constant sl@0: if ($shell==1) sl@0: { sl@0: $buildrom_com.=" syslibs_textshell.oby syslibs_utils centreptesthelper.iby"; sl@0: my $patchconst=" t_centrepPatchConst".$no_rofs.".iby"; sl@0: $buildrom_com.=$patchconst; sl@0: } sl@0: else sl@0: { sl@0: # $buildrom_com.=" techview centrepPatchConst.iby centreptesthelper.iby"; sl@0: $buildrom_com.=" techview centreptesthelper.iby"; sl@0: } sl@0: sl@0: if ($txt==1) sl@0: { sl@0: $buildrom_com.=" t_centrepPerfPatchConstTxt.iby"; sl@0: } sl@0: else sl@0: { sl@0: $buildrom_com.=" t_centrepPerfPatchConstCre.iby"; sl@0: } sl@0: sl@0: ## Make a copy of the estart for backup sl@0: unlink("../h4hrp/unistore2/estartnandcomp.txt_bak"); sl@0: copy("../h4hrp/unistore2/estartnandcomp.txt","../h4hrp/unistore2/estartnandcomp.txt_bak") or die("Cannot backup"); sl@0: sl@0: ## Need to copy the corresponding estart to the right location sl@0: my $estartfile_name="estartnandcomp".$no_rofs.".txt"; sl@0: copy ($estartfile_name,"../h4hrp/unistore2/estartnandcomp.txt") or die("Cannot copy estart"); sl@0: sl@0: sl@0: ## Now call the buildrom sl@0: my $command="buildrom.cmd ".$buildrom_com; sl@0: print $command; sl@0: sl@0: ## build the core and ROFS1.img sl@0: if ($no_rofs>=1) sl@0: { sl@0: $command.=" PREQ2112_ROFS1.iby"; sl@0: } sl@0: system($command); sl@0: ## rename the image files sl@0: sl@0: if ($shell==1) sl@0: { sl@0: copy("h4hrp_001.textshell_rom.nand.IMG","./rom_images/core.img") or die("Cannot copy core.img"); sl@0: copy("h4hrp_001.textshell_rom.nand.rofs.img","./rom_images/rofs1.img") or die("Cannot copy rofs1.img"); sl@0: } sl@0: else sl@0: { sl@0: copy("h4hrp_001.techview.nand.IMG","./rom_images/core.img") or die("Cannot copy"); sl@0: copy("h4hrp_001.techview.nand.rofs.img","./rom_images/rofs1.img") or die("Cannot copy"); sl@0: } sl@0: sl@0: ## Now build the rest ROFS images sl@0: for (my $i=2;$i<=$no_rofs;$i++) sl@0: { sl@0: my $rofs_comm="../../tools/rofsbuild.exe ../include/PREQ2112_ROFS".$i.".iby"; sl@0: system($rofs_comm); sl@0: copy("rofs".$i.".img","rom_images/rofs".$i.".img") or die("Cannot copy rofs2 etc"); sl@0: } sl@0: sl@0: ## Restore the estart we have overriden sl@0: copy("../h4hrp/unistore2/estartnandcomp.txt_bak","../h4hrp/unistore2/estartnandcomp.txt");