mirror of
https://github.com/linux-msm/qdl.git
synced 2026-02-25 13:12:25 -08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad13228e6a | ||
|
|
fa070e81b4 | ||
|
|
f63c4df679 | ||
|
|
b068cc58d9 | ||
|
|
f8fae69796 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Dependencies (Ubuntu)
|
||||
if: runner.os == 'Linux'
|
||||
|
||||
12
firehose.c
12
firehose.c
@@ -613,7 +613,13 @@ int firehose_apply_ufs_common(struct qdl_device *qdl, struct ufs_common *ufs)
|
||||
xml_setpropf(node_to_send, "bSecureRemovalType", "%d", ufs->bSecureRemovalType);
|
||||
xml_setpropf(node_to_send, "bInitActiveICCLevel", "%d", ufs->bInitActiveICCLevel);
|
||||
xml_setpropf(node_to_send, "wPeriodicRTCUpdate", "%d", ufs->wPeriodicRTCUpdate);
|
||||
xml_setpropf(node_to_send, "bConfigDescrLock", "%d", 0/*ufs->bConfigDescrLock*/); //Safety, remove before fly
|
||||
xml_setpropf(node_to_send, "bConfigDescrLock", "%d", ufs->bConfigDescrLock);
|
||||
|
||||
if (ufs->wb) {
|
||||
xml_setpropf(node_to_send, "bWriteBoosterBufferPreserveUserSpaceEn", "%d", ufs->bWriteBoosterBufferPreserveUserSpaceEn);
|
||||
xml_setpropf(node_to_send, "bWriteBoosterBufferType", "%d", ufs->bWriteBoosterBufferType);
|
||||
xml_setpropf(node_to_send, "shared_wb_buffer_size_in_kb", "%d", ufs->shared_wb_buffer_size_in_kb);
|
||||
}
|
||||
|
||||
ret = firehose_send_single_tag(qdl, node_to_send);
|
||||
if (ret)
|
||||
@@ -725,7 +731,7 @@ static int firehose_reset(struct qdl_device *qdl)
|
||||
return ret == FIREHOSE_ACK ? 0 : -1;
|
||||
}
|
||||
|
||||
int firehose_run(struct qdl_device *qdl, const char *incdir, const char *storage)
|
||||
int firehose_run(struct qdl_device *qdl, const char *incdir, const char *storage, bool allow_missing)
|
||||
{
|
||||
int bootable;
|
||||
int ret;
|
||||
@@ -756,7 +762,7 @@ int firehose_run(struct qdl_device *qdl, const char *incdir, const char *storage
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = program_execute(qdl, firehose_program, incdir);
|
||||
ret = program_execute(qdl, firehose_program, incdir, allow_missing);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ out:
|
||||
}
|
||||
|
||||
int program_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl, struct program *program, int fd),
|
||||
const char *incdir)
|
||||
const char *incdir, bool allow_missing)
|
||||
{
|
||||
struct program *program;
|
||||
const char *filename;
|
||||
@@ -182,7 +182,12 @@ int program_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl,
|
||||
fd = open(filename, O_RDONLY);
|
||||
|
||||
if (fd < 0) {
|
||||
printf("Unable to open %s...ignoring\n", program->filename);
|
||||
printf("Unable to open %s", program->filename);
|
||||
if (!allow_missing) {
|
||||
printf("...failing\n");
|
||||
return -1;
|
||||
}
|
||||
printf("...ignoring\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ struct program {
|
||||
|
||||
int program_load(const char *program_file, bool is_nand);
|
||||
int program_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl, struct program *program, int fd),
|
||||
const char *incdir);
|
||||
const char *incdir, bool allow_missing);
|
||||
int erase_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl, struct program *program));
|
||||
int program_find_bootable_partition(void);
|
||||
|
||||
|
||||
11
qdl.c
11
qdl.c
@@ -103,7 +103,7 @@ static void print_usage(void)
|
||||
{
|
||||
extern const char *__progname;
|
||||
fprintf(stderr,
|
||||
"%s [--debug] [--storage <emmc|nand|ufs>] [--finalize-provisioning] [--include <PATH>] <prog.mbn> [<program> <patch> ...]\n",
|
||||
"%s [--debug] [--allow-missing] [--storage <emmc|nand|ufs>] [--finalize-provisioning] [--include <PATH>] [--serial <NUM>] [--out-chunk-size <SIZE>] <prog.mbn> [<program> <patch> ...]\n",
|
||||
__progname);
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@ int main(int argc, char **argv)
|
||||
int ret;
|
||||
int opt;
|
||||
bool qdl_finalize_provisioning = false;
|
||||
bool allow_missing = false;
|
||||
long out_chunk_size;
|
||||
|
||||
static struct option options[] = {
|
||||
@@ -129,14 +130,18 @@ int main(int argc, char **argv)
|
||||
{"out-chunk-size", required_argument, 0, OPT_OUT_CHUNK_SIZE },
|
||||
{"serial", required_argument, 0, 'S'},
|
||||
{"storage", required_argument, 0, 's'},
|
||||
{"allow-missing", no_argument, 0, 'f'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
while ((opt = getopt_long(argc, argv, "di:S:", options, NULL )) != -1) {
|
||||
while ((opt = getopt_long(argc, argv, "dfi:S:", options, NULL )) != -1) {
|
||||
switch (opt) {
|
||||
case 'd':
|
||||
qdl_debug = true;
|
||||
break;
|
||||
case 'f':
|
||||
allow_missing = true;
|
||||
break;
|
||||
case 'i':
|
||||
incdir = optarg;
|
||||
break;
|
||||
@@ -208,7 +213,7 @@ int main(int argc, char **argv)
|
||||
if (ret < 0)
|
||||
return 1;
|
||||
|
||||
ret = firehose_run(&qdl, incdir, storage);
|
||||
ret = firehose_run(&qdl, incdir, storage, allow_missing);
|
||||
if (ret < 0)
|
||||
return 1;
|
||||
|
||||
|
||||
2
qdl.h
2
qdl.h
@@ -31,7 +31,7 @@ int qdl_read(struct qdl_device *qdl, void *buf, size_t len, unsigned int timeout
|
||||
int qdl_write(struct qdl_device *qdl, const void *buf, size_t len);
|
||||
void qdl_set_out_chunk_size(struct qdl_device *qdl, long size);
|
||||
|
||||
int firehose_run(struct qdl_device *qdl, const char *incdir, const char *storage);
|
||||
int firehose_run(struct qdl_device *qdl, const char *incdir, const char *storage, bool allow_missing);
|
||||
int sahara_run(struct qdl_device *qdl, char *img_arr[], bool single_image,
|
||||
const char *ramdump_path, const char *ramdump_filter);
|
||||
void print_hex_dump(const char *prefix, const void *buf, size_t len);
|
||||
|
||||
7
ufs.c
7
ufs.c
@@ -86,6 +86,13 @@ struct ufs_common *ufs_parse_common_params(xmlNode *node, bool finalize_provisio
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* These parameters are optional */
|
||||
errors = 0;
|
||||
result->bWriteBoosterBufferPreserveUserSpaceEn = !!attr_as_unsigned(node, "bWriteBoosterBufferPreserveUserSpaceEn", &errors);
|
||||
result->bWriteBoosterBufferType = !!attr_as_unsigned(node, "bWriteBoosterBufferType", &errors);
|
||||
result->shared_wb_buffer_size_in_kb = attr_as_unsigned(node, "shared_wb_buffer_size_in_kb", &errors);
|
||||
result->wb = !errors;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user