public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
From: "Niedermayr, Benedikt (FT RPD CED OES-DE)" <benedikt.niedermayr@siemens.com>
To: "Kiszka, Jan (FT RPD CED)" <jan.kiszka@siemens.com>,
	"cip-dev@lists.cip-project.org" <cip-dev@lists.cip-project.org>
Subject: Re: [isar-cip-core][PATCH] start-qemu: allow more variable injections
Date: Mon, 23 Mar 2026 10:07:47 +0000	[thread overview]
Message-ID: <147befda-14e5-4d81-bd37-e8da6afa5830@siemens.com> (raw)
In-Reply-To: <ca460c60-093c-49f8-a4b8-11f93d784196@siemens.com>

On 3/21/26 15:43, Kiszka, Jan (FT RPD CED) wrote:
> On 20.03.26 11:10, Benedikt Niedermayr wrote:
>> This allows to inject specific variables into the script so a local kas
>> menu run isn't mandatory anymore and thus it could be reused in
>> different environments by adjusting related environment variables only.
>>
>> Currently the script parses the .config.yaml which is only available
>> after running kas menu locally. In cases the isar-cip-core is included into
>> custom layers where it mostly happens that the kas menu of the
>> including custom layer is called rather than kas menu of isar-cip-core,
>> (in some cases the including custom layer doesn't use kas menu at all)
>> one might still want to reuse the start-qemu.sh script.
>>
>> This patch specifically allows to inject the BASE_DIR and FTPM_STMM variables
>> via environment variables from now on.
>>
> 
> Did you check what is left afterwards? Would be good the solve things
> completely, rather then adding another layer on top later on.

Just created a v2. IMAGE_DATA_ENCRYPTION was still extracted from 
.config.yaml only.

> 
> Please also document the variables under usage().
> 
>> Signed-off-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
>> ---
>>   start-qemu.sh | 11 ++++++++---
>>   1 file changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/start-qemu.sh b/start-qemu.sh
>> index 7ccbefeb5f47..5a0924257b37 100755
>> --- a/start-qemu.sh
>> +++ b/start-qemu.sh
>> @@ -80,8 +80,12 @@ else
>>   	fi
>>   fi
>>   
>> +if grep -s -q "FTPM_STMM: true" .config.yaml; then
>> +	FTPM_STMM="true"
>> +fi
>> +
>>   if grep -s -q "IMAGE_DATA_ENCRYPTION: true" .config.yaml && \
>> -   ! grep -s -q "FTPM_STMM: true" .config.yaml; then
>> +   [ -z "${FTPM_STMM}" ] ; then
>>   	case "${arch}" in
>>   		x86|x86_64|amd64)
>>   			TPM2_DEVICE="tpm-tis"
>> @@ -124,7 +128,7 @@ case "${arch}" in
>>   			-device virtio-serial-device \
>>   			-device virtconsole,chardev=con -chardev vc,id=con \
>>   			-device virtio-net-device,netdev=net"
>> -		if grep -s -q "FTPM_STMM: true" .config.yaml; then
>> +		if [ -n "${FTPM_STMM}" ]; then
>>   			QEMU_EXTRA_ARGS="${QEMU_EXTRA_ARGS} \
>>   				-machine virt,secure=on \
>>   				-device sdhci-pci -device emmc,drive=disk,rpmb-partition-size=2097152 \
>> @@ -175,7 +179,8 @@ case "${arch}" in
>>   		;;
>>   esac
>>   
>> -BASE_DIR=$(readlink -f $(dirname $0))
>> +BASE_DIR_DEFAULT=$(readlink -f $(dirname $0))
>> +BASE_DIR=${BASE_DIR:-$BASE_DIR_DEFAULT}
>>   IMAGE_PREFIX="${BASE_DIR}/build/tmp/deploy/images/qemu-${QEMU_ARCH}/${TARGET_IMAGE}-cip-core-${DISTRO_RELEASE}-qemu-${QEMU_ARCH}${TEST_IMAGE}"
>>   
>>   if [ -z "${DISPLAY}" ]; then
> 
> Wouldn't it make more sense to export IMAGE_PREFIX? A downstream layer
> may have a completely different image name.

Yes makes this script even more robust. just posted a v2.

Thanks!
Benedikt

> 
> Jan
> 


      reply	other threads:[~2026-03-23 10:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 10:10 [isar-cip-core][PATCH] start-qemu: allow more variable injections Benedikt Niedermayr
2026-03-21 14:43 ` Jan Kiszka
2026-03-23 10:07   ` Niedermayr, Benedikt (FT RPD CED OES-DE) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=147befda-14e5-4d81-bd37-e8da6afa5830@siemens.com \
    --to=benedikt.niedermayr@siemens.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox