From: Adrian Freihofer <[email protected]> The debugger configuration classes in ide_plugins need to know whether the target loops back to the local machine, which is where the slirp port forwarding they have to deal with exists. They cannot import ide_sdk for it, since ide_sdk imports them.
No functional change. Signed-off-by: Adrian Freihofer <[email protected]> --- scripts/lib/devtool/ide_plugins/__init__.py | 14 ++++++++++++++ scripts/lib/devtool/ide_sdk.py | 16 +--------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/lib/devtool/ide_plugins/__init__.py b/scripts/lib/devtool/ide_plugins/__init__.py index 333ec9bac8..2cdb2e504a 100644 --- a/scripts/lib/devtool/ide_plugins/__init__.py +++ b/scripts/lib/devtool/ide_plugins/__init__.py @@ -15,6 +15,20 @@ from devtool import DevtoolError logger = logging.getLogger('devtool') +# Hosts a ssh target is considered to loop back to the local machine, e.g. a +# QEMU instance reached through slirp/hostfwd port forwarding (root@localhost) +# which has an ephemeral ssh host key that changes on every boot. +LOOPBACK_HOSTS = ('localhost', '127.0.0.1', '::1') + + +def target_host(target): + return target.split('@')[-1] + + +def is_loopback_target(target): + return target_host(target) in LOOPBACK_HOSTS + + class BuildTool(Enum): UNDEFINED = auto() CMAKE = auto() diff --git a/scripts/lib/devtool/ide_sdk.py b/scripts/lib/devtool/ide_sdk.py index a2b15ce440..a987c37f06 100755 --- a/scripts/lib/devtool/ide_sdk.py +++ b/scripts/lib/devtool/ide_sdk.py @@ -25,7 +25,7 @@ import bb from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, DevtoolError, parse_recipe from devtool.standard import get_real_srctree from devtool.deploy import parse_packages_arg -from devtool.ide_plugins import BuildTool, DebuggerCrossConfig +from devtool.ide_plugins import BuildTool, DebuggerCrossConfig, LOOPBACK_HOSTS, is_loopback_target from oe.kernel_module import kernel_module_os_env from pseudo_rootfs_utils import PseudoRootfsError, extract_sdk_rootfs, pseudo_state_dir @@ -48,20 +48,6 @@ class DevtoolIdeMode(Enum): shared = 'shared' -# Hosts a ssh target is considered to loop back to the local machine, e.g. a -# QEMU instance reached through slirp/hostfwd port forwarding (root@localhost) -# which has an ephemeral ssh host key that changes on every boot. -LOOPBACK_HOSTS = ('localhost', '127.0.0.1', '::1') - - -def target_host(target): - return target.split('@')[-1] - - -def is_loopback_target(target): - return target_host(target) in LOOPBACK_HOSTS - - class TargetDevice: """SSH remote login parameters""" -- 2.55.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#246083): https://lists.openembedded.org/g/openembedded-core/message/246083 Mute This Topic: https://lists.openembedded.org/mt/121302026/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
