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