From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 22 Jun 2023 00:47:17 +0200 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 1qC6be-00GE9s-Dc for lore@lore.pengutronix.de; Thu, 22 Jun 2023 00:47:17 +0200 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 1qC6bb-0003XN-N5; Thu, 22 Jun 2023 00:47:15 +0200 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 1qC6bQ-0003XF-Nc for distrokit@pengutronix.de; Thu, 22 Jun 2023 00:47:04 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qC6bQ-0098c5-2w for distrokit@pengutronix.de; Thu, 22 Jun 2023 00:47:04 +0200 Received: from mgr by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qC6bP-003uxA-Gq for distrokit@pengutronix.de; Thu, 22 Jun 2023 00:47:03 +0200 From: Michael Grzeschik To: distrokit@pengutronix.de Date: Thu, 22 Jun 2023 00:46:10 +0200 Message-Id: <20230621224609.932551-1-m.grzeschik@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [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: , 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 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