kernel/eka/rombuild/rom.pl
changeset 4 56f325a607ea
parent 0 a41df078684a
equal deleted inserted replaced
2:4122176ea935 4:56f325a607ea
   324 		genfile("nonpaged");	}
   324 		genfile("nonpaged");	}
   325 	}
   325 	}
   326 
   326 
   327 parsePatchData("rom3.tmp", "rom4.tmp");
   327 parsePatchData("rom3.tmp", "rom4.tmp");
   328 
   328 
   329 # break down the oby file into rom, rofs and extensions oby files
   329 # break down the oby file into rom, rofs, extensions and smr oby files
   330 
   330 
   331 my $oby_index =0;
   331 my $oby_index =0;
   332 my $dumpfile="rom.oby";
   332 my $dumpfile="rom.oby";
   333 my $rofs=0;
   333 my $rofs=0;
       
   334 my $smr=0;
   334 my $extension=0;
   335 my $extension=0;
   335 my $corerofsname="";
   336 my $corerofsname="";
       
   337 my $smrname="";
   336 open DUMPFILE, ">$dumpfile" or die("Can't create $dumpfile\n");
   338 open DUMPFILE, ">$dumpfile" or die("Can't create $dumpfile\n");
   337 my $line;
   339 my $line;
   338 open TMP, "rom4.tmp" or die("Can't open rom4.tmp\n");
   340 open TMP, "rom4.tmp" or die("Can't open rom4.tmp\n");
   339 while ($line=<TMP>)
   341 while ($line=<TMP>)
   340 	{
   342 	{
   349 		my $dumpfile="rofs".$rofs.".oby";
   351 		my $dumpfile="rofs".$rofs.".oby";
   350 		$rofs++;
   352 		$rofs++;
   351 		open DUMPFILE, ">$dumpfile" or (close TMP and die("Can't create $dumpfile\n"));
   353 		open DUMPFILE, ">$dumpfile" or (close TMP and die("Can't create $dumpfile\n"));
   352 		}
   354 		}
   353 
   355 
       
   356 	if ($line=~/^\s*imagename/i)
       
   357 		{
       
   358 		close DUMPFILE;							# close rom.oby or previous rofs#/extension#.oby
       
   359 		$smrname=$line;
       
   360 		$smrname =~ s/imagename\s*=\s*//i;		# save smr name
       
   361 		$smrname =~ s/\s*$//g; 			# remove trailing \n
       
   362 		unlink $smrname || print "unable to delete $smrname";
       
   363 		my $dumpfile="smr".$smr.".oby";
       
   364 		$smr++;
       
   365 		open DUMPFILE, ">$dumpfile" or (close TMP and die("Can't create $dumpfile\n"));
       
   366 		}
       
   367 
   354 	if ($line=~/^\s*coreimage/i)
   368 	if ($line=~/^\s*coreimage/i)
   355 		{
   369 		{
   356 		close DUMPFILE;							# close rofs.oby
   370 		close DUMPFILE;							# close rofs.oby
   357 		if ($oby_index ne 1) {
   371 		if ($oby_index ne 1) {
   358 			close TMP;
   372 			close TMP;
   481 			{
   495 			{
   482 			print "$rofsbuilder $image returned $?\n";
   496 			print "$rofsbuilder $image returned $?\n";
   483 			$rerrors++;
   497 			$rerrors++;
   484 			}
   498 			}
   485 		rename "rofsbuild.log", "extension$i.log"
   499 		rename "rofsbuild.log", "extension$i.log"
       
   500 		}
       
   501 }
       
   502 
       
   503 if ($smr) {
       
   504 	$rofsbuilder = $opts{'rofsbuilder'};
       
   505 	$rofsbuilder = "rofsbuild" unless ($rofsbuilder);
       
   506 	for(my $i=0;$i<$smr;++$i) {
       
   507 		print "Executing $rofsbuilder on smr partition\n" if !$quiet;
       
   508 		my $image="smr".$i.".oby";
       
   509 		system("$rofsbuilder -smr=$image");
       
   510 		if ($? != 0)
       
   511 			{
       
   512 			print "$rofsbuilder -smr=$image returned $?\n";
       
   513 			$rerrors++;
       
   514 			}
       
   515 		rename "rofsbuild.log", "smr$i.log"
   486 		}
   516 		}
   487 }
   517 }
   488 
   518 
   489 if ($nerrors) {
   519 if ($nerrors) {
   490 	print "\n\n Errors found during $builder!!\n\nLeaving tmp files\n";
   520 	print "\n\n Errors found during $builder!!\n\nLeaving tmp files\n";