diff mbox series

[1/3] qemu-helper: depend on unfs3 and pseudo directly

Message ID 20221125211558.20985-1-alex@linutronix.de
State Accepted, archived
Commit f73e370bec16d206592a7ca01b4a86b1d1316ada
Headers show
Series [1/3] qemu-helper: depend on unfs3 and pseudo directly | expand

Commit Message

Alexander Kanavin Nov. 25, 2022, 9:15 p.m. UTC
Dependencies of runqemu belong in qemu-helper; in particular
there is no reason to scatter unfs3 all over the place, and then
require separate steps to make it available (e.g. 'meta-ide-support').

With this, startng runqemu with a nfs mount starts to 'just work'
after building an image.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/recipes-core/meta/meta-extsdk-toolchain.bb           | 2 +-
 meta/recipes-core/meta/meta-ide-support.bb                | 2 +-
 .../packagegroups/nativesdk-packagegroup-sdk-host.bb      | 1 -
 meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb   | 2 +-
 meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb      | 2 +-
 scripts/runqemu-export-rootfs                             | 8 ++------
 scripts/runqemu-extract-sdk                               | 2 +-
 7 files changed, 7 insertions(+), 12 deletions(-)

Comments

Richard Purdie Nov. 27, 2022, 11:58 p.m. UTC | #1
On Fri, 2022-11-25 at 22:15 +0100, Alexander Kanavin wrote:
> Dependencies of runqemu belong in qemu-helper; in particular
> there is no reason to scatter unfs3 all over the place, and then
> require separate steps to make it available (e.g. 'meta-ide-support').

NFS isn't really a dependency of qemu though. The thinking here was
that you could boot a real board onto an NFS mount from your local
system for development purposes. That is why it was being included as
an SDK tool.

Perhaps we should just add it to qemu helper as well to simplify the
runqemu case?

Cheers,

Richard
Alexander Kanavin Nov. 28, 2022, 9:54 a.m. UTC | #2
On Mon, 28 Nov 2022 at 00:58, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> NFS isn't really a dependency of qemu though. The thinking here was
> that you could boot a real board onto an NFS mount from your local
> system for development purposes. That is why it was being included as
> an SDK tool.
>
> Perhaps we should just add it to qemu helper as well to simplify the
> runqemu case?

I'm fine with that, just want to point out that commit history does
not have this justification - meta-* additions of nfs server
dependency specifically talk about qemu only, and sdk packagegroup
commit [1] does not describe the use case. I don't think there's a BSP
where this way of booting is officially supported and documented.

[1] https://git.yoctoproject.org/poky/commit/?h=master-next&id=b5b3825ce6df45b16e1f3e15001da213bc8b0a55

Alex
Richard Purdie Nov. 28, 2022, 10:15 a.m. UTC | #3
On Mon, 2022-11-28 at 10:54 +0100, Alexander Kanavin wrote:
> On Mon, 28 Nov 2022 at 00:58, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > NFS isn't really a dependency of qemu though. The thinking here was
> > that you could boot a real board onto an NFS mount from your local
> > system for development purposes. That is why it was being included as
> > an SDK tool.
> > 
> > Perhaps we should just add it to qemu helper as well to simplify the
> > runqemu case?
> 
> I'm fine with that, just want to point out that commit history does
> not have this justification - meta-* additions of nfs server
> dependency specifically talk about qemu only, and sdk packagegroup
> commit [1] does not describe the use case.

Some of our older commits don't have the right information in sadly, it
is something we've had to work on and still don't always get right. I
did think I was likely going to be at fault until I looked! :) That is
partly why I'm adding some context around it.

>  I don't think there's a BSP
> where this way of booting is officially supported and documented.

