From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 31 Jan 2023 07:50:50 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pMkTk-008XgS-Cz for lore@lore.pengutronix.de; Tue, 31 Jan 2023 07:50:50 +0100 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pMkTh-0004gX-IU; Tue, 31 Jan 2023 07:50:49 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pMkTa-0004gA-GQ; Tue, 31 Jan 2023 07:50:42 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pMkTa-001dDV-QV; Tue, 31 Jan 2023 07:50:41 +0100 Received: from localhost ([127.0.0.1]) by ptz.office.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pMkTZ-00HG0C-4a; Tue, 31 Jan 2023 07:50:41 +0100 Message-ID: <58a8bd3808670b3c84573b404992a60371c3e5b7.camel@pengutronix.de> From: Jan =?ISO-8859-1?Q?L=FCbbe?= To: Michael Grzeschik , distrokit@pengutronix.de Date: Tue, 31 Jan 2023 07:50:40 +0100 In-Reply-To: <20230130220323.408947-1-m.grzeschik@pengutronix.de> References: <20230130220323.408947-1-m.grzeschik@pengutronix.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.3 (by Flathub.org) MIME-Version: 1.0 Subject: Re: [DistroKit] [PATCH] x86_64: run: add 9p support X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false On Mon, 2023-01-30 at 23:03 +0100, Michael Grzeschik wrote: > copy the qemu 9p rule from platform v7a and make 9p the default >=20 > Signed-off-by: Michael Grzeschik > --- > configs/platform-x86_64/run | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) >=20 > diff --git a/configs/platform-x86_64/run b/configs/platform-x86_64/run > index c39d5a7b..96322292 100755 > --- a/configs/platform-x86_64/run > +++ b/configs/platform-x86_64/run > @@ -67,6 +67,12 @@ fi > =20 > BASE_CMDLINE=3D"console=3DttyS0,115200 loglevel=3D5 systemd.log_level=3D= warning systemd.show_status=3Dauto" > =20 > +if [ -d "${PTXDIST_PLATFORMDIR}/root/.virtfs_metadata" ]; then > + security_model=3D"mapped-file" > +else > + security_model=3D"none" > +fi > + > # Machine to emulate > QEMU_ARGS=3D( -L ${PTXDIST_PLATFORMDIR}/sysroot-host/share/qemu/ -machin= e pc-q35-2.12 -smp 2 -cpu host -accel kvm -m 1G -s ) > # disable graphics output > @@ -97,7 +103,22 @@ run_qemu_hda() { > -append "root=3D/dev/vda console=3DttyS0,115200 rw ${BASE_CMDLINE}" > } > =20 > -target=3D"${1:-hda}" > +# > +# This needs: > +# CONFIG_NET_9P_VIRTIO=3Dy > +# CONFIG_9P_FS=3Dy > +# > +run_qemu_9p() { > + exec ${QEMU_EXEC} \ > + "${QEMU_ARGS[@]}" \ > + -fsdev local,id=3Drootfs,path=3D${PTXDIST_PLATFORMDIR}/root,security_m= odel=3D"${security_model}" \ > + -device virtio-9p-pci,fsdev=3Drootfs,mount_tag=3D/dev/root \ > + "${QEMU_EXTRA_ARGS[@]}" \ > + "${QEMU_LINUX_ARGS[@]}" \ > + -append "root=3D/dev/root rw rootfstype=3D9p rootflags=3Dtrans=3Dvirti= o ${BASE_CMDLINE}" You should set msize explicitly do make it less likely that some userspace = tools are confused by short reads from 9pfs (nginx for example). Jan > +} > + > +target=3D"${1:-9p}" > =20 > #set -x > run_qemu_${target} --=20 Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |