imgtools/buildrom/tools/buildrom.pm
changeset 647 53d1ab72f5bc
parent 633 a4eca1f021ac
child 651 0d0d83e3702d
child 654 7c11c3d8d025
equal deleted inserted replaced
641:8dd670a9f34f 647:53d1ab72f5bc
    55 	process_dlldata
    55 	process_dlldata
    56 	featurefile_creation_phase
    56 	featurefile_creation_phase
    57 	processData
    57 	processData
    58 	create_smrimage
    58 	create_smrimage
    59 	getWorkdir
    59 	getWorkdir
       
    60 	isIgnoreConfig
    60 );
    61 );
    61 
    62 
    62 my $useinterpretsis = 1;
    63 my $useinterpretsis = 1;
    63 if ($^O !~ /^MSWin32$/i){
    64 if ($^O !~ /^MSWin32$/i){
    64 	$useinterpretsis = 0;
    65 	$useinterpretsis = 0;
    65 }
    66 }
    66 my $enforceFeatureManager = 0; # Flag to make Feature Manager mandatory if SYMBIAN_FEATURE_MANAGER macro is defined. 
    67 my $enforceFeatureManager = 0; # Flag to make Feature Manager mandatory if SYMBIAN_FEATURE_MANAGER macro is defined. 
    67 
    68 
    68 my $BuildromMajorVersion = 3 ;
    69 my $BuildromMajorVersion = 3 ;
    69 my $BuildromMinorVersion = 28;
    70 my $BuildromMinorVersion = 30;
    70 my $BuildromPatchVersion = 0;
    71 my $BuildromPatchVersion = 0;
    71 
    72 
    72 
    73 
    73 sub print_usage
    74 sub print_usage
    74 {
    75 {
   157    -workdir=xxx                     -- specify a directory to contain generated files. 
   158    -workdir=xxx                     -- specify a directory to contain generated files. 
   158    -prependepocroot                 -- if there is no EPOCROOT## before /epoc32/, prepend EPOCROOT## to epoc32.
   159    -prependepocroot                 -- if there is no EPOCROOT## before /epoc32/, prepend EPOCROOT## to epoc32.
   159    -stdcpp                          -- ignore symbian customized cpp and try to find another cpp in the PATH.(for Windows only)
   160    -stdcpp                          -- ignore symbian customized cpp and try to find another cpp in the PATH.(for Windows only)
   160    -cpp=xxx                         -- specify a CPP preprocessor used by Buildrom.
   161    -cpp=xxx                         -- specify a CPP preprocessor used by Buildrom.
   161    -xiponly                      -- just create the XIP ROM image without creating the ROFS image.
   162    -xiponly                      -- just create the XIP ROM image without creating the ROFS image.
       
   163    -inputoby=<finalOBYfile>         -- Ignore BUILDROM config phase, invoke Rombuild/Rofsbuild using <finalOBYfile>.
       
   164                                     <finalOBYfile> must contain one and ONLY one of romsize/rofssize/dataimagename/imagename keywords,
       
   165                                     The keywords will be used to identify the OBY type.
   162    
   166    
   163 Popular -D defines to use include
   167 Popular -D defines to use include
   164 
   168 
   165    -D_DEBUG         -- select debug versions of some files
   169    -D_DEBUG         -- select debug versions of some files
   166    -D_FULL_DEBUG    -- select debug versions of all files
   170    -D_FULL_DEBUG    -- select debug versions of all files
   352 my $stdcpp = 0;
   356 my $stdcpp = 0;
   353 my $obycharset;
   357 my $obycharset;
   354 my $cppoption = 0;
   358 my $cppoption = 0;
   355 my $preprocessor = "cpp";
   359 my $preprocessor = "cpp";
   356 my $opt_xiponly = 0;
   360 my $opt_xiponly = 0;
       
   361 my $ignoreconfig = 0;
       
   362 my $romcount = 0;
   357 
   363 
   358 sub match_obyfile
   364 sub match_obyfile
   359 {
   365 {
   360 	my ($obyfile) = @_;
   366 	my ($obyfile) = @_;
   361 	if (-f $obyfile)
   367 	if (-f $obyfile)
   422 				{
   428 				{
   423 					$compress = $opt_compression;
   429 					$compress = $opt_compression;
   424 					$compress =~m/\s-(compression)(method)\s(none|inflate|bytepair)/;
   430 					$compress =~m/\s-(compression)(method)\s(none|inflate|bytepair)/;
   425 					print "* ".$1." ".$2.": ".$3;
   431 					print "* ".$1." ".$2.": ".$3;
   426 				}
   432 				}
   427 				my $command = "rofsbuild -slog".$compress." -datadrive=$obeyfile.oby";
   433 				my $command = "rofsbuild -slog".$compress." -datadrive=$obeyfile.oby -logfile=$thisdir";
       
   434 				$command .= " -k" if($opt_k);      
   428 				print "* Executing $command\n" if ($opt_v);
   435 				print "* Executing $command\n" if ($opt_v);
   429 				system($command);
   436 				system($command);
   430 				if ($? != 0)
   437 				if ($? != 0)
   431 				{
   438 				{
   432 					&datadriveimage::reportError("* ROFSBUILD failed to generate data drive image",$opt_k);
   439 					&datadriveimage::reportError("* ROFSBUILD failed to generate data drive image",$opt_k);
   503 # appropriate data drive image.
   510 # appropriate data drive image.
   504 sub processData		
   511 sub processData		
   505 {
   512 {
   506 	if($dataImageCount)
   513 	if($dataImageCount)
   507 	{
   514 	{
   508 		# set the default path for Z drive and Data drive directory,
   515 		if(!$ignoreconfig)
   509 		# if and only if, path is not specified by the user. 
   516 		{
   510 		$ZDirloc = $thisdir."zdrive" unless ($ZDirloc);
   517 			# set the default path for Z drive and Data drive directory,
   511 		$DataDriveDirloc = $thisdir."datadrive" unless ($DataDriveDirloc);
   518 			# if and only if, path is not specified by the user. 
   512 		#delete any existing Z drive directory.
   519 			$ZDirloc = $thisdir."zdrive" unless ($ZDirloc);
   513 		my $retVal = &datadriveimage::deleteDirectory($ZDirloc,$opt_v)if(!$opt_r);
   520 			$DataDriveDirloc = $thisdir."datadrive" unless ($DataDriveDirloc);
   514 		if($retVal)
   521 			#delete any existing Z drive directory.
   515 		{
   522 			my $retVal = &datadriveimage::deleteDirectory($ZDirloc,$opt_v)if(!$opt_r);
   516 			exit(1) if(!$opt_k);
   523 			if($retVal)
   517 		}
   524 			{
   518 		# delete pre-existence of data drive folder, if and only if -r option is not enabled.
   525 				exit(1) if(!$opt_k);
   519 		$retVal = &datadriveimage::deleteDirectory($DataDriveDirloc,$opt_v) if(!$opt_r);
   526 			}
   520 		if($retVal)
   527 			# delete pre-existence of data drive folder, if and only if -r option is not enabled.
   521 		{
   528 			$retVal = &datadriveimage::deleteDirectory($DataDriveDirloc,$opt_v) if(!$opt_r);
   522 			exit(1) if(!$opt_k);
   529 			if($retVal)
   523 		}
   530 			{
   524 		if($opt_logFile)
   531 				exit(1) if(!$opt_k);
   525 		{
   532 			}
   526 			# clean any pre-existance of log file.
   533 			if($opt_logFile)
   527 			unlink($ZDirloc."\/".$imageEntryLogFile);
   534 			{
   528 		}
   535 				# clean any pre-existance of log file.
   529 		
   536 				unlink($ZDirloc."\/".$imageEntryLogFile);
   530 		for (my $datadriveidx=0; $datadriveidx < $dataImageCount; $datadriveidx++)
   537 			}
   531 		{
   538 			
   532 			my $driveIndex = $dataIndexHash{$datadriveidx};
   539 			for (my $datadriveidx=0; $datadriveidx < $dataImageCount; $datadriveidx++)
   533 			# get the data drive name.
   540 			{
   534 			if( defined( $driveIndex ) )
   541 				my $driveIndex = $dataIndexHash{$datadriveidx};
   535 			{
   542 				# get the data drive name.
   536 				my $datadrivename=$datadriveimage[$driveIndex]{obeyfile};
   543 				if( defined( $driveIndex ) )
   537 				# get the size of the data drive.
   544 				{
   538 				my $size = $datadriveimage[$driveIndex]{size};
   545 					my $datadrivename=$datadriveimage[$driveIndex]{obeyfile};
   539 				if( $datadrivename )
   546 					# get the size of the data drive.
   540 				{
   547 					my $size = $datadriveimage[$driveIndex]{size};
   541 					# set data drive oby file.
   548 					if( $datadrivename )
   542 					my $datadriveobyfile = $datadrivename.".oby";
       
   543 					# final location of prototype data drive.
       
   544 					my $proDataDriveDirloc;
       
   545 					# Location of stub-sis file(s) inside Z Drive folder.
       
   546 					my $zDriveSisFileLoc;
       
   547 					# check if more than one data drive image needs to be generated. 
       
   548 					if ($datadrivename =~ /.*[\\\/]([^\\\/]+)$/)
       
   549 					{
   549 					{
   550 						$datadrivename = $1;
   550 						# set data drive oby file.
   551 					}
   551 						my $datadriveobyfile = $datadrivename.".oby";
   552 					if( $dataImageCount > 1 )
   552 						# final location of prototype data drive.
   553 					{
   553 						my $proDataDriveDirloc;
   554 						# if yes, then set the location of prototype data drive folder as 
   554 						# Location of stub-sis file(s) inside Z Drive folder.
   555 						# DataDriveDirloc + datadrivename
   555 						my $zDriveSisFileLoc;
   556 						$proDataDriveDirloc = $DataDriveDirloc."\/".$datadrivename;
   556 						# check if more than one data drive image needs to be generated. 
   557 					}
   557 						if ($datadrivename =~ /.*[\\\/]([^\\\/]+)$/)
   558 					else
       
   559 					{
       
   560 						# else, then set the location of prototype data drive folder as DataDriveDirloc 
       
   561 						$proDataDriveDirloc = $DataDriveDirloc;
       
   562 					}
       
   563 
       
   564 					# create prototype data drive folder.
       
   565 					print "creating data drive folder\n" if ($opt_v);
       
   566 					&datadriveimage::createDirectory($proDataDriveDirloc);
       
   567 
       
   568 					# check for sis file keyword in ROM description file.
       
   569 					# if found,then locate for stub-sisfile.
       
   570 					# create Z drive( if and only if stub-sis files are present in ROM description file )
       
   571 					# and dump all the non-sis files on to the Z drive folder. 
       
   572 					if(&datadriveimage::checkForSisFile($datadriveobyfile,\@sisfilelist,\$sisfilepresent))
       
   573 					{
       
   574 						my $zDriveImagePresent = 0; # flag to check whether z drive image is Present;
       
   575 						if(&datadriveimage::checkForZDriveImageKeyword($datadriveobyfile,\@zDriveImageList,\$zDriveImagePresent) )
       
   576 						{
   558 						{
   577 							# find out size of the array
   559 							$datadrivename = $1;
   578 							my $arraysize = scalar(@zDriveImageList);
   560 						}
   579 							for( my $i=0; $i < $arraysize; $i++ )
   561 						if( $dataImageCount > 1 )
   580 							{
   562 						{
   581 								$zDriveSisFileLoc =  $ZDirloc."\/".$datadrivename;
   563 							# if yes, then set the location of prototype data drive folder as 
   582 								&datadriveimage::invokeReadImage(pop(@zDriveImageList),$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k);
   564 							# DataDriveDirloc + datadrivename
   583 							}
   565 							$proDataDriveDirloc = $DataDriveDirloc."\/".$datadrivename;
   584 						}
   566 						}
   585 						else
   567 						else
   586 						{
   568 						{
   587 							$zDriveSisFileLoc = $ZDirloc;
   569 							# else, then set the location of prototype data drive folder as DataDriveDirloc 
   588 							# locate and copy stub-sis file(s),for the first time.
   570 							$proDataDriveDirloc = $DataDriveDirloc;
   589 							if( !$zDrivePresent )
   571 						}
       
   572 	
       
   573 						# create prototype data drive folder.
       
   574 						print "creating data drive folder\n" if ($opt_v);
       
   575 						&datadriveimage::createDirectory($proDataDriveDirloc);
       
   576 	
       
   577 						# check for sis file keyword in ROM description file.
       
   578 						# if found,then locate for stub-sisfile.
       
   579 						# create Z drive( if and only if stub-sis files are present in ROM description file )
       
   580 						# and dump all the non-sis files on to the Z drive folder. 
       
   581 						if(&datadriveimage::checkForSisFile($datadriveobyfile,\@sisfilelist,\$sisfilepresent))
       
   582 						{
       
   583 							my $zDriveImagePresent = 0; # flag to check whether z drive image is Present;
       
   584 							if(&datadriveimage::checkForZDriveImageKeyword($datadriveobyfile,\@zDriveImageList,\$zDriveImagePresent) )
   590 							{
   585 							{
   591 								# check for image file.
   586 								# find out size of the array
   592 								if( $opt_zimage )
   587 								my $arraysize = scalar(@zDriveImageList);
       
   588 								for( my $i=0; $i < $arraysize; $i++ )
   593 								{
   589 								{
   594 									# image(s)supplied to BUILDROM(like rom,rofs,extrofs or core) using "-zdriveimage" option, 
   590 									$zDriveSisFileLoc =  $ZDirloc."\/".$datadrivename;
   595 									# are maintained in a seperate array and the element from the array is fetched one by one and is 
   591 									&datadriveimage::invokeReadImage(pop(@zDriveImageList),$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k);
   596 									# fed to READIMAGE as an input.
   592 								}
   597 									foreach my $element (@zdriveImageName)
   593 							}
       
   594 							else
       
   595 							{
       
   596 								$zDriveSisFileLoc = $ZDirloc;
       
   597 								# locate and copy stub-sis file(s),for the first time.
       
   598 								if( !$zDrivePresent )
       
   599 								{
       
   600 									# check for image file.
       
   601 									if( $opt_zimage )
   598 									{
   602 									{
   599 										# invoke READIMAGE to extract all /swi stub sis file(s) from the given image.
   603 										# image(s)supplied to BUILDROM(like rom,rofs,extrofs or core) using "-zdriveimage" option, 
   600 										$zDrivePresent = &datadriveimage::invokeReadImage($element,$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k);
   604 										# are maintained in a seperate array and the element from the array is fetched one by one and is 
       
   605 										# fed to READIMAGE as an input.
       
   606 										foreach my $element (@zdriveImageName)
       
   607 										{
       
   608 											# invoke READIMAGE to extract all /swi stub sis file(s) from the given image.
       
   609 											$zDrivePresent = &datadriveimage::invokeReadImage($element,$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k);
       
   610 										}
   601 									}
   611 									}
   602 								}
   612 									else
   603 								else
       
   604 								{
       
   605 									# if zdrive image(s) such as (rom,core,rofs or extrofs) are generated ealier to the data drive image processing
       
   606 									# then these images are maintained in an array and the element from the array is fetched one by one and is 
       
   607 									# fed to READIMAGE as an input.
       
   608 									foreach my $element (@romImages)
       
   609 									{
   613 									{
   610 										# invoke READIMAGE to extract all /swi stub sis file(s) from the given image.
   614 										# if zdrive image(s) such as (rom,core,rofs or extrofs) are generated ealier to the data drive image processing
   611 										$zDrivePresent = &datadriveimage::invokeReadImage($element,$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k);
   615 										# then these images are maintained in an array and the element from the array is fetched one by one and is 
       
   616 										# fed to READIMAGE as an input.
       
   617 										foreach my $element (@romImages)
       
   618 										{
       
   619 											# invoke READIMAGE to extract all /swi stub sis file(s) from the given image.
       
   620 											$zDrivePresent = &datadriveimage::invokeReadImage($element,$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k);
       
   621 										}
   612 									}
   622 									}
   613 								}
   623 								}
   614 							}
   624 							}
       
   625 							# invoke INTERPRETSIS tool with z drive folder location.
       
   626 							if ($useinterpretsis)
       
   627 							{
       
   628 								&datadriveimage::invokeInterpretsis( \@sisfilelist,$proDataDriveDirloc,$opt_v,$zDriveSisFileLoc,$paraFile,$opt_k,\@interpretsisOptList,$thisdir)if($sisfilepresent);
       
   629 							}else
       
   630 							{
       
   631 								print "Warning: interpretsis is not ready on linux.\n";
       
   632 							}	
   615 						}
   633 						}
   616 						# invoke INTERPRETSIS tool with z drive folder location.
   634 	
   617 						if ($useinterpretsis)
   635 						# create an oby file by traversing through upated prototype data drive directory.
   618 						{
   636 						&datadriveimage::dumpDatadriveObydata( $proDataDriveDirloc,$datadriveobyfile,$size,\@nonsisFilelist,
   619 							&datadriveimage::invokeInterpretsis( \@sisfilelist,$proDataDriveDirloc,$opt_v,$zDriveSisFileLoc,$paraFile,$opt_k,\@interpretsisOptList,$thisdir)if($sisfilepresent);
   637 											\@renameList,\@aliaslist,\@hideList,\@sisobydata,\@datadrivedata,$opt_k,$opt_v );
   620 						}else
   638 						#reset sisfilepresent flag to zero;
   621 						{
   639 						$sisfilepresent =0;
   622 							print "Warning: interpretsis is not ready on linux.\n";
       
   623 						}	
       
   624 					}
   640 					}
   625 
       
   626 					# create an oby file by traversing through upated prototype data drive directory.
       
   627 					&datadriveimage::dumpDatadriveObydata( $proDataDriveDirloc,$datadriveobyfile,$size,\@nonsisFilelist,
       
   628 										\@renameList,\@aliaslist,\@hideList,\@sisobydata,\@datadrivedata,$opt_k,$opt_v );
       
   629 					#reset sisfilepresent flag to zero;
       
   630 					$sisfilepresent =0;
       
   631 				}
   641 				}
   632 			}
   642 			}
   633 		}
   643 		}
   634 		create_datadriveImage();
   644 		create_datadriveImage();
   635 	}
   645 	}
   900 	    {
   910 	    {
   901 		&externaltools::loadTools($1);
   911 		&externaltools::loadTools($1);
   902 		next;
   912 		next;
   903 	    }
   913 	    }
   904    		#Process imagecontent file 
   914    		#Process imagecontent file 
   905 	    if( $arg =~ /^-i(.*)/)
   915 	    if( $arg =~ /^-i(.*)/ && $arg !~ /^-input(.*)/)
   906 	    {
   916 	    {
   907 # Disabling -i option
   917 # Disabling -i option
   908 		print "Warning: Ignoring invalid Option $arg \n";
   918 		print "Warning: Ignoring invalid Option $arg \n";
   909 		next;
   919 		next;
   910 	    }
   920 	    }
  1104               print "Unknown compression method: $1\n";
  1114               print "Unknown compression method: $1\n";
  1105               $errors++;
  1115               $errors++;
  1106           }
  1116           }
  1107           next;
  1117           next;
  1108         }
  1118         }
       
  1119 		if ($arg =~ /^-inputoby=(.*)/)
       
  1120 		{
       
  1121 			$ignoreconfig =1;
       
  1122 			my $ignoreoby = $1;
       
  1123 			$ignoreoby .= ".oby" unless $ignoreoby =~ /\.oby$/i;
       
  1124 			die "$ignoreoby file does not exist!!\n" if (!-e $ignoreoby);
       
  1125 			open IGNORE, "$ignoreoby" or die("* Can't open $ignoreoby\n");
       
  1126 			my @lines = <IGNORE>;
       
  1127 			close IGNORE;
       
  1128 			my $keywordcount = 0;
       
  1129 			my $romimgcount = 0;
       
  1130 			my $rofsimgcount = 0;
       
  1131 			my $fatcount = 0;
       
  1132 			my $smrcount = 0;
       
  1133 			foreach my $line (@lines)
       
  1134 			{
       
  1135 				if ($line =~ /^\s*romsize\s*=/)
       
  1136 				{
       
  1137 					next if ($romimgcount);
       
  1138 					$romimgcount = 1;
       
  1139 					$keywordcount ++;
       
  1140 					$ignoreoby =~ s/\.oby$//i;
       
  1141 					$romimage[$romcount] = {xip=>1, obeyfile=>$ignoreoby, compress=>0, extension=>0, composite=>"none",uncompress=>0 };
       
  1142 					$romcount ++;
       
  1143 				}elsif ($line =~ /^\s*rofssize\s*=/)
       
  1144 				{
       
  1145 					next if ($rofsimgcount);
       
  1146 					$rofsimgcount = 1;
       
  1147 					$keywordcount ++;
       
  1148 					$ignoreoby =~ s/\.oby$//i;
       
  1149 					$romimage[$romcount] = {xip=>0, obeyfile=>$ignoreoby, compress=>0, extension=>0, composite=>"none",uncompress=>0 };
       
  1150 					$romcount ++;
       
  1151 				}elsif ($line =~ /^\s*dataimagename\s*=/)
       
  1152 				{
       
  1153 					next if ($fatcount);
       
  1154 					$fatcount = 1;
       
  1155 					$keywordcount ++;
       
  1156 					$ignoreoby =~ s/\.oby$//i;
       
  1157 					$datadriveimage[$dataImageCount] = {obeyfile=>$ignoreoby, compress=>0, uncompress=>0};
       
  1158 					$dataImageCount ++;
       
  1159 					$dataIndexHash{0} = 0;
       
  1160 				}elsif ($line =~ /^\s*imagename\s*=/)
       
  1161 				{
       
  1162 					next if ($smrcount);
       
  1163 					$smrcount = 1;
       
  1164 					$keywordcount ++;
       
  1165 					$ignoreoby =~ s/\.oby$//i;
       
  1166 					$needSmrImage = 1;
       
  1167 					push @obeyFileList, $ignoreoby;
       
  1168 				}
       
  1169 			}
       
  1170 			die "$ignoreoby file does not contain keywords romsize/rofssize/dataimagename/imagename, cannot identify the oby type!\n" if ($keywordcount == 0);
       
  1171 			die "$ignoreoby file contains $keywordcount keywords of romsize/rofssize/dataimagename/imagename, cannot identify the oby type! Maybe $ignoreoby is not a final oby file.\n" if ($keywordcount > 1);
       
  1172 			next;
       
  1173 		}
  1109 		if( $arg =~ /^-loglevel\d+$/)
  1174 		if( $arg =~ /^-loglevel\d+$/)
  1110 		{
  1175 		{
  1111 			$logLevel= $arg;
  1176 			$logLevel= $arg;
  1112 			next;
  1177 			next;
  1113 		}
  1178 		}
  1256 	if (defined $paramFileFlag) 
  1321 	if (defined $paramFileFlag) 
  1257 	{
  1322 	{
  1258 		return;
  1323 		return;
  1259 	}
  1324 	}
  1260 	
  1325 	
  1261 	if (@obyfiles<1)
  1326 	$preserve = 1 if ($ignoreconfig);
       
  1327 	if (@obyfiles<1 && !$ignoreconfig)
  1262 	{
  1328 	{
  1263 	    print "Missing obyfile argument\n";
  1329 	    print "Missing obyfile argument\n";
  1264 	    $errors++ if(!$opt_k);
  1330 	    $errors++ if(!$opt_k);
  1265 	}
  1331 	}
  1266 	if(defined($obycharset))
  1332 	if(defined($obycharset))
  3248 			{
  3314 			{
  3249 				my $from = $filename;
  3315 				my $from = $filename;
  3250 				$from =~ s/\\/\\\\/g;	
  3316 				$from =~ s/\\/\\\\/g;	
  3251 				$from =~ s/\//\\\//g;		# need to escape backslashes
  3317 				$from =~ s/\//\\\//g;		# need to escape backslashes
  3252 				$from =~ s/(\[|\])/\\$1/g;	# need to escape square brackets for file names like "featreg.cfg[x-y]",etc.
  3318 				$from =~ s/(\[|\])/\\$1/g;	# need to escape square brackets for file names like "featreg.cfg[x-y]",etc.
       
  3319 				$from =~ s/(\{|\})/\\$1/g;	# need to escape brace for file names like "mydll{00010001}.dll",etc.
  3253 				my $into = $fileExists;
  3320 				my $into = $fileExists;
  3254 
  3321 
  3255  				$line =~ s/$from/$into/i;
  3322  				$line =~ s/$from/$into/i;
  3256 
  3323 
  3257  				if ($warnSelection && ($fileExists ne $normedFilename))
  3324  				if ($warnSelection && ($fileExists ne $normedFilename))
  3605   	}
  3672   	}
  3606 	elsif($line =~ /^\s*kerneltrace\s*=.*/i)
  3673 	elsif($line =~ /^\s*kerneltrace\s*=.*/i)
  3607 	{
  3674 	{
  3608 		return $line;
  3675 		return $line;
  3609 	}
  3676 	}
  3610 	elsif($line =~ /^\s*dir\s*=.*/i)
  3677 	elsif($line =~ /^\s*(dir|dircopy)\s*=.*/i)
  3611 	{
  3678 	{
  3612 		return $line;
  3679 		return $line;
  3613 	}
  3680 	}
  3614 	elsif($line =~ /^\s*bootbinary\s*=(.*)/i)
  3681 	elsif($line =~ /^\s*bootbinary\s*=(.*)/i)
  3615 	{
  3682 	{
  4866 	if($needSmrImage)
  4933 	if($needSmrImage)
  4867 	{
  4934 	{
  4868 		foreach my $oby (@obeyFileList)
  4935 		foreach my $oby (@obeyFileList)
  4869 		{
  4936 		{
  4870 			is_existinpath("rofsbuild", romutl::ERROR_NOT_FOUND);
  4937 			is_existinpath("rofsbuild", romutl::ERROR_NOT_FOUND);
  4871 			my $command = "rofsbuild -slog -smr=$oby.oby";
  4938 			my $command = "rofsbuild -slog -smr=$oby.oby -logfile=$thisdir";
       
  4939 			$command .= " -k" if($opt_k);      
  4872 			print "* Executing $command\n" if($opt_v);
  4940 			print "* Executing $command\n" if($opt_v);
  4873 			system($command);
  4941 			system($command);
  4874 			if($? != 0)
  4942 			if($? != 0)
  4875 			{
  4943 			{
  4876 				print("* ROFSBUILD failed to generate SMR IMAGE\n") if($opt_v);
  4944 				print("* ROFSBUILD failed to generate SMR IMAGE\n") if($opt_v);
  4909 }
  4977 }
  4910 
  4978 
  4911 sub getWorkdir
  4979 sub getWorkdir
  4912 {
  4980 {
  4913 	return $thisdir;
  4981 	return $thisdir;
       
  4982 }
       
  4983 
       
  4984 sub isIgnoreConfig
       
  4985 {
       
  4986 	return $ignoreconfig;
  4914 }
  4987 }
  4915 
  4988 
  4916 sub find_stdcpp
  4989 sub find_stdcpp
  4917 {
  4990 {
  4918     return "cpp" if (!$stdcpp);
  4991     return "cpp" if (!$stdcpp);