From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7348708478702059520 Date: Thu, 21 Mar 2024 05:27:27 -0700 (PDT) From: Badrikesh Prusty To: isar-users Message-Id: <253ce6fe-ba23-4e82-b845-c597d3c6d888n@googlegroups.com> In-Reply-To: <20240321070119.2973182-1-badrikesh_prusty@mentor.com> References: <20240321070119.2973182-1-badrikesh_prusty@mentor.com> Subject: Re: [PATCH] scripts/start_vm: enclose -append args in quotes and use eval MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_62108_1038112652.1711024047948" X-TUID: JFaOMBPShFOk ------=_Part_62108_1038112652.1711024047948 Content-Type: multipart/alternative; boundary="----=_Part_62109_999392306.1711024047948" ------=_Part_62109_999392306.1711024047948 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello all, Tested the changes with qemu machines: - qemuamd64 - qemuarm64 - qemuarm Machines are booting fine using start_vm command. Request to review the above change. Thanks, Badrikesh On Thursday, March 21, 2024 at 12:32:05=E2=80=AFPM UTC+5:30 Badrikesh Prust= y wrote: > From: Badrikesh Prusty > > - Observing boot failure of qemuarm64 with error message: > 'root=3D/dev/vda': No such file or directory > - Fix syntax for providing -append arguments with qemu-system-* command > - The -append arguments must be enclosed in quotes > - Use eval to execute qemu-system-* command > - Fix consistency with use of spaces instead of tabs > > Signed-off-by: Badrikesh Prusty > --- > scripts/start_vm | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/scripts/start_vm b/scripts/start_vm > index 8c696a4a..e9f13dc0 100755 > --- a/scripts/start_vm > +++ b/scripts/start_vm > @@ -19,18 +19,18 @@ bb2sh() { > start_qemu() { > root=3D`echo $QEMU_DISK_ARGS \ > | sed 's,##ROOTFS_IMAGE##,'$IMAGE_DIR/$ROOTFS_IMAGE','` > - [ -n "$KARGS$EXTRA_KARGS" ] && OPT_KERNEL_ARGS=3D"-append=20 > $KARGS$EXTRA_KARGS" > + [ -n "$KARGS$EXTRA_KARGS" ] && OPT_KERNEL_ARGS=3D"-append=20 > '$KARGS$EXTRA_KARGS'" > local had_x > echo $- | grep -q x && had_x=3D1 || had_x=3D0 > [ $had_x -eq 0 ] && set -x > - qemu-system-$QEMU_ARCH \ > - -m 1024M \ > - -M $QEMU_MACHINE \ > - $QCPU \ > - -nographic \ > - $EXTRA_ARGS \ > - $OPT_KERNEL_ARGS \ > - $root > + eval qemu-system-$QEMU_ARCH \ > + -m 1024M \ > + -M $QEMU_MACHINE \ > + $QCPU \ > + -nographic \ > + $EXTRA_ARGS \ > + $OPT_KERNEL_ARGS \ > + $root > [ $had_x -eq 0 ] && set +x > } > > --=20 > 2.39.2 > > ------=_Part_62109_999392306.1711024047948 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello all,

Tested the changes with qemu machines:
- qemuamd64
- qemuarm64
- qemuarm

Machines are booting fine using start_vm command.

Request to review the above change.

Tha= nks,
Badrikesh

<= div dir=3D"auto" class=3D"gmail_attr">On Thursday, March 21, 2024 at 12:32:= 05=E2=80=AFPM UTC+5:30 Badrikesh Prusty wrote:
From: Badrikesh Prusty <badrikes...@siemens.com>

- Observing boot failure of qemuarm64 with error message:
'root=3D/dev/vda': No such file or directory
- Fix syntax for providing -append arguments with qemu-system-* command
- The -append arguments must be enclosed in quotes
- Use eval to execute qemu-system-* command
- Fix consistency with use of spaces instead of tabs

Signed-off-by: Badrikesh Prusty <badrikes...@siemens.com>
---
scripts/start_vm | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/scripts/start_vm b/scripts/start_vm
index 8c696a4a..e9f13dc0 100755
--- a/scripts/start_vm
+++ b/scripts/start_vm
@@ -19,18 +19,18 @@ bb2sh() {
start_qemu() {
root=3D`echo $QEMU_DISK_ARGS \
| sed 's,##ROOTFS_IMAGE##,'$IMAGE_DIR/$ROOTFS_IMAGE= 9;,'`
- [ -n "$KARGS$EXTRA_KARGS" ] && OPT_KERNEL_ARGS= =3D"-append $KARGS$EXTRA_KARGS"
+ [ -n "$KARGS$EXTRA_KARGS" ] && OPT_KERNEL_ARGS= =3D"-append '$KARGS$EXTRA_KARGS'"
local had_x
echo $- | grep -q x && had_x=3D1 || had_x=3D0
[ $had_x -eq 0 ] && set -x
- qemu-system-$QEMU_ARCH \
-=09-m 1024M \
-=09-M $QEMU_MACHINE \
-=09$QCPU \
-=09-nographic \
-=09$EXTRA_ARGS \
- $OPT_KERNEL_ARGS \
-=09$root
+ eval qemu-system-$QEMU_ARCH \
+ -m 1024M \
+ -M $QEMU_MACHINE \
+ $QCPU \
+ -nographic \
+ $EXTRA_ARGS \
+ $OPT_KERNEL_ARGS \
+ $root
[ $had_x -eq 0 ] && set +x
}
=20
--=20
2.39.2

------=_Part_62109_999392306.1711024047948-- ------=_Part_62108_1038112652.1711024047948--