From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 58125202E1; Thu, 13 Nov 2025 16:56:19 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id E255520313; Thu, 13 Nov 2025 16:56:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fout-a2-smtp.messagingengine.com (fout-a2-smtp.messagingengine.com [103.168.172.145]) by atuin.qyliss.net (Postfix) with ESMTPS id 59E5A20311 for ; Thu, 13 Nov 2025 16:56:15 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 27445EC01DD; Thu, 13 Nov 2025 11:56:14 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Thu, 13 Nov 2025 11:56:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1763052974; x=1763139374; bh=1qbPXvhbbt CJXAExkmDojOLHh8fT6Ic6A+53iU+UIaw=; b=P40uBPZcPyuwhVjwTN0eM8FJpw WY9hf5ab9x8PxuAsFUvdu45cOgm5cRsHyKG2aZ09P/a2jxo0Z4LW5xdaCu4xnbNh EtnEFsQIoaDs/LQ1iAUa8hUit8pvx49tSqtSJ7ND+VHG2MZkn01ERMvCXOL2wcbn Q29ucxlvtI19OfKFySJj2VslvNtS8L1KaM1HF6iFa5BOGMoIWPxfVG/5/A5UTB4V bnPK0cQH79CuUGoaENK7D+8mg3m1A9bOuisMGG/g6NlOSBKiWzUax/KwGy8Msj5U /nhnzV6krLdbfMtyxc9de98m3MikKYIETURt6IHM3i1kRxvbCBjixXuGc3Zg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1763052974; x=1763139374; bh=1qbPXvhbbtCJXAExkmDojOLHh8fT6Ic6A+5 3iU+UIaw=; b=DmvUeJ6+8VtJH11H41NYxe6lHVm3gIDxVpeV4yAgbi3tp+MppYs DWC2M8jnriwYhhuVqNtoZGlpOJBefN3Ku6iuEpRV7pOMz+OIO58bSrvfLdCrNwtz nGSVY3pSKaU8vVJGbilPPrEN/whAgCTv729QvdTROc3QXefEBE+r9hBY4T7bw3j9 C0JBQ9ZxYIvuz3e1ECHA2TqtnCiHBY8zrWJIFjYnbpVhgWUn72mNEcU3Q9SPxmiE PESYJ8Viu7ED0DZPmYi7R69BUED8wlMCaL06oxeKVf0EEBSpm9D/AHpGZSHfTTI1 wOVwWhATXXyU3JhfTd8BGLbsjLB+JYteaLg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvtdejgeekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefujghffffkgggtsehgtderredttdejnecuhfhrohhmpeetlhihshhsrgcu tfhoshhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpeffvdelhf euhedvudfhieejfeegkeduffeghfehgeejvdekgedtvddujedtgfelvdenucffohhmrghi nhepohhpvghnghhrohhuphdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehhihesrghlhihsshgrrdhishdpnhgspghrtghpthhtohep vddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepuggvmhhiohgsvghnohhurhesgh hmrghilhdrtghomhdprhgtphhtthhopeguvghvvghlsehsphgvtghtrhhumhdqohhsrdho rhhg X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 13 Nov 2025 11:56:13 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id B8157139D679; Thu, 13 Nov 2025 17:56:12 +0100 (CET) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH 1/4] scripts/run-qemu.sh: better error checks & formatting In-Reply-To: <57488ef1-722f-4e91-808c-c875fbc59a63@gmail.com> References: <20251107-simple-sh-quote-fix-v1-0-5f2d35260c4d@gmail.com> <20251107-simple-sh-quote-fix-v1-1-5f2d35260c4d@gmail.com> <87v7jeglzi.fsf@alyssa.is> <57488ef1-722f-4e91-808c-c875fbc59a63@gmail.com> Date: Thu, 13 Nov 2025 17:56:11 +0100 Message-ID: <87ms4pc1n8.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: 7B43SXVQNJY6EUX34EZORW3YKFGHHEYH X-Message-ID-Hash: 7B43SXVQNJY6EUX34EZORW3YKFGHHEYH X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Spectrum OS Development X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Demi Marie Obenour writes: > On 11/13/25 07:23, Alyssa Ross wrote: >> Demi Marie Obenour writes: >>=20 >>> No other functional change intended. >>> >>> Signed-off-by: Demi Marie Obenour >>> --- >>> scripts/run-qemu.sh | 24 ++++++++++++++---------- >>> 1 file changed, 14 insertions(+), 10 deletions(-) >>=20 >> This is a lot of changes all in one, without individual explanation. >> I'd appreciate it if they could be broken up and explained, because I'm >> going to have to ask what the purpose of each change is. >>=20 >>> diff --git a/scripts/run-qemu.sh b/scripts/run-qemu.sh >>> index 64fd29259ab108bc547cb7c74623ae9dc288b3b7..9c6c8193bbeba5916038c82= d8f76992051719c19 100755 >>> --- a/scripts/run-qemu.sh >>> +++ b/scripts/run-qemu.sh >>> @@ -1,11 +1,15 @@ >>> -#!/bin/sh -ue >>> +#!/bin/sh -- >>=20 >> The idea here is to be robust against the script being invoked with >> argv[0] set to "-c" or something? > > Correct. Seems a little paranoid but I suppose it doesn't hurt. I'd take a treewide change that did this for every /bin/sh shebang. >>> +if [ -n ${ARCH+test} ]; then >>> + ARCH=3D$(uname -m) >>> +fi >>>=20=20 >>> -case "${ARCH:=3D"$(uname -m)"}" in >>> +case $ARCH in >>> aarch64) >>> machine=3Dvirt,accel=3Dkvm:tcg,gic-version=3D3,iommu=3Dsmmuv3 >>> ;; >>=20 >> Why is this better? > > If uname exits with a non-zero status, the script will exit rather > than continuing. I see =E2=80=94 makes sense. And why is the check not just the following? if [ -z "${ARCH-}" ]; then >>> - set -- "$@" -append "${append:+$append }$1" >>> + set -- "$@" -append ${append:+"$append "}"$1" >>> i=3D$((i + 2)) >>> shift >>> continue >>=20 >> Don't understand this one. We've gone from one set of quotes to two >> sequential ones. > > I remember reading that the first version might not conform to POSIX. > I'm not sure if it matters though. POSIX says[1]: > If a parameter expansion occurs inside double-quotes: >=20 > * Pathname expansion shall not be performed on the results of the expansi= on. >=20 > * Field splitting shall not be performed on the results of the expansion. Seems desirable to me. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.h= tml#tag_18_06_02 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQGoGac7QfI+H5ZtFCZddwkt31pFQUCaRYNqwAKCRCZddwkt31p Ff5rAP4rThlWWlHnPoklxfZHMfXfXosGp5Rw8rJMZStMmWYqggEAs/Xo+rHYJT+R ik5G6MhW1PstO2qXlVKavfonO0/f4A0= =MgIU -----END PGP SIGNATURE----- --=-=-=--