From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 20 Oct 2023 10:29:03 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) 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 1qtksR-00FJq0-Re for lore@lore.pengutronix.de; Fri, 20 Oct 2023 10:29:03 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qtksQ-00024q-Je; Fri, 20 Oct 2023 10:29:02 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtksJ-00024c-7c; Fri, 20 Oct 2023 10:28:55 +0200 Received: from [2a0a:edc0:2:b01:1d::c0] (helo=ptx.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtksI-002z1a-Rc; Fri, 20 Oct 2023 10:28:54 +0200 Received: from rsc by ptx.whiteo.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1qtksI-00FPhF-PD; Fri, 20 Oct 2023 10:28:54 +0200 Date: Fri, 20 Oct 2023 10:28:54 +0200 From: Robert Schwebel To: Michael Grzeschik Message-ID: <20231020082854.GZ3184561@pengutronix.de> References: <20230621224609.932551-1-m.grzeschik@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230621224609.932551-1-m.grzeschik@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [DistroKit] [RFC] x86_64: run: add 9p tcp based rootfs 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: , Cc: distrokit@pengutronix.de 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Applied to next On Thu, Jun 22, 2023 at 12:46:10AM +0200, Michael Grzeschik wrote: > Since there is no diod server ptxdist host tool available yet, this > script starts the version from debian. > > It is also to be found how to best start the server. > For now this simple script works as proof of concept including > ugly hacks to run and stop diod around the qemu exec. > > Signed-off-by: Michael Grzeschik > --- > configs/platform-x86_64/run | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/configs/platform-x86_64/run b/configs/platform-x86_64/run > index 96322292..cd726021 100755 > --- a/configs/platform-x86_64/run > +++ b/configs/platform-x86_64/run > @@ -118,6 +118,31 @@ run_qemu_9p() { > -append "root=/dev/root rw rootfstype=9p rootflags=trans=virtio ${BASE_CMDLINE}" > } > > +# 9p net port > +P9_ROOTFS_PORT=99999 > + > +run_qemu_9pnet() { > + ROOTPATH=$(realpath ${PTXDIST_PLATFORMDIR}/root) > + # the emulator to run > + DIOD_EXEC="/sbin/diod" > + > + if [ ! -e "${DIOD_EXEC}" ]; then > + echo "error: apt-get install 'diod' first" > + exit 1 > + fi > + > + ${DIOD_EXEC} -f -n -S -l 127.0.0.1:${P9_ROOTFS_PORT} -e ${ROOTPATH} & > + # this is an ugly workaround so diod will be closed after qemu has stopped > + DIOD_PID=$(echo $!) > + (tail --pid $$ -f /dev/null; kill ${DIOD_PID}) & > + > + exec ${QEMU_EXEC} \ > + "${QEMU_ARGS[@]}" \ > + "${QEMU_EXTRA_ARGS[@]}" \ > + "${QEMU_LINUX_ARGS[@]}" \ > + -append "ip=dhcp root=10.0.2.2 rw rootfstype=9p rootflags=trans=tcp,version=9p2000.L,aname=${ROOTPATH},port=${P9_ROOTFS_PORT} ${BASE_CMDLINE} ${EXTRA_CMDLINE}" > +} > + > target="${1:-9p}" > > #set -x > -- > 2.39.2 > > > -- Pengutronix e.K. | Dipl.-Ing. Robert Schwebel | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |