From: Adrian Freihofer <[email protected]>

ssh_port is stored as ['-p', '<port>'] (already includes the flag).
_target_ssh_args was wrapping it in another list with a leading "-p",
producing invalid ssh args like ["-p", ["-p", "2222"]].

Extend ssh_args directly with ssh_port instead of nesting it.

Also pass --port to the install-and-deploy task in the generated VS Code
configuration so the task reaches the target on non-default SSH ports.

Signed-off-by: Adrian Freihofer <[email protected]>
---
 scripts/lib/devtool/ide_plugins/__init__.py |  2 +-
 scripts/lib/devtool/ide_plugins/ide_code.py | 10 ++--------
 scripts/lib/devtool/ide_sdk.py              |  2 +-
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/scripts/lib/devtool/ide_plugins/__init__.py 
b/scripts/lib/devtool/ide_plugins/__init__.py
index eaf88e78cd..94ed7c9e6d 100644
--- a/scripts/lib/devtool/ide_plugins/__init__.py
+++ b/scripts/lib/devtool/ide_plugins/__init__.py
@@ -142,7 +142,7 @@ class GdbCrossConfig:
     def _target_ssh_gdbserver_args(self):
         ssh_args = []
         if self.gdb_cross.target_device.ssh_port:
-            ssh_args += ["-p", self.gdb_cross.target_device.ssh_port]
+            ssh_args += self.gdb_cross.target_device.ssh_port
         if self.gdb_cross.target_device.extraoptions:
             ssh_args.extend(self.gdb_cross.target_device.extraoptions)
         if self.gdb_cross.target_device.target:
diff --git a/scripts/lib/devtool/ide_plugins/ide_code.py 
b/scripts/lib/devtool/ide_plugins/ide_code.py
index 603d3cecf3..96f007ca91 100644
--- a/scripts/lib/devtool/ide_plugins/ide_code.py
+++ b/scripts/lib/devtool/ide_plugins/ide_code.py
@@ -404,10 +404,7 @@ class IdeVSCode(IdeBase):
                     "label": install_task_name,
                     "type": "shell",
                     "command": run_install_deploy,
-                    "args": [
-                        "--target",
-                        args.target
-                    ],
+                    "args": ["--target", args.target] + (["--port", args.port] 
if args.port else []),
                     "problemMatcher": []
                 }
             ]
@@ -515,10 +512,7 @@ class IdeVSCode(IdeBase):
                     "label": install_task_name,
                     "type": "shell",
                     "command": run_install_deploy,
-                    "args": [
-                        "--target",
-                        args.target
-                    ],
+                    "args": ["--target", args.target] + (["--port", args.port] 
if args.port else []),
                     "problemMatcher": []
                 },
                 {
diff --git a/scripts/lib/devtool/ide_sdk.py b/scripts/lib/devtool/ide_sdk.py
index 07f5552758..fea44740f3 100755
--- a/scripts/lib/devtool/ide_sdk.py
+++ b/scripts/lib/devtool/ide_sdk.py
@@ -55,7 +55,7 @@ class TargetDevice:
         self.ssh_sshexec = 'ssh'
         if args.ssh_exec:
             self.ssh_sshexec = args.ssh_exec
-        self.ssh_port = ''
+        self.ssh_port = []
         if args.port:
             self.ssh_port = ['-p', args.port]
         if args.key:
-- 
2.55.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#242578): 
https://lists.openembedded.org/g/openembedded-core/message/242578
Mute This Topic: https://lists.openembedded.org/mt/120567643/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to