ux: Improve log printouts

QDL uses a few different styles when printing logs for the user,
with some inconsistencies, some errors, and some room for improvement.

Revisit all the ux_xyz() invocations to clean up the output from the
tool.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
This commit is contained in:
Bjorn Andersson
2024-12-17 13:24:30 -06:00
committed by Bjorn Andersson
parent 0e08e852bf
commit a0f977935f
7 changed files with 106 additions and 96 deletions

View File

@@ -77,7 +77,7 @@ static xmlNode *firehose_response_parse(const void *buf, size_t len, int *error)
doc = xmlReadMemory(buf, len, NULL, NULL, 0);
if (!doc) {
ux_err("failed to parse firehose packet\n");
ux_err("failed to parse firehose response\n");
*error = -EINVAL;
return NULL;
}
@@ -91,7 +91,7 @@ static xmlNode *firehose_response_parse(const void *buf, size_t len, int *error)
}
if (!node) {
ux_err("firehose packet without data tag\n");
ux_err("firehose response without data tag\n");
*error = -EINVAL;
xmlFreeDoc(doc);
return NULL;
@@ -100,6 +100,11 @@ static xmlNode *firehose_response_parse(const void *buf, size_t len, int *error)
for (node = node->children; node && node->type != XML_ELEMENT_NODE; node = node->next)
;
if (!node) {
ux_err("empty firehose response\n");
*error = -EINVAL;
}
return node;
}
@@ -157,10 +162,8 @@ static int firehose_read(struct qdl_device *qdl, int timeout_ms,
ux_debug("FIREHOSE READ: %s\n", buf);
node = firehose_response_parse(buf, n, &error);
if (!node) {
ux_err("unable to parse response\n");
if (!node)
return error;
}
ret = response_parser(node, data);
xmlFreeDoc(node->doc);
@@ -285,7 +288,7 @@ static int firehose_configure(struct qdl_device *qdl, bool skip_storage_init, co
ret = firehose_send_configure(qdl, max_payload_size, skip_storage_init, storage, &size);
if (ret < 0) {
ux_err("[CONFIGURE] request failed\n");
ux_err("configure request failed\n");
return -1;
}
@@ -293,14 +296,14 @@ static int firehose_configure(struct qdl_device *qdl, bool skip_storage_init, co
if (size != max_payload_size) {
ret = firehose_send_configure(qdl, size, skip_storage_init, storage, &size);
if (ret != FIREHOSE_ACK) {
ux_err("[CONFIGURE] request failed\n");
ux_err("configure request with updated payload size failed\n");
return -1;
}
max_payload_size = size;
}
ux_debug("[CONFIGURE] max payload size: %zu\n", max_payload_size);
ux_debug("accepted max payload size: %zu\n", max_payload_size);
return 0;
}
@@ -327,14 +330,15 @@ static int firehose_erase(struct qdl_device *qdl, struct program *program)
ret = firehose_write(qdl, doc);
if (ret < 0) {
ux_err("[PROGRAM] failed to write program command\n");
ux_err("failed to send program request\n");
goto out;
}
ret = firehose_read(qdl, 30000, firehose_generic_parser, NULL);
ux_err("[ERASE] erase %s+0x%x %s\n",
program->start_sector, program->num_sectors,
ret ? "failed" : "succeeded");
if (ret)
ux_err("failed to erase %s+0x%x\n", program->start_sector, program->num_sectors);
else
ux_info("successfully erased %s+0x%x\n", program->start_sector, program->num_sectors);
out:
xmlFreeDoc(doc);
@@ -365,7 +369,8 @@ static int firehose_program(struct qdl_device *qdl, struct program *program, int
num_sectors = (sb.st_size + program->sector_size - 1) / program->sector_size;
if (program->num_sectors && num_sectors > program->num_sectors) {
ux_err("[PROGRAM] %s truncated to %d\n",
ux_err("%s to big for %s truncated to %d\n",
program->filename,
program->label,
program->num_sectors * program->sector_size);
num_sectors = program->num_sectors;
@@ -394,13 +399,13 @@ static int firehose_program(struct qdl_device *qdl, struct program *program, int
ret = firehose_write(qdl, doc);
if (ret < 0) {
ux_err("[PROGRAM] failed to write program command\n");
ux_err("failed to send program request\n");
goto out;
}
ret = firehose_read(qdl, 10000, firehose_generic_parser, NULL);
if (ret) {
ux_err("[PROGRAM] failed to setup programming\n");
ux_err("failed to setup programming\n");
goto out;
}
@@ -412,18 +417,25 @@ static int firehose_program(struct qdl_device *qdl, struct program *program, int
chunk_size = MIN(max_payload_size / program->sector_size, left);
n = read(fd, buf, chunk_size * program->sector_size);
if (n < 0)
err(1, "failed to read");
if (n < 0) {
ux_err("failed to read %s\n", program->filename);
goto out;
}
if (n < max_payload_size)
memset(buf + n, 0, max_payload_size - n);
n = qdl_write(qdl, buf, chunk_size * program->sector_size);
if (n < 0)
err(1, "failed to write");
if (n < 0) {
ux_err("USB write failed for data chunk\n");
goto out;
}
if (n != chunk_size * program->sector_size)
err(1, "failed to write full sector");
if (n != chunk_size * program->sector_size) {
ux_err("USB write truncated\n");
ret = -1;
goto out;
}
left -= chunk_size;
}
@@ -432,13 +444,13 @@ static int firehose_program(struct qdl_device *qdl, struct program *program, int
ret = firehose_read(qdl, 30000, firehose_generic_parser, NULL);
if (ret) {
ux_err("[PROGRAM] failed\n");
ux_err("flashing of %s failed\n", program->label);
} else if (t) {
ux_err("[PROGRAM] flashed \"%s\" successfully at %lukB/s\n",
ux_err("flashed \"%s\" successfully at %lukB/s\n",
program->label,
(unsigned long)program->sector_size * num_sectors / t / 1024);
} else {
ux_err("[PROGRAM] flashed \"%s\" successfully\n",
ux_err("flashed \"%s\" successfully\n",
program->label);
}
@@ -481,13 +493,13 @@ static int firehose_read_op(struct qdl_device *qdl, struct read_op *read_op, int
ret = firehose_write(qdl, doc);
if (ret < 0) {
ux_err("[READ] failed to write read command\n");
ux_err("failed to send read command\n");
goto out;
}
ret = firehose_read(qdl, 10000, firehose_generic_parser, NULL);
if (ret) {
ux_err("[READ] failed to setup reading\n");
ux_err("failed to setup reading operation\n");
goto out;
}
@@ -525,18 +537,18 @@ static int firehose_read_op(struct qdl_device *qdl, struct read_op *read_op, int
ret = firehose_read(qdl, 10000, firehose_generic_parser, NULL);
if (ret) {
ux_err("[READ] failed to complete reading\n");
ux_err("read operation failed\n");
goto out;
}
t = time(NULL) - t0;
if (t) {
ux_err("[READ] read \"%s\" successfully at %ldkB/s\n",
ux_err("read \"%s\" successfully at %ldkB/s\n",
read_op->filename,
(unsigned long)read_op->sector_size * read_op->num_sectors / t / 1024);
} else {
ux_err("[READ] read \"%s\" successfully\n",
ux_err("read \"%s\" successfully\n",
read_op->filename);
}
@@ -553,7 +565,7 @@ static int firehose_apply_patch(struct qdl_device *qdl, struct patch *patch)
xmlDoc *doc;
int ret;
ux_info("%s\n", patch->what);
ux_info("applying patch \"%s\"\n", patch->what);
doc = xmlNewDoc((xmlChar*)"1.0");
root = xmlNewNode(NULL, (xmlChar*)"data");
@@ -574,7 +586,7 @@ static int firehose_apply_patch(struct qdl_device *qdl, struct patch *patch)
ret = firehose_read(qdl, 5000, firehose_generic_parser, NULL);
if (ret)
ux_err("[APPLY PATCH] %d\n", ret);
ux_err("patch application failed\n");
out:
xmlFreeDoc(doc);
@@ -597,7 +609,7 @@ static int firehose_send_single_tag(struct qdl_device *qdl, xmlNode *node){
ret = firehose_read(qdl, 5000, firehose_generic_parser, NULL);
if (ret) {
ux_err("[UFS] %s err %d\n", __func__, ret);
ux_err("ufs request failed\n");
ret = -EINVAL;
}
@@ -631,7 +643,7 @@ int firehose_apply_ufs_common(struct qdl_device *qdl, struct ufs_common *ufs)
ret = firehose_send_single_tag(qdl, node_to_send);
if (ret)
ux_err("[APPLY UFS common] %d\n", ret);
ux_err("failed to send ufs common tag\n");
return ret == FIREHOSE_ACK ? 0 : -1;
}
@@ -658,7 +670,7 @@ int firehose_apply_ufs_body(struct qdl_device *qdl, struct ufs_body *ufs)
ret = firehose_send_single_tag(qdl, node_to_send);
if (ret)
ux_err("[APPLY UFS body] %d\n", ret);
ux_err("failed to apply ufs body tag\n");
return ret == FIREHOSE_ACK ? 0 : -1;
}
@@ -676,7 +688,7 @@ int firehose_apply_ufs_epilogue(struct qdl_device *qdl, struct ufs_epilogue *ufs
ret = firehose_send_single_tag(qdl, node_to_send);
if (ret)
ux_err("[APPLY UFS epilogue] %d\n", ret);
ux_err("failed to apply ufs epilogue\n");
return ret == FIREHOSE_ACK ? 0 : -1;
}
@@ -731,7 +743,7 @@ static int firehose_reset(struct qdl_device *qdl)
ret = firehose_read(qdl, 5000, firehose_generic_parser, NULL);
if (ret < 0)
ux_err("[RESET] request failed: %s\n", strerror(ret));
ux_err("failed to request device reset\n");
/* drain any remaining log messages for reset */
else
firehose_read(qdl, 1000, firehose_generic_parser, NULL);
@@ -745,6 +757,8 @@ int firehose_run(struct qdl_device *qdl, const char *incdir, const char *storage
int bootable;
int ret;
ux_info("waiting for programmer...\n");
firehose_read(qdl, 5000, firehose_generic_parser, NULL);
if(ufs_need_provisioning()) {
@@ -785,7 +799,7 @@ int firehose_run(struct qdl_device *qdl, const char *incdir, const char *storage
bootable = program_find_bootable_partition(&multiple);
if (bootable < 0) {
ux_err("no boot partition found\n");
ux_info("no boot partition found\n");
} else {
if (multiple) {
ux_err("WARNING: Multiple candidates for primary bootloader found, using partition %d\n",

View File

@@ -50,7 +50,7 @@ int patch_load(const char *patch_file)
doc = xmlReadFile(patch_file, NULL, 0);
if (!doc) {
ux_err("[PATCH] failed to parse %s\n", patch_file);
ux_err("failed to parse patch-type file \"%s\"\n", patch_file);
return -EINVAL;
}
@@ -60,7 +60,7 @@ int patch_load(const char *patch_file)
continue;
if (xmlStrcmp(node->name, (xmlChar*)"patch")) {
ux_err("[PATCH] unrecognized tag \"%s\", ignoring\n", node->name);
ux_err("unrecognized tag \"%s\" in patch-type file, ignoring\n", node->name);
continue;
}
@@ -78,7 +78,7 @@ int patch_load(const char *patch_file)
patch->what = attr_as_string(node, "what", &errors);
if (errors) {
ux_err("[PATCH] errors while parsing patch\n");
ux_err("errors while parsing patch-type file \"%s\"\n", patch_file);
free(patch);
continue;
}

View File

@@ -48,7 +48,7 @@ static int load_erase_tag(xmlNode *node, bool is_nand)
int errors = 0;
if (!is_nand) {
ux_err("got \"erase\" tag for non-NAND storage\n");
ux_err("found \"erase\" tag for non-NAND storage\n");
return -EINVAL;
}
@@ -64,7 +64,7 @@ static int load_erase_tag(xmlNode *node, bool is_nand)
program->start_sector = attr_as_string(node, "start_sector", &errors);
if (errors) {
ux_err("[PROGRAM] errors while parsing erase tag\n");
ux_err("errors while parsing erase tag\n");
free(program);
return -EINVAL;
}
@@ -106,7 +106,7 @@ static int load_program_tag(xmlNode *node, bool is_nand)
}
if (errors) {
ux_err("[PROGRAM] errors while parsing program\n");
ux_err("errors while parsing program tag\n");
free(program);
return -EINVAL;
}
@@ -131,7 +131,7 @@ int program_load(const char *program_file, bool is_nand)
doc = xmlReadFile(program_file, NULL, 0);
if (!doc) {
ux_err("[PROGRAM] failed to parse %s\n", program_file);
ux_err("failed to parse program-type file \"%s\"\n", program_file);
return -EINVAL;
}
@@ -145,7 +145,7 @@ int program_load(const char *program_file, bool is_nand)
else if (!xmlStrcmp(node->name, (xmlChar *)"program"))
errors = load_program_tag(node, is_nand);
else {
ux_err("[PROGRAM] unrecognized tag \"%s\"\n", node->name);
ux_err("unrecognized tag \"%s\" in program-type file \"%s\"\n", node->name, program_file);
errors = -EINVAL;
}
@@ -182,7 +182,7 @@ int program_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl,
fd = open(filename, O_RDONLY);
if (fd < 0) {
ux_info("Unable to open %s", program->filename);
ux_info("unable to open %s", program->filename);
if (!allow_missing) {
ux_info("...failing\n");
return -1;

2
qdl.c
View File

@@ -66,7 +66,7 @@ static int detect_type(const char *xml_file)
doc = xmlReadFile(xml_file, NULL, 0);
if (!doc) {
ux_err("[PATCH] failed to parse %s\n", xml_file);
ux_err("failed to parse XML file \"%s\"\n", xml_file);
return -EINVAL;
}

9
read.c
View File

@@ -52,7 +52,7 @@ int read_op_load(const char *read_op_file)
doc = xmlReadFile(read_op_file, NULL, 0);
if (!doc) {
ux_err("[READ] failed to parse %s\n", read_op_file);
ux_err("failed to parse read-type file \"%s\"\n", read_op_file);
return -EINVAL;
}
@@ -62,7 +62,8 @@ int read_op_load(const char *read_op_file)
continue;
if (xmlStrcmp(node->name, (xmlChar*)"read")) {
ux_err("[READ] unrecognized tag \"%s\", ignoring\n", node->name);
ux_err("unrecognized tag \"%s\" in read-type file \"%s\", ignoring\n",
node->name, read_op_file);
continue;
}
@@ -77,7 +78,7 @@ int read_op_load(const char *read_op_file)
read_op->start_sector = attr_as_string(node, "start_sector", &errors);
if (errors) {
ux_err("[READ] errors while parsing read\n");
ux_err("errors while parsing read-type file \"%s\"\n", read_op_file);
free(read_op);
continue;
}
@@ -116,7 +117,7 @@ int read_op_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl,
fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644);
if (fd < 0) {
ux_info("Unable to open %s...\n", read_op->filename);
ux_info("unable to open %s...\n", read_op->filename);
return ret;
}

View File

@@ -159,8 +159,8 @@ static void sahara_hello(struct qdl_device *qdl, struct sahara_pkt *pkt)
assert(pkt->length == SAHARA_HELLO_LENGTH);
ux_info("HELLO version: 0x%x compatible: 0x%x max_len: %d mode: %d\n",
pkt->hello_req.version, pkt->hello_req.compatible, pkt->hello_req.max_len, pkt->hello_req.mode);
ux_debug("HELLO version: 0x%x compatible: 0x%x max_len: %d mode: %d\n",
pkt->hello_req.version, pkt->hello_req.compatible, pkt->hello_req.max_len, pkt->hello_req.mode);
resp.cmd = SAHARA_HELLO_RESP_CMD;
resp.length = SAHARA_HELLO_LENGTH;
@@ -207,8 +207,8 @@ static void sahara_read(struct qdl_device *qdl, struct sahara_pkt *pkt, char *im
assert(pkt->length == SAHARA_READ_DATA_LENGTH);
ux_info("READ image: %d offset: 0x%x length: 0x%x\n",
pkt->read_req.image, pkt->read_req.offset, pkt->read_req.length);
ux_debug("READ image: %d offset: 0x%x length: 0x%x\n",
pkt->read_req.image, pkt->read_req.offset, pkt->read_req.length);
if (single_image)
image = 0;
@@ -216,14 +216,14 @@ static void sahara_read(struct qdl_device *qdl, struct sahara_pkt *pkt, char *im
image = pkt->read_req.image;
if (image >= MAPPING_SZ || !img_arr[image]) {
ux_err("Device specified invalid image: %u\n", image);
ux_err("device requested invalid image: %u\n", image);
sahara_send_reset(qdl);
return;
}
fd = open(img_arr[image], O_RDONLY);
if (fd < 0) {
ux_err("Can not open %s: %s\n", img_arr[image], strerror(errno));
ux_err("Can not open \"%s\": %s\n", img_arr[image], strerror(errno));
// Maybe this read was optional. Notify device of error and let
// it decide how to proceed.
sahara_send_reset(qdl);
@@ -245,8 +245,8 @@ static void sahara_read64(struct qdl_device *qdl, struct sahara_pkt *pkt, char *
assert(pkt->length == SAHARA_READ_DATA64_LENGTH);
ux_info("READ64 image: %" PRId64 " offset: 0x%" PRIx64 " length: 0x%" PRIx64 "\n",
pkt->read64_req.image, pkt->read64_req.offset, pkt->read64_req.length);
ux_debug("READ64 image: %" PRId64 " offset: 0x%" PRIx64 " length: 0x%" PRIx64 "\n",
pkt->read64_req.image, pkt->read64_req.offset, pkt->read64_req.length);
if (single_image)
image = 0;
@@ -254,13 +254,13 @@ static void sahara_read64(struct qdl_device *qdl, struct sahara_pkt *pkt, char *
image = pkt->read64_req.image;
if (image >= MAPPING_SZ || !img_arr[image]) {
ux_err("Device specified invalid image: %u\n", image);
ux_err("device requested invalid image: %u\n", image);
sahara_send_reset(qdl);
return;
}
fd = open(img_arr[image], O_RDONLY);
if (fd < 0) {
ux_err("Can not open %s: %s\n", img_arr[image], strerror(errno));
ux_err("Can not open \"%s\": %s\n", img_arr[image], strerror(errno));
// Maybe this read was optional. Notify device of error and let
// it decide how to proceed.
sahara_send_reset(qdl);
@@ -280,10 +280,10 @@ static void sahara_eoi(struct qdl_device *qdl, struct sahara_pkt *pkt)
assert(pkt->length == SAHARA_END_OF_IMAGE_LENGTH);
ux_info("END OF IMAGE image: %d status: %d\n", pkt->eoi.image, pkt->eoi.status);
ux_debug("END OF IMAGE image: %d status: %d\n", pkt->eoi.image, pkt->eoi.status);
if (pkt->eoi.status != 0) {
ux_info("received non-successful result\n");
ux_err("received non-successful end-of-image result\n");
return;
}
@@ -296,7 +296,7 @@ static int sahara_done(struct qdl_device *qdl, struct sahara_pkt *pkt)
{
assert(pkt->length == SAHARA_DONE_RESP_LENGTH);
ux_info("DONE status: %d\n", pkt->done_resp.status);
ux_debug("DONE status: %d\n", pkt->done_resp.status);
// 0 == PENDING, 1 == COMPLETE. Device expects more images if
// PENDING is set in status.
@@ -393,8 +393,8 @@ static void sahara_debug64(struct qdl_device *qdl, struct sahara_pkt *pkt,
assert(pkt->length == SAHARA_MEM_DEBUG64_LENGTH);
ux_info("DEBUG64 address: 0x%" PRIx64 " length: 0x%" PRIx64 "\n",
pkt->debug64_req.addr, pkt->debug64_req.length);
ux_debug("DEBUG64 address: 0x%" PRIx64 " length: 0x%" PRIx64 "\n",
pkt->debug64_req.addr, pkt->debug64_req.length);
read_req.cmd = SAHARA_MEM_READ64_CMD;
read_req.length = SAHARA_MEM_READ64_LENGTH;
@@ -415,14 +415,12 @@ static void sahara_debug64(struct qdl_device *qdl, struct sahara_pkt *pkt,
if (sahara_debug64_filter(table[i].filename, filter))
continue;
ux_info("%-2d: type 0x%" PRIx64 " address: 0x%" PRIx64 " length: 0x%" PRIx64 " region: %s filename: %s\n",
i, table[i].type, table[i].addr, table[i].length, table[i].region, table[i].filename);
ux_debug("%-2d: type 0x%" PRIx64 " address: 0x%" PRIx64 " length: 0x%" PRIx64 " region: %s filename: %s\n",
i, table[i].type, table[i].addr, table[i].length, table[i].region, table[i].filename);
n = sahara_debug64_one(qdl, table[i], ramdump_dir);
if (n < 0)
break;
}
free(table);
@@ -453,7 +451,7 @@ int sahara_run(struct qdl_device *qdl, char *img_arr[], bool single_image,
pkt = (struct sahara_pkt*)buf;
if (n != pkt->length) {
ux_err("length not matching\n");
ux_err("request length not matching received request\n");
return -EINVAL;
}

47
ufs.c
View File

@@ -81,7 +81,7 @@ struct ufs_common *ufs_parse_common_params(xmlNode *node, bool finalize_provisio
result->bConfigDescrLock = !!attr_as_unsigned(node, "bConfigDescrLock", &errors);
if (errors) {
ux_err("[UFS] errors while parsing common\n");
ux_err("errors while parsing UFS common tag\n");
free(result);
return NULL;
}
@@ -117,7 +117,7 @@ struct ufs_body *ufs_parse_body(xmlNode *node)
result->desc = attr_as_string(node, "desc", &errors);
if (errors) {
ux_err("[UFS] errors while parsing body\n");
ux_err("errors while parsing UFS body tag\n");
free(result);
return NULL;
}
@@ -134,7 +134,7 @@ struct ufs_epilogue *ufs_parse_epilogue(xmlNode *node)
result->LUNtoGrow = attr_as_unsigned(node, "LUNtoGrow", &errors);
if (errors) {
ux_err("[UFS] errors while parsing epilogue\n");
ux_err("errors while parsing UFS epilogue tag\n");
free(result);
return NULL;
}
@@ -150,14 +150,14 @@ int ufs_load(const char *ufs_file, bool finalize_provisioning)
struct ufs_body *ufs_body_tmp;
if (ufs_common_p) {
ux_err("Only one UFS provisioning XML allowed, %s ignored\n",
ux_err("Only one UFS provisioning XML allowed, \"%s\" ignored\n",
ufs_file);
return -EEXIST;
}
doc = xmlReadFile(ufs_file, NULL, 0);
if (!doc) {
ux_err("[UFS] failed to parse %s\n", ufs_file);
ux_err("failed to parse ufs-type file \"%s\"\n", ufs_file);
return -EINVAL;
}
@@ -168,8 +168,8 @@ int ufs_load(const char *ufs_file, bool finalize_provisioning)
continue;
if (xmlStrcmp(node->name, (xmlChar*)"ufs")) {
ux_err("[UFS] unrecognized tag \"%s\", ignoring\n",
node->name);
ux_err("unrecognized tag \"%s\" in ufs-type file \"%s\", ignoring\n",
ufs_file, node->name);
continue;
}
@@ -179,15 +179,15 @@ int ufs_load(const char *ufs_file, bool finalize_provisioning)
finalize_provisioning);
}
else {
ux_err("[UFS] Only one common tag is allowed\n"
"[UFS] provisioning aborted\n");
ux_err("multiple UFS common tags found in \"%s\"\n",
ufs_file);
retval = -EINVAL;
break;
}
if (!ufs_common_p) {
ux_err("[UFS] Common tag corrupted\n"
"[UFS] provisioning aborted\n");
ux_err("invalid UFS common tag found in \"%s\"\n",
ufs_file);
retval = -EINVAL;
break;
}
@@ -204,8 +204,8 @@ int ufs_load(const char *ufs_file, bool finalize_provisioning)
}
}
else {
ux_err("[UFS] LU tag corrupted\n"
"[UFS] provisioning aborted\n");
ux_err("invalid UFS body tag found in \"%s\"\n",
ufs_file);
retval = -EINVAL;
break;
}
@@ -216,22 +216,21 @@ int ufs_load(const char *ufs_file, bool finalize_provisioning)
continue;
}
else {
ux_err("[UFS] Only one finalizing tag is allowed\n"
"[UFS] provisioning aborted\n");
ux_err("multiple UFS finalizing tags found in \"%s\"\n",
ufs_file);
retval = -EINVAL;
break;
}
if (!ufs_epilogue_p) {
ux_err("[UFS] Finalizing tag corrupted\n"
"[UFS] provisioning aborted\n");
ux_err("invalid UFS finalizing tag found in \"%s\"\n",
ufs_file);
retval = -EINVAL;
break;
}
} else {
ux_err("[UFS] Unknown tag or %s corrupted\n"
"[UFS] provisioning aborted\n", ufs_file);
ux_err("unknown tag found in ufs-type file \"%s\"\n", ufs_file);
retval = -EINVAL;
break;
}
@@ -240,8 +239,7 @@ int ufs_load(const char *ufs_file, bool finalize_provisioning)
xmlFreeDoc(doc);
if (!retval && (!ufs_common_p || !ufs_body_p || !ufs_epilogue_p)) {
ux_err("[UFS] %s seems to be incomplete\n"
"[UFS] provisioning aborted\n", ufs_file);
ux_err("incomplete UFS provisioning information in \"%s\"\n", ufs_file);
retval = -EINVAL;
}
@@ -255,12 +253,10 @@ int ufs_load(const char *ufs_file, bool finalize_provisioning)
if (ufs_epilogue_p) {
free(ufs_epilogue_p);
}
ux_err("[UFS] %s seems to be corrupted, ignore\n", ufs_file);
return retval;
}
if (!finalize_provisioning != !ufs_common_p->bConfigDescrLock) {
ux_err("[UFS] Value bConfigDescrLock %d in file %s don't match command line parameter --finalize-provisioning %d\n"
"[UFS] provisioning aborted\n",
ux_err("UFS provisioning value bConfigDescrLock %d in file \"%s\" don't match command line parameter --finalize-provisioning %d\n",
ufs_common_p->bConfigDescrLock, ufs_file, finalize_provisioning);
ux_err(notice_bconfigdescrlock);
return -EINVAL;
@@ -278,9 +274,10 @@ int ufs_provisioning_execute(struct qdl_device *qdl,
if (ufs_common_p->bConfigDescrLock) {
int i;
ux_info("Attention!\nIrreversible provisioning will start in 5 s\n");
ux_info("WARNING: irreversible provisioning will start in 5s");
for(i=5; i>0; i--) {
ux_info(".\a");
fflush(stdout);
sleep(1);
}
ux_info("\n");