* [PATCH v2 0/3] fragments: add a 'devtool-ide-sdk' fragment
@ 2025-12-28 18:08 AdrianF
2025-12-28 18:08 ` [PATCH v2 1/3] " AdrianF
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: AdrianF @ 2025-12-28 18:08 UTC (permalink / raw)
To: openembedded-core; +Cc: Adrian Freihofer
From: Adrian Freihofer <adrian.freihofer@siemens.com>
Changes in comparison to v1:
- Drop the insecure root login part from the fragment description.
- Add support for fragments in write_config.
- Use the ide-sdk fragment in the ide_sdk selftest.
Adrian Freihofer (3):
fragments: add a 'devtool-ide-sdk' fragment
oe-selftest: case: support fragments in write_config
oe-selftest: ide_sdk: use the ide-sdk fragment
.../conf/fragments/yocto/devtool-ide-sdk.conf | 26 +++++++++++++++++++
meta/lib/oeqa/selftest/case.py | 9 ++++++-
meta/lib/oeqa/selftest/cases/devtool.py | 8 +++---
meta/lib/oeqa/selftest/context.py | 1 +
4 files changed, 38 insertions(+), 6 deletions(-)
create mode 100644 meta/conf/fragments/yocto/devtool-ide-sdk.conf
--
2.52.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/3] fragments: add a 'devtool-ide-sdk' fragment
2025-12-28 18:08 [PATCH v2 0/3] fragments: add a 'devtool-ide-sdk' fragment AdrianF
@ 2025-12-28 18:08 ` AdrianF
2025-12-28 18:08 ` [PATCH v2 2/3] oe-selftest: case: support fragments in write_config AdrianF
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: AdrianF @ 2025-12-28 18:08 UTC (permalink / raw)
To: openembedded-core; +Cc: Adrian Freihofer
From: Adrian Freihofer <adrian.freihofer@siemens.com>
Add a configuration fragment that enables devtool ide-sdk workflow
for development and remote debugging.
The configuration is intended to streamline the development workflow
where developers can modify recipes with devtool and debug them
remotely on target devices using IDEs like VSCode.
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
.../conf/fragments/yocto/devtool-ide-sdk.conf | 26 +++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 meta/conf/fragments/yocto/devtool-ide-sdk.conf
diff --git a/meta/conf/fragments/yocto/devtool-ide-sdk.conf b/meta/conf/fragments/yocto/devtool-ide-sdk.conf
new file mode 100644
index 0000000000..9b4b57f009
--- /dev/null
+++ b/meta/conf/fragments/yocto/devtool-ide-sdk.conf
@@ -0,0 +1,26 @@
+BB_CONF_FRAGMENT_SUMMARY = "Use devtool ide-sdk for development and remote debugging."
+BB_CONF_FRAGMENT_DESCRIPTION = "\
+This configuration enables the use of devtool ide-sdk. \
+Example usage: \
+ 1. bitbake-config-build enable-fragment core/yocto/devtool-ide-sdk \
+ bitbake-config-build enable-fragment core/yocto/root-login-with-empty-password \
+ 2. The recipe (my-recipe in this case) must be in IMAGE_INSTALL. \
+ 3. Devtool modify --debug-build my-recipe \
+ 4. devtool ide-sdk my-recipe core-image-full-cmdline --target root@192.168.7.2' \
+ 5. runqemu snapshot \
+ 6. code $BUILDDIR/workspace/sources/my-recipe \
+ 7. Develop and debug the sources of my-recipe from VSCode remotely on the device. \
+"
+
+# Build the companion debug file system
+IMAGE_GEN_DEBUGFS = "1"
+
+# Optimize build time: with devtool ide-sdk the dbg tar is not needed
+# (if booting the target via NFS is not used for remote debugging)
+IMAGE_FSTYPES_DEBUGFS = ""
+
+# Without copying the binaries into roofs-dbg, GDB does not find all source files.
+IMAGE_CLASSES += "image-combined-dbg"
+
+# Remote debugging needs gdbserver on the target device
+IMAGE_INSTALL:append = " gdbserver"
--
2.52.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/3] oe-selftest: case: support fragments in write_config
2025-12-28 18:08 [PATCH v2 0/3] fragments: add a 'devtool-ide-sdk' fragment AdrianF
2025-12-28 18:08 ` [PATCH v2 1/3] " AdrianF
@ 2025-12-28 18:08 ` AdrianF
2025-12-29 11:46 ` [OE-core] " Alexander Kanavin
2025-12-28 18:08 ` [PATCH v2 3/3] oe-selftest: ide_sdk: use the ide-sdk fragment AdrianF
2025-12-29 13:13 ` [OE-core] [PATCH v2 0/3] fragments: add a 'devtool-ide-sdk' fragment Mathieu Dubois-Briand
3 siblings, 1 reply; 6+ messages in thread
From: AdrianF @ 2025-12-28 18:08 UTC (permalink / raw)
To: openembedded-core; +Cc: Adrian Freihofer
From: Adrian Freihofer <adrian.freihofer@siemens.com>
When writing configuration files during selftests, also handle the
inclusion of fragment files via the toolcfg.conf mechanism.
By default the toolcfg.conf file from build/conf/toolcfg.conf is copied
to build-st/conf/toolcfg.conf. This comes with a risk for using fragments
by accident from the main build in the selftest build. To avoid this,
support writing a reproducible set of fragments per selftest case via
the write_config() method.
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
meta/lib/oeqa/selftest/case.py | 9 ++++++++-
meta/lib/oeqa/selftest/context.py | 1 +
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/selftest/case.py b/meta/lib/oeqa/selftest/case.py
index da35b25f68..148b120371 100644
--- a/meta/lib/oeqa/selftest/case.py
+++ b/meta/lib/oeqa/selftest/case.py
@@ -30,6 +30,7 @@ class OESelftestTestCase(OETestCase):
cls.localconf_path = cls.tc.config_paths['localconf']
cls.local_bblayers_path = cls.tc.config_paths['bblayers']
+ cls.toolcfgconf_path = cls.tc.config_paths['toolcfgconf']
cls.testinc_path = os.path.join(cls.tc.config_paths['builddir'],
"conf/selftest.inc")
@@ -161,7 +162,7 @@ class OESelftestTestCase(OETestCase):
self.logger.debug("Adding path '%s' to be cleaned up when test is over" % path)
self._track_for_cleanup.append(path)
- def write_config(self, data, multiconfig=None):
+ def write_config(self, data, multiconfig=None, fragments=None):
"""Write to config file"""
if multiconfig:
multiconfigdir = "%s/conf/multiconfig" % self.builddir
@@ -174,6 +175,12 @@ class OESelftestTestCase(OETestCase):
self.logger.debug("Writing to: %s\n%s\n" % (dest_path, data))
ftools.write_file(dest_path, data)
+ if fragments:
+ toolscfg_str = '# Added by oe-selftest' + os.linesep + \
+ 'OE_FRAGMENTS += "' + ' '.join(fragments) + '"' + os.linesep
+ self.logger.debug("Over writing fragments: %s\n%s" % (self.toolcfgconf_path, toolscfg_str))
+ ftools.write_file(self.toolcfgconf_path, toolscfg_str)
+
def append_config(self, data):
"""Append to <builddir>/conf/selftest.inc"""
self.logger.debug("Appending to: %s\n%s\n" % (self.testinc_path, data))
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py
index c9eb481725..02a4832553 100644
--- a/meta/lib/oeqa/selftest/context.py
+++ b/meta/lib/oeqa/selftest/context.py
@@ -278,6 +278,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor):
self.tc_kwargs['init']['config_paths']['builddir'] = builddir
self.tc_kwargs['init']['config_paths']['localconf'] = os.path.join(builddir, "conf/local.conf")
self.tc_kwargs['init']['config_paths']['bblayers'] = os.path.join(builddir, "conf/bblayers.conf")
+ self.tc_kwargs['init']['config_paths']['toolcfgconf'] = os.path.join(builddir, "conf/toolcfg.conf")
self.tc_kwargs['init']['newbuilddir'] = args.newbuilddir
self.tc_kwargs['init']['keep_builddir'] = args.keep_builddir
--
2.52.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 3/3] oe-selftest: ide_sdk: use the ide-sdk fragment
2025-12-28 18:08 [PATCH v2 0/3] fragments: add a 'devtool-ide-sdk' fragment AdrianF
2025-12-28 18:08 ` [PATCH v2 1/3] " AdrianF
2025-12-28 18:08 ` [PATCH v2 2/3] oe-selftest: case: support fragments in write_config AdrianF
@ 2025-12-28 18:08 ` AdrianF
2025-12-29 13:13 ` [OE-core] [PATCH v2 0/3] fragments: add a 'devtool-ide-sdk' fragment Mathieu Dubois-Briand
3 siblings, 0 replies; 6+ messages in thread
From: AdrianF @ 2025-12-28 18:08 UTC (permalink / raw)
To: openembedded-core; +Cc: Adrian Freihofer
From: Adrian Freihofer <adrian.freihofer@siemens.com>
Test also the new ide-sdk fragment when setting up the ide-sdk test
environment.
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
meta/lib/oeqa/selftest/cases/devtool.py | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 8d7e984753..2173590030 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -2526,13 +2526,11 @@ class DevtoolIdeSdkTests(DevtoolBase):
def _write_bb_config(self, recipe_names):
"""Helper to write the bitbake local.conf file"""
conf_lines = [
- 'IMAGE_CLASSES += "image-combined-dbg"',
- 'IMAGE_GEN_DEBUGFS = "1"',
- 'IMAGE_INSTALL:append = " gdbserver %s"' % ' '.join(
- [r + '-ptest' for r in recipe_names]),
+ 'IMAGE_INSTALL:append = " %s"' % ' '.join([r + '-ptest' for r in recipe_names]),
'DISTRO_FEATURES:append = " ptest"'
]
- self.write_config("\n".join(conf_lines))
+ fragments = ['core/yocto/devtool-ide-sdk']
+ self.write_config("\n".join(conf_lines), fragments=fragments)
def _check_workspace(self):
"""Check if a workspace directory is available and setup the cleanup"""
--
2.52.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v2 2/3] oe-selftest: case: support fragments in write_config
2025-12-28 18:08 ` [PATCH v2 2/3] oe-selftest: case: support fragments in write_config AdrianF
@ 2025-12-29 11:46 ` Alexander Kanavin
0 siblings, 0 replies; 6+ messages in thread
From: Alexander Kanavin @ 2025-12-29 11:46 UTC (permalink / raw)
To: adrian.freihofer; +Cc: openembedded-core
On Sun, 28 Dec 2025 at 19:09, Adrian Freihofer via
lists.openembedded.org
<adrian.freihofer=siemens.com@lists.openembedded.org> wrote:
> - def write_config(self, data, multiconfig=None):
> + def write_config(self, data, multiconfig=None, fragments=None):
> """Write to config file"""
> if multiconfig:
> multiconfigdir = "%s/conf/multiconfig" % self.builddir
> @@ -174,6 +175,12 @@ class OESelftestTestCase(OETestCase):
> self.logger.debug("Writing to: %s\n%s\n" % (dest_path, data))
> ftools.write_file(dest_path, data)
>
> + if fragments:
> + toolscfg_str = '# Added by oe-selftest' + os.linesep + \
> + 'OE_FRAGMENTS += "' + ' '.join(fragments) + '"' + os.linesep
> + self.logger.debug("Over writing fragments: %s\n%s" % (self.toolcfgconf_path, toolscfg_str))
> + ftools.write_file(self.toolcfgconf_path, toolscfg_str)
This should be using 'bitbake-config-build enable-fragment' rather
than write to the file directly. It should also not overwrite the
file: the 'main' build may enable important fragments for the overall
sefltest, or the machine they run on (e.g. the yocto ci is using
autobuilder fragments throughout) and they should be kept.
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v2 0/3] fragments: add a 'devtool-ide-sdk' fragment
2025-12-28 18:08 [PATCH v2 0/3] fragments: add a 'devtool-ide-sdk' fragment AdrianF
` (2 preceding siblings ...)
2025-12-28 18:08 ` [PATCH v2 3/3] oe-selftest: ide_sdk: use the ide-sdk fragment AdrianF
@ 2025-12-29 13:13 ` Mathieu Dubois-Briand
3 siblings, 0 replies; 6+ messages in thread
From: Mathieu Dubois-Briand @ 2025-12-29 13:13 UTC (permalink / raw)
To: adrian.freihofer, openembedded-core
On Sun Dec 28, 2025 at 7:08 PM CET, Adrian Freihofer via lists.openembedded.org wrote:
> From: Adrian Freihofer <adrian.freihofer@siemens.com>
>
> Changes in comparison to v1:
> - Drop the insecure root login part from the fragment description.
> - Add support for fragments in write_config.
> - Use the ide-sdk fragment in the ide_sdk selftest.
>
> Adrian Freihofer (3):
> fragments: add a 'devtool-ide-sdk' fragment
> oe-selftest: case: support fragments in write_config
> oe-selftest: ide_sdk: use the ide-sdk fragment
>
> .../conf/fragments/yocto/devtool-ide-sdk.conf | 26 +++++++++++++++++++
> meta/lib/oeqa/selftest/case.py | 9 ++++++-
> meta/lib/oeqa/selftest/cases/devtool.py | 8 +++---
> meta/lib/oeqa/selftest/context.py | 1 +
> 4 files changed, 38 insertions(+), 6 deletions(-)
> create mode 100644 meta/conf/fragments/yocto/devtool-ide-sdk.conf
Hi Adrian,
Thanks for your patches.
It looks like it is breaking some test:
2025-12-29 09:09:18,661 - oe-selftest - INFO - gdbserver.GdbServerTest.test_gdb_server (subunit.RemotedTestCase)
2025-12-29 09:09:18,661 - oe-selftest - INFO - ... ERROR
File "/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/layers/openembedded-core/meta/lib/oeqa/selftest/cases/gdbserver.py", line 42, in test_gdb_server
shutil.unpack_archive(filename, debugfs)
File "/usr/lib64/python3.9/shutil.py", line 1278, in unpack_archive
func(filename, extract_dir, **kwargs)
File "/usr/lib64/python3.9/shutil.py", line 1199, in _unpack_tarfile
tarobj = tarfile.open(filename)
File "/usr/lib64/python3.9/tarfile.py", line 1848, in open
return func(name, "r", fileobj, **kwargs)
File "/usr/lib64/python3.9/tarfile.py", line 1912, in gzopen
fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
File "/usr/lib64/python3.9/gzip.py", line 173, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-4140890/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.rootfs-dbg.tar.bz2'
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/2816
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/2923
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/3060
Can you have a look at what's wrong here?
Thanks,
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-12-29 13:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-28 18:08 [PATCH v2 0/3] fragments: add a 'devtool-ide-sdk' fragment AdrianF
2025-12-28 18:08 ` [PATCH v2 1/3] " AdrianF
2025-12-28 18:08 ` [PATCH v2 2/3] oe-selftest: case: support fragments in write_config AdrianF
2025-12-29 11:46 ` [OE-core] " Alexander Kanavin
2025-12-28 18:08 ` [PATCH v2 3/3] oe-selftest: ide_sdk: use the ide-sdk fragment AdrianF
2025-12-29 13:13 ` [OE-core] [PATCH v2 0/3] fragments: add a 'devtool-ide-sdk' fragment Mathieu Dubois-Briand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox