Header v3 does not have name entry
This commit is contained in:
parent
1385d2a4f4
commit
552ec1eb35
@ -104,6 +104,7 @@ void dyn_img_hdr::print() {
|
||||
void dyn_img_hdr::dump_hdr_file() {
|
||||
FILE *fp = xfopen(HEADER_FILE, "w");
|
||||
fprintf(fp, "pagesize=%u\n", page_size());
|
||||
if (name())
|
||||
fprintf(fp, "name=%s\n", name());
|
||||
fprintf(fp, "cmdline=%.*s%.*s\n", BOOT_ARGS_SIZE, cmdline(), BOOT_EXTRA_ARGS_SIZE, extra_cmdline());
|
||||
uint32_t ver = os_version();
|
||||
@ -129,7 +130,7 @@ void dyn_img_hdr::load_hdr_file() {
|
||||
parse_prop_file(HEADER_FILE, [=](string_view key, string_view value) -> bool {
|
||||
if (key == "page_size") {
|
||||
page_size() = parse_int(value);
|
||||
} else if (key == "name") {
|
||||
} else if (key == "name" && name()) {
|
||||
memset(name(), 0, 16);
|
||||
memcpy(name(), value.data(), value.length() > 15 ? 15 : value.length());
|
||||
} else if (key == "cmdline") {
|
||||
|
Loading…
Reference in New Issue
Block a user