From 0641c5405cf66979307fb20d19f94bbd8424d341 Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Thu, 22 Sep 2011 23:25:39 +0000 Subject: BeagleBoardPkg: The FDF file does not reserve any more the area for the OMAP35xxx header It is the tool BeagleBoardPkg/Tools/generate_image which will add a CH header to a the BeagleBoard FD file. The build macro EDK2_SECOND_STAGE_BOOTOLADER is not required any more. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12433 6f19259b-4bc3-4df7-8a09-765794883524 --- BeagleBoardPkg/Tools/generate_image.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'BeagleBoardPkg/Tools') diff --git a/BeagleBoardPkg/Tools/generate_image.c b/BeagleBoardPkg/Tools/generate_image.c index 6ac92680a0..fa4cdcc497 100644 --- a/BeagleBoardPkg/Tools/generate_image.c +++ b/BeagleBoardPkg/Tools/generate_image.c @@ -316,7 +316,6 @@ ConstructImage ( FILE *InputFile; FILE *OutputFile; unsigned int InputImageFileSize; - unsigned int NewImageFileSize; struct stat FileStat; char Ch; unsigned int i; @@ -327,31 +326,25 @@ ConstructImage ( exit(0); } - //Get the size of the input image. + // Get the size of the input image. fstat(fileno(InputFile), &FileStat); InputImageFileSize = FileStat.st_size; - //Calculate new file size - NewImageFileSize = InputImageFileSize - 520; - OutputFile = fopen(gOutputImageFile, "wb"); if (OutputFile == NULL) { fprintf(stderr, "Can't open output file %s.\n", gOutputImageFile); exit(0); } - //Write Configuration header + // Write Configuration header fwrite(gConfigurationHeader, 1, sizeof(gConfigurationHeader), OutputFile); - //Write image header (Input image size, execution address) - fwrite(&NewImageFileSize, 1, 4, OutputFile); + // Write image header (Input image size, execution address) + fwrite(&InputImageFileSize, 1, 4, OutputFile); fwrite(&gImageExecutionAddress, 1, 4, OutputFile); - //Skip first 0x207 bytes - fseek(InputFile, 520, SEEK_SET); - - //Copy input image to the output file. - for (i = 0; i < NewImageFileSize; i++) { + // Copy input image to the output file. + for (i = 0; i < InputImageFileSize; i++) { fread(&Ch, 1, 1, InputFile); fwrite(&Ch, 1, 1, OutputFile); } -- cgit v1.2.3