Skip to content

Commit 73cd336

Browse files
2023.2 Updates
1. Support for replace/append use cases based of include bif 2. Fix build on machines with modern flex Signed-off-by: radarapu <[email protected]>
1 parent fa83747 commit 73cd336

File tree

8 files changed

+64
-7
lines changed

8 files changed

+64
-7
lines changed

bif.yy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ typedef unsigned char YY_CHAR;
379379

380380
#define yytext_ptr yytext
381381

382-
#include <FlexLexer.h>
382+
#include "FlexLexer.h"
383383

384384
int yyFlexLexer::yywrap() { return 1; }
385385
int yyFlexLexer::yylex()

bifoptions.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ PartitionBifOptions::PartitionBifOptions()
180180
, bifSection("")
181181
, delayAuth(false)
182182
, imageStoreId(0xFF)
183+
, erasePartition(false)
183184
, tcmBoot(false)
184185
, tcmARegionAddr(0)
185186
, tcmBRegionAddr(0)

bifoptions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ class PartitionBifOptions
213213
bool updateReserveInPh;
214214
Arch::Type arch;
215215
bool delayAuth;
216+
bool erasePartition;
216217

217218
private:
218219
bool versalNetSeries;

bootimage.cpp

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void BIF_File::Process(Options& options)
8888
}
8989
}
9090

91-
ReplaceFiles();
91+
AppendAndReplaceFilesinBIF();
9292
options.bifOptionsList = bifOptionList = includeBifOptionList;
9393
}
9494

@@ -779,7 +779,7 @@ void BIF_File::ParseBifFile(Options& options)
779779
}
780780

781781
/******************************************************************************/
782-
void BIF_File::ReplaceFiles()
782+
void BIF_File::AppendAndReplaceFilesinBIF()
783783
{
784784
/* If slr number matches between partitions - replace the files */
785785
for (size_t i = 0; i < includeBifOptionList.size(); i++)
@@ -803,6 +803,7 @@ void BIF_File::ReplaceFiles()
803803

804804
(*itr2)->filename = (*itr1)->filename;
805805
(*itr2)->filelist = (*itr1)->filelist;
806+
(*itr1)->erasePartition = true;
806807
break;
807808
}
808809
}
@@ -826,6 +827,7 @@ void BIF_File::ReplaceFiles()
826827
includeBifOptionList[i]->ClearPmcCdoFileList();
827828
for (size_t listSize = 0; listSize < (*itr1)->filelist.size(); listSize++)
828829
includeBifOptionList[i]->SetPmcCdoFileList((*itr1)->filelist[listSize]);
830+
(*itr1)->erasePartition = true;
829831
break;
830832
}
831833
}
@@ -844,12 +846,65 @@ void BIF_File::ReplaceFiles()
844846

845847
(*itr2)->filename = (*itr1)->filename;
846848
(*itr2)->filelist = (*itr1)->filelist;
849+
(*itr1)->erasePartition = true;
847850
break;
848851
}
849852
}
850853
}
851854
}
852855
}
856+
for (std::list<ImageBifOptions*>::iterator itr1 = bifOptionList[j]->imageBifOptionList.begin(); itr1 != bifOptionList[j]->imageBifOptionList.end(); )
857+
{
858+
bool incremented = false;
859+
for (std::list<PartitionBifOptions*>::iterator itr2 = (*itr1)->partitionBifOptionsList.begin(); itr2 != (*itr1)->partitionBifOptionsList.end(); )
860+
{
861+
if ((*itr2)->erasePartition)
862+
{
863+
(*itr1)->partitionBifOptionsList.remove(*itr2++);
864+
if ((*itr1)->partitionBifOptionsList.size() == 0)
865+
{
866+
bifOptionList[j]->imageBifOptionList.remove(*itr1++);
867+
incremented = true;
868+
break;
869+
}
870+
//break;
871+
}
872+
else
873+
{
874+
itr2++;
875+
}
876+
}
877+
if(!incremented)
878+
itr1++;
879+
}
880+
}
881+
}
882+
883+
for (size_t i = 0; i < includeBifOptionList.size(); i++)
884+
{
885+
if ((includeBifOptionList[i]->pdiType == PartitionType::SLR_CONFIG) || (includeBifOptionList[i]->slrNum == 0))
886+
{
887+
for (size_t j = 0; j < bifOptionList.size(); j++)
888+
{
889+
for (std::list<ImageBifOptions*>::iterator itr1 = bifOptionList[j]->imageBifOptionList.begin(); itr1 != bifOptionList[j]->imageBifOptionList.end(); itr1++)
890+
{
891+
std::list<PartitionBifOptions*>::iterator itr2 = (*itr1)->partitionBifOptionsList.begin();
892+
{
893+
if (includeBifOptionList[i]->slrNum == (*itr2)->slrNum)
894+
{
895+
includeBifOptionList[i]->imageBifOptionList.push_back((*itr1));
896+
includeBifOptionList[i]->partitionBifOptionList.insert(includeBifOptionList[i]->partitionBifOptionList.end(), (*itr1)->partitionBifOptionsList.begin(), (*itr1)->partitionBifOptionsList.end());
897+
}
898+
}
899+
}
900+
}
901+
}
902+
else if(includeBifOptionList[i]->slrNum == 0xFF)
903+
{
904+
for (size_t j = 0; j < bifOptionList.size(); j++)
905+
{
906+
includeBifOptionList[i]->imageBifOptionList.splice(includeBifOptionList[i]->imageBifOptionList.end(), bifOptionList[j]->imageBifOptionList);
907+
}
853908
}
854909
}
855910
}

bootimage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class BIF_File
7474
BIF_File(std::string& filename0) : biffilename(filename0) {}
7575
void Process(Options& options);
7676
void ParseBifFile(Options& options);
77-
void ReplaceFiles();
77+
void AppendAndReplaceFilesinBIF();
7878
private:
7979
std::string biffilename;
8080
void Output(Options& options, uint8_t index);

cmdoptions.yy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ typedef unsigned char YY_CHAR;
379379

380380
#define yytext_ptr yytext
381381

382-
#include <FlexLexer.h>
382+
#include "FlexLexer.h"
383383

384384
int yyFlexLexer::yywrap() { return 1; }
385385
int yyFlexLexer::yylex()

reginit.yy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ typedef unsigned char YY_CHAR;
379379

380380
#define yytext_ptr yytext
381381

382-
#include <FlexLexer.h>
382+
#include "FlexLexer.h"
383383

384384
int yyFlexLexer::yywrap() { return 1; }
385385
int yyFlexLexer::yylex()

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
******************************************************************************/
1717

1818
#ifndef RDI_VERSION
19-
#define RDI_VERSION "2023.2_ksb"
19+
#define RDI_VERSION "2023.2"
2020
#endif
2121

2222
#define PROGRAMNAME "Bootgen"

0 commit comments

Comments
 (0)