Maybe not but I have done it myself before, admittedly a long time ago.
The key question is whether it is a useful capability and worth
maintaining. I'd say that yes, in this case it is, particularly if we
can raise the profile of the feature and make sure it continues to work
(which the tests you're enabling help massively with).

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/recipes-core/meta/meta-extsdk-toolchain.bb b/meta/recipes-core/meta/meta-extsdk-toolchain.bb
index 0df681ac73..618b596e4d 100644
--- a/meta/recipes-core/meta/meta-extsdk-toolchain.bb
+++ b/meta/recipes-core/meta/meta-extsdk-toolchain.bb
@@ -2,7 +2,7 @@  SUMMARY = "Extensible SDK toolchain meta-recipe"
 DESCRIPTION = "Meta-recipe for ensuring the build directory contains all appropriate toolchain packages for using an IDE"
 LICENSE = "MIT"
 
-DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native"
+DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native"
 
 do_populate_sysroot[deptask] = "do_populate_sysroot"
 
diff --git a/meta/recipes-core/meta/meta-ide-support.bb b/meta/recipes-core/meta/meta-ide-support.bb
index 7f349f673d..dd11b5673c 100644
--- a/meta/recipes-core/meta/meta-ide-support.bb
+++ b/meta/recipes-core/meta/meta-ide-support.bb
@@ -2,7 +2,7 @@  SUMMARY = "Integrated Development Environment support"
 DESCRIPTION = "Meta package for ensuring the build directory contains all appropriate toolchain packages for using an IDE"
 LICENSE = "MIT"
 
-DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native cmake-native autoconf-native automake-native meson-native intltool-native pkgconfig-native"
+DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native cmake-native autoconf-native automake-native meson-native intltool-native pkgconfig-native"
 PR = "r3"
 RM_WORK_EXCLUDE += "${PN}"
 
diff --git a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
index 9166a0851f..84ee1e3fa1 100644
--- a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
+++ b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
@@ -16,7 +16,6 @@  RDEPENDS:${PN} = "\
     nativesdk-qemu \
     nativesdk-qemu-helper \
     nativesdk-pseudo \
-    nativesdk-unfs3 \
     nativesdk-opkg \
     nativesdk-libtool \
     nativesdk-autoconf \
diff --git a/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb b/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb
index abba7fe159..2a5bcfb909 100644
--- a/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb
+++ b/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb
@@ -1,6 +1,6 @@ 
 SUMMARY = "Qemu helper scripts"
 LICENSE = "GPL-2.0-only"
-RDEPENDS:${PN} = "nativesdk-qemu \
+RDEPENDS:${PN} = "nativesdk-qemu nativesdk-unfs3 nativesdk-pseudo \
                   nativesdk-python3-shell nativesdk-python3-fcntl nativesdk-python3-logging \
                 "
 
diff --git a/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb b/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
index e297586bbb..6053b71717 100644
--- a/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
+++ b/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
@@ -25,5 +25,5 @@  do_install() {
 	install qemu-oe-bridge-helper ${D}${bindir}/
 }
 
-DEPENDS += "qemu-system-native"
+DEPENDS += "qemu-system-native unfs3-native pseudo-native"
 addtask addto_recipe_sysroot after do_populate_sysroot before do_build
diff --git a/scripts/runqemu-export-rootfs b/scripts/runqemu-export-rootfs
index c1fff7fcb3..6a8acd0d5a 100755
--- a/scripts/runqemu-export-rootfs
+++ b/scripts/runqemu-export-rootfs
@@ -34,16 +34,12 @@  if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
 	echo "Did you forget to source your build environment setup script?"
 	exit 1
 fi
-. $SYSROOT_SETUP_SCRIPT meta-ide-support
+. $SYSROOT_SETUP_SCRIPT qemu-helper-native
 
 if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/unfsd" ]; then
 	echo "Error: Unable to find unfsd binary in $OECORE_NATIVE_SYSROOT/usr/bin/"
 
-	if [ "x$OECORE_DISTRO_VERSION" = "x" ]; then
-		echo "Have you run 'bitbake meta-ide-support'?"
-	else
-		echo "This shouldn't happen - something is missing from your toolchain installation"
-	fi
+	echo "This shouldn't happen - something is missing from your toolchain installation"
 	exit 1
 fi
 
diff --git a/scripts/runqemu-extract-sdk b/scripts/runqemu-extract-sdk
index 9bc0c07fb8..db05da25f2 100755
--- a/scripts/runqemu-extract-sdk
+++ b/scripts/runqemu-extract-sdk
@@ -25,7 +25,7 @@  if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
 	echo "Did you forget to source your build system environment setup script?"
 	exit 1
 fi
-. $SYSROOT_SETUP_SCRIPT meta-ide-support
+. $SYSROOT_SETUP_SCRIPT qemu-helper-native
 PSEUDO_OPTS="-P $OECORE_NATIVE_SYSROOT/usr"
 
 ROOTFS_TARBALL=$1