* [PATCH] start_vm.py: support running images built with kas on host
@ 2025-01-23 15:17 Uladzimir Bely
2025-01-23 15:27 ` 'MOESSBAUER, Felix' via isar-users
0 siblings, 1 reply; 2+ messages in thread
From: Uladzimir Bely @ 2025-01-23 15:17 UTC (permalink / raw)
To: isar-users
Script start_vm.py internally calls bitbake (bb.tinfoil) to set
some qemu parameters from the build environment. If the image
was build in kas, build/conf/bblayers.conf includes path that don't
fit host machine.
Also, current implementation relies on appropriate BBMULTICONFIG
value set in local.conf.
The patch adds workarounds that cover both cases mentioned above.
Configuring and building the image:
```
./kas/kas-container menu
./kas/kas-container build
```
Running the image with start_vm.py:
```
. isar-init-build-env
../testsuite/start_vm.py -a amd64 -d bookworm -i isar-image-base
```
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
kas/isar.yaml | 4 ++++
testsuite/start_vm.py | 10 ++++++++++
2 files changed, 14 insertions(+)
diff --git a/kas/isar.yaml b/kas/isar.yaml
index 16ce8b42..d15bdbe1 100644
--- a/kas/isar.yaml
+++ b/kas/isar.yaml
@@ -17,3 +17,7 @@ bblayers_conf_header:
standard: |
BBPATH = "${TOPDIR}"
BBFILES ?= ""
+
+local_conf_header:
+ bbmulticonfig: |
+ BBMULTICONFIG += "${MACHINE}-${BASE_DISTRO_CODENAME}"
diff --git a/testsuite/start_vm.py b/testsuite/start_vm.py
index 0b9a52d6..f39e53a1 100755
--- a/testsuite/start_vm.py
+++ b/testsuite/start_vm.py
@@ -135,7 +135,17 @@ def sb_cleanup():
os.remove(os.path.basename(OVMF_VARS_PATH))
+def kas_paths_workaround():
+ # "repo" simlink pointing to the isar dir makes kas-generated
+ # ${TOPDIR}/../repo/ paths in local.conf work outside of kas container
+ isar_dir = os.path.realpath(f'{os.path.dirname(__file__)}/..')
+ if not os.path.exists(f'{isar_dir}/repo'):
+ os.symlink('.', f'{isar_dir}/repo')
+
+
def start_qemu(arch, build, distro, image, out, pid, enforce_pcbios):
+ kas_paths_workaround()
+
cmdline, vm_ctx = format_qemu_cmdline(
arch, build, distro, image, out, pid, enforce_pcbios
)
--
2.45.2
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20250123151758.18098-1-ubely%40ilbers.de.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] start_vm.py: support running images built with kas on host
2025-01-23 15:17 [PATCH] start_vm.py: support running images built with kas on host Uladzimir Bely
@ 2025-01-23 15:27 ` 'MOESSBAUER, Felix' via isar-users
0 siblings, 0 replies; 2+ messages in thread
From: 'MOESSBAUER, Felix' via isar-users @ 2025-01-23 15:27 UTC (permalink / raw)
To: ubely, isar-users; +Cc: Bezdeka, Florian, Kiszka, Jan
On Thu, 2025-01-23 at 18:17 +0300, Uladzimir Bely wrote:
> Script start_vm.py internally calls bitbake (bb.tinfoil) to set
> some qemu parameters from the build environment. If the image
> was build in kas, build/conf/bblayers.conf includes path that don't
> fit host machine.
>
> Also, current implementation relies on appropriate BBMULTICONFIG
> value set in local.conf.
>
> The patch adds workarounds that cover both cases mentioned above.
>
> Configuring and building the image:
>
> ```
> ./kas/kas-container menu
> ./kas/kas-container build
> ```
>
> Running the image with start_vm.py:
>
> ```
> . isar-init-build-env
> ../testsuite/start_vm.py -a amd64 -d bookworm -i isar-image-base
> ```
>
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
> kas/isar.yaml | 4 ++++
> testsuite/start_vm.py | 10 ++++++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/kas/isar.yaml b/kas/isar.yaml
> index 16ce8b42..d15bdbe1 100644
> --- a/kas/isar.yaml
> +++ b/kas/isar.yaml
> @@ -17,3 +17,7 @@ bblayers_conf_header:
> standard: |
> BBPATH = "${TOPDIR}"
> BBFILES ?= ""
> +
> +local_conf_header:
> + bbmulticonfig: |
> + BBMULTICONFIG += "${MACHINE}-${BASE_DISTRO_CODENAME}"
Hi,
as mentioned in the other patch, this setting is set by kas if a
multiconfig target is built. The isar-ci script also adds it to the CI
local config. I don't know if we really want to always have it.
> diff --git a/testsuite/start_vm.py b/testsuite/start_vm.py
> index 0b9a52d6..f39e53a1 100755
> --- a/testsuite/start_vm.py
> +++ b/testsuite/start_vm.py
> @@ -135,7 +135,17 @@ def sb_cleanup():
> os.remove(os.path.basename(OVMF_VARS_PATH))
>
>
> +def kas_paths_workaround():
> + # "repo" simlink pointing to the isar dir makes kas-generated
> + # ${TOPDIR}/../repo/ paths in local.conf work outside of kas
> container
> + isar_dir = os.path.realpath(f'{os.path.dirname(__file__)}/..')
> + if not os.path.exists(f'{isar_dir}/repo'):
> + os.symlink('.', f'{isar_dir}/repo')
> +
> +
This depends on internals of the kas-container. If bitbake was executed
inside the container, bitbake must not be used outside of the container
to query the state. This is a recipe for bugs.
To be frank, I'm not a big fan of this patch, as it is too intrusive.
Best regards,
Felix
> def start_qemu(arch, build, distro, image, out, pid,
> enforce_pcbios):
> + kas_paths_workaround()
> +
> cmdline, vm_ctx = format_qemu_cmdline(
> arch, build, distro, image, out, pid, enforce_pcbios
> )
> --
> 2.45.2
>
--
Siemens AG
Linux Expert Center
Friedrich-Ludwig-Bauer-Str. 3
85748 Garching, Germany
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/3baa1b95751fbcb07c6371878459cb147ca4585c.camel%40siemens.com.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-23 15:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-23 15:17 [PATCH] start_vm.py: support running images built with kas on host Uladzimir Bely
2025-01-23 15:27 ` 'MOESSBAUER, Felix' via isar-users
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox