Skip to contentSkip to conversation

qemu.bbclass: move to classes/ directory so that INHERIT can use it

PATCH Superseded [email protected] 2 participants 5 messages Apr 3, 2025 – Apr 8, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu.bbclass: move to classes/ directory so that INHERIT can use it

From: Chen Qi <[email protected]>

The functions in this bbclass is useful. Move it to classes/ directory so that it could both inherited by individual recipes and via INHERIT.

---
 meta/{classes-recipe => classes}/qemu.bbclass | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename meta/{classes-recipe => classes}/qemu.bbclass (100%)
meta/classes/qemu.bbclass renamed from meta/classes-recipe/qemu.bbclass +0 -0
similarity index 100%
rename from meta/classes-recipe/qemu.bbclass
rename to meta/classes/qemu.bbclass
Signature · 1 line
2.49.0
#1 lore raw
Quoted 2 lines · Chen Qi via lists.openembedded.org

The functions in this bbclass is useful. Move it to classes/ directory so that it could both inherited by individual recipes and via INHERIT.

If the functions are useful, they should be moved into meta/lib/oe. It would also be good to explain what is specifically useful and why.

Alex

author
#2 lore raw
Quoted 8 lines · Alexander Kanavin
Quoted 2 lines · Chen Qi via lists.openembedded.org

The functions in this bbclass is useful. Move it to classes/ directory so that it could both inherited by individual recipes and via INHERIT.

If the functions are useful, they should be moved into meta/lib/oe. It would also be good to explain what is specifically useful and why.

Alex

The qemu_wrapper_cmdline function is useful to run binaries via qemu user mode.

I'm not sure if we should move this function and the one it invokes (qemu_target_binary) to meta/lib/oe, because it also depends on QEMU_OPTIONS which is set in this bbclass.

"""
QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS:tune-%s" % d.getVar('TUNE_PKGARCH')) or ""}" QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS:tune-${TUNE_PKGARCH}"

"""

Moving qemu.bbclass to be under classes/ has the benefit of enabling other bbclass that could be used via "INHERIT" to make use of it.

Regards,
Qi

#3 lore raw
Quoted 2 lines · ChenQi

Moving qemu.bbclass to be under classes/ has the benefit of enabling other bbclass that could be used via "INHERIT" to make use of it.

Please be specific. Is this to support the version checker that runs executables through qemu usermode?

I'd still say 'running a target executable through qemu usermode' should be a function accessible via meta/lib/oe. Is it possible to refactor the functions, so that they take things like QEMU_OPTIONS as function arguments, and not from the datastore?

Alex

author
#4 lore raw

Yes. It is to support the version checker.
I'll refactor the functions and send out V3.

Regards,
Qi

-----Original Message-----
From: Alexander Kanavin <[email protected]>
Sent: Monday, April 7, 2025 6:13 PM
To: Chen, Qi <[email protected]>
Cc: [email protected]
Subject: Re: [OE-core][PATCH] qemu.bbclass: move to classes/ directory so that INHERIT can use it

Quoted 2 lines · ChenQi

Moving qemu.bbclass to be under classes/ has the benefit of enabling other bbclass that could be used via "INHERIT" to make use of it.

Please be specific. Is this to support the version checker that runs executables through qemu usermode?

I'd still say 'running a target executable through qemu usermode'
should be a function accessible via meta/lib/oe. Is it possible to refactor the functions, so that they take things like QEMU_OPTIONS as function arguments, and not from the datastore?

Alex