]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
devtool: ide-sdk: fix duplicate -p flag in _target_ssh_args
authorAdrian Freihofer <adrian.freihofer@siemens.com>
Sun, 2 Aug 2026 19:52:50 +0000 (21:52 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 5 Aug 2026 13:38:55 +0000 (14:38 +0100)
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 <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/devtool/ide_plugins/__init__.py
scripts/lib/devtool/ide_plugins/ide_code.py
scripts/lib/devtool/ide_sdk.py

index eaf88e78cd49edb9b2c1665a67033e7fdf5e14ad..94ed7c9e6d5f9763f3313897296f950fd29ef5c2 100644 (file)
@@ -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:
index 603d3cecf3580f37527fa77a1c3ee2a6939e0222..96f007ca91897f7644233f32d59510970e6ff4e3 100644 (file)
@@ -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": []
                 },
                 {
index 07f55527586c0175d4129138246b7e8871518cb6..fea44740f35244fd7ab1d90267285e954da33d80 100755 (executable)
@@ -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: