tools: rockchip: boot/trust_merger: add "--prepath" support
Add prefix path of binary path. Change-Id: I576b9fa40f88a1ee0701f1ff776d25d4e3ed747b Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
parent
ab64d6564f
commit
e311da2458
|
|
@ -21,6 +21,7 @@ bool gDebug =
|
|||
options gOpts;
|
||||
char gLegacyPath[MAX_LINE_LEN] = { 0 };
|
||||
char gNewPath[MAX_LINE_LEN] = { 0 };
|
||||
static char *gPrePath;
|
||||
char gSubfix[MAX_LINE_LEN] = OUT_SUBFIX;
|
||||
char gEat[MAX_LINE_LEN];
|
||||
char *gConfigPath;
|
||||
|
|
@ -148,6 +149,10 @@ static inline void fixPath(char *path)
|
|||
strcpy(path, gNewPath);
|
||||
strcat(path, tmp);
|
||||
}
|
||||
} else if (gPrePath) {
|
||||
strcpy(tmp, path);
|
||||
strcpy(path, gPrePath);
|
||||
strcat(path, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -976,6 +981,7 @@ static void printHelp(void)
|
|||
printf("\t" OPT_VERSION "\t\tDisplay version information.\n");
|
||||
printf("\t" OPT_SUBFIX "\t\tSpec subfix.\n");
|
||||
printf("\t" OPT_REPLACE "\t\tReplace some part of binary path.\n");
|
||||
printf("\t" OPT_PREPATH "\t\tAdd prefix path of binary path.\n");
|
||||
printf("\t" OPT_SIZE
|
||||
"\t\tImage size.\"--size [image KB size]\", must be 512KB aligned\n");
|
||||
printf("Usage2: boot_merger [options] [parameter]\n");
|
||||
|
|
@ -1021,6 +1027,9 @@ int main(int argc, char **argv)
|
|||
snprintf(gLegacyPath, sizeof(gLegacyPath), "%s", argv[i]);
|
||||
i++;
|
||||
snprintf(gNewPath, sizeof(gNewPath), "%s", argv[i]);
|
||||
} else if (!strcmp(OPT_PREPATH, argv[i])) {
|
||||
i++;
|
||||
gPrePath = argv[i];
|
||||
} else if (!strcmp(OPT_SIZE, argv[i])) {
|
||||
g_merge_max_size = strtoul(argv[++i], NULL, 10);
|
||||
if (g_merge_max_size % 512) {
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@ typedef struct {
|
|||
#define OPT_UNPACK "--unpack"
|
||||
#define OPT_SUBFIX "--subfix"
|
||||
#define OPT_REPLACE "--replace"
|
||||
#define OPT_PREPATH "--prepath"
|
||||
#define OPT_SIZE "--size"
|
||||
|
||||
#define OPT_CHIP "-c"
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ static uint8_t gBuf[BL3X_FILESIZE_MAX];
|
|||
static bool gSubfix;
|
||||
static char *gLegacyPath;
|
||||
static char *gNewPath;
|
||||
static char *gPrePath;
|
||||
static uint8_t gRSAmode = RSA_SEL_2048;
|
||||
static uint8_t gSHAmode = SHA_SEL_256;
|
||||
static bool gIgnoreBL32;
|
||||
|
|
@ -109,6 +110,10 @@ static inline void fixPath(char *path)
|
|||
strcpy(path, gNewPath);
|
||||
strcat(path, tmp);
|
||||
}
|
||||
} else if (gPrePath) {
|
||||
strcpy(tmp, path);
|
||||
strcpy(path, gPrePath);
|
||||
strcat(path, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -833,6 +838,7 @@ static void printHelp(void)
|
|||
printf("\t" OPT_VERSION "\t\tDisplay version information.\n");
|
||||
printf("\t" OPT_SUBFIX "\t\tSpec subfix.\n");
|
||||
printf("\t" OPT_REPLACE "\t\tReplace some part of binary path.\n");
|
||||
printf("\t" OPT_PREPATH "\t\tAdd prefix path of binary path.\n");
|
||||
printf("\t" OPT_RSA "\t\t\tRSA mode.\"--rsa [mode]\", [mode] can be: "
|
||||
"0(none), 1(1024), 2(2048), 3(2048 pss).\n");
|
||||
printf("\t" OPT_SHA
|
||||
|
|
@ -870,6 +876,9 @@ int main(int argc, char **argv)
|
|||
gLegacyPath = argv[i];
|
||||
i++;
|
||||
gNewPath = argv[i];
|
||||
} else if (!strcmp(OPT_PREPATH, argv[i])) {
|
||||
i++;
|
||||
gPrePath = argv[i];
|
||||
} else if (!strcmp(OPT_RSA, argv[i])) {
|
||||
i++;
|
||||
if (!is_digit(*(argv[i]))) {
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
#define OPT_UNPACK "--unpack"
|
||||
#define OPT_SUBFIX "--subfix"
|
||||
#define OPT_REPLACE "--replace"
|
||||
#define OPT_PREPATH "--prepath"
|
||||
#define OPT_RSA "--rsa"
|
||||
#define OPT_SHA "--sha"
|
||||
#define OPT_SIZE "--size"
|
||||
|
|
|
|||
Loading…
Reference in New Issue