From b9739d124c3772764ca73192aba392b8fefc234e Mon Sep 17 00:00:00 2001 From: Yvonne Kaire Date: Wed, 27 Aug 2025 14:44:09 -0700 Subject: [PATCH 1/5] qdl crash and reset fixes --- Makefile | 6 +++--- firehose.c | 1 + patch.c | 9 +++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ddd06c9..5dd5c68 100644 --- a/Makefile +++ b/Makefile @@ -40,9 +40,9 @@ $(KS_OUT): $(KS_OBJS) compile_commands.json: $(QDL_SRCS) $(KS_SRCS) @echo -n $^ | jq -snR "[inputs|split(\" \")[]|{directory:\"$(PWD)\", command: \"$(CC) $(CFLAGS) -c \(.)\", file:.}]" > $@ -version.h:: - @echo "#define VERSION \"$(VERSION)\"" > .version.h - @cmp -s .version.h version.h || cp .version.h version.h +# version.h:: +# @echo "#define VERSION \"$(VERSION)\"" > .version.h +# @cmp -s .version.h version.h || cp .version.h version.h util.o: version.h diff --git a/firehose.c b/firehose.c index 6745abe..acecf52 100644 --- a/firehose.c +++ b/firehose.c @@ -804,6 +804,7 @@ static int firehose_reset(struct qdl_device *qdl) node = xmlNewChild(root, NULL, (xmlChar *)"power", NULL); xml_setpropf(node, "value", "reset"); + xml_setpropf(node, "DelayInSeconds", "10"); // Add a delay to prevent reboot fail ret = firehose_write(qdl, doc); xmlFreeDoc(doc); diff --git a/patch.c b/patch.c index 5502a09..6b9a08e 100644 --- a/patch.c +++ b/patch.c @@ -81,11 +81,20 @@ int patch_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl, s int ret; for (patch = patches; patch; patch = patch->next) { + if(!patch->filename){ + continue; + } + if (!strcmp(patch->filename, "DISK")) count++; } for (patch = patches; patch; patch = patch->next) { + + if(!patch->filename){ + continue; + } + if (strcmp(patch->filename, "DISK")) continue; From eb9c64330ed2590e97a60c7c054b80fbd7cb5be7 Mon Sep 17 00:00:00 2001 From: Yvonne Kaire Date: Wed, 27 Aug 2025 23:18:23 -0700 Subject: [PATCH 2/5] fix for empty file name and delay issues --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5dd5c68..ddd06c9 100644 --- a/Makefile +++ b/Makefile @@ -40,9 +40,9 @@ $(KS_OUT): $(KS_OBJS) compile_commands.json: $(QDL_SRCS) $(KS_SRCS) @echo -n $^ | jq -snR "[inputs|split(\" \")[]|{directory:\"$(PWD)\", command: \"$(CC) $(CFLAGS) -c \(.)\", file:.}]" > $@ -# version.h:: -# @echo "#define VERSION \"$(VERSION)\"" > .version.h -# @cmp -s .version.h version.h || cp .version.h version.h +version.h:: + @echo "#define VERSION \"$(VERSION)\"" > .version.h + @cmp -s .version.h version.h || cp .version.h version.h util.o: version.h From f17e6190cb0b040f026ca057e1e6a0bddcfb0b46 Mon Sep 17 00:00:00 2001 From: Yvonne Kaire Date: Thu, 28 Aug 2025 10:36:34 -0700 Subject: [PATCH 3/5] prevent crash when empty filename is provided Signed-off-by: Yvonne Kaire --- patch.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patch.c b/patch.c index 5502a09..6b9a08e 100644 --- a/patch.c +++ b/patch.c @@ -81,11 +81,20 @@ int patch_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl, s int ret; for (patch = patches; patch; patch = patch->next) { + if(!patch->filename){ + continue; + } + if (!strcmp(patch->filename, "DISK")) count++; } for (patch = patches; patch; patch = patch->next) { + + if(!patch->filename){ + continue; + } + if (strcmp(patch->filename, "DISK")) continue; From e9541ff90fd2a64d57659c61236d7cbe8e73fc90 Mon Sep 17 00:00:00 2001 From: Yvonne Kaire Date: Thu, 28 Aug 2025 10:38:26 -0700 Subject: [PATCH 4/5] Add a delay to reset timer to prevent reboot failure Signed-off-by: Yvonne Kaire --- firehose.c | 1 + 1 file changed, 1 insertion(+) diff --git a/firehose.c b/firehose.c index 6745abe..acecf52 100644 --- a/firehose.c +++ b/firehose.c @@ -804,6 +804,7 @@ static int firehose_reset(struct qdl_device *qdl) node = xmlNewChild(root, NULL, (xmlChar *)"power", NULL); xml_setpropf(node, "value", "reset"); + xml_setpropf(node, "DelayInSeconds", "10"); // Add a delay to prevent reboot fail ret = firehose_write(qdl, doc); xmlFreeDoc(doc); From b1242132ca317300249390d4d9e436936fe4ec1f Mon Sep 17 00:00:00 2001 From: Yvonne Kaire Date: Thu, 28 Aug 2025 10:56:55 -0700 Subject: [PATCH 5/5] revert Makefile changes. Signed-off-by: Yvonne Kaire --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ddd06c9..5dd5c68 100644 --- a/Makefile +++ b/Makefile @@ -40,9 +40,9 @@ $(KS_OUT): $(KS_OBJS) compile_commands.json: $(QDL_SRCS) $(KS_SRCS) @echo -n $^ | jq -snR "[inputs|split(\" \")[]|{directory:\"$(PWD)\", command: \"$(CC) $(CFLAGS) -c \(.)\", file:.}]" > $@ -version.h:: - @echo "#define VERSION \"$(VERSION)\"" > .version.h - @cmp -s .version.h version.h || cp .version.h version.h +# version.h:: +# @echo "#define VERSION \"$(VERSION)\"" > .version.h +# @cmp -s .version.h version.h || cp .version.h version.h util.o: version.h