From 2a9f9933cf0449448970d5814e2b63c57fb60f3a Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Fri, 11 Jul 2025 16:32:17 +0200 Subject: [PATCH 1/3] connectcore-demo-example: update the root home path to DEY-5.0 default Home root path changed to '/root' on DEY-5.0. https://onedigi.atlassian.net/browse/DEL-9718 Signed-off-by: Isaac Hermida --- connectcore-demo-example/demoserver.py | 2 +- connectcore-demo-example/static/js/management.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connectcore-demo-example/demoserver.py b/connectcore-demo-example/demoserver.py index 0beca5e..3056f22 100755 --- a/connectcore-demo-example/demoserver.py +++ b/connectcore-demo-example/demoserver.py @@ -1278,7 +1278,7 @@ def get_fw_store_path(): String: Absolute path to store a firmware image. """ if is_dual_system(): - return "/home/root/" + return "/root/" return "/mnt/update/" diff --git a/connectcore-demo-example/static/js/management.js b/connectcore-demo-example/static/js/management.js index 40c23d1..8b8375e 100644 --- a/connectcore-demo-example/static/js/management.js +++ b/connectcore-demo-example/static/js/management.js @@ -69,7 +69,7 @@ var deviceRebooting = false; var updatingFirmware = false; var firmwareUpdateTimer = null; var uploadFirmwareAjaxRequest = null; -var fwStorageDir = "/home/root/"; +var fwStorageDir = "/root/"; // Initializes the management page. function initializeManagementPage() { From 14911565e8f9967cf4270654e62d5218566e6ca4 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Fri, 11 Jul 2025 18:09:56 +0200 Subject: [PATCH 2/3] connectcore-demo-example: improve is_dual_system() Fix an issue where the fw_printenv command output includes a trailing newline, which could lead to incorrect string comparisons. The output is now stripped to ensure consistent and accurate evaluation. Example before fix: >>> res = exec_cmd("fw_printenv -n dualboot") >>> res (0, 'yes\n') https://onedigi.atlassian.net/browse/DEL-9718 Signed-off-by: Isaac Hermida --- connectcore-demo-example/demoserver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectcore-demo-example/demoserver.py b/connectcore-demo-example/demoserver.py index 3056f22..1a6a23c 100755 --- a/connectcore-demo-example/demoserver.py +++ b/connectcore-demo-example/demoserver.py @@ -1267,7 +1267,7 @@ def is_dual_system(): Boolean: True for dual systems, False otherwise. """ res = exec_cmd("fw_printenv -n dualboot") - return res[0] == 0 and res[1] == "yes" + return res[0] == 0 and res[1].strip() == "yes" def get_fw_store_path(): From 4250a5e09885284764620c6defa9fc42affee0ab Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Fri, 11 Jul 2025 18:19:34 +0200 Subject: [PATCH 3/3] connectcore-demo-example: preserve "swu" file in update_firmware Avoid deleting the original "swu" firmware file during the update process, especially in dual-boot systems. Previously, the file could be removed from the source path even in the event of an exception. This change ensures the original file remains intact regardless of update outcome. Signed-off-by: Isaac Hermida --- connectcore-demo-example/demoserver.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/connectcore-demo-example/demoserver.py b/connectcore-demo-example/demoserver.py index 1a6a23c..701fa5e 100755 --- a/connectcore-demo-example/demoserver.py +++ b/connectcore-demo-example/demoserver.py @@ -570,8 +570,6 @@ class RequestHandler(http.server.SimpleHTTPRequestHandler): self.wfile.write(json.dumps({"error": e.stdout}).encode(encoding="utf_8")) fw_process = None - if is_dual_system() and os.path.exists(path): - os.remove(path) elif re.search("/ajax/check_firmware_update_running", self.path) is not None: # Set the response headers. self._set_headers(200)