DistroKit Mailinglist
 help / color / mirror / Atom feed
From: Robert Schwebel <r.schwebel@pengutronix.de>
To: Michael Grzeschik <m.grzeschik@pengutronix.de>
Cc: distrokit@pengutronix.de
Subject: Re: [DistroKit] [RFC] x86_64: run: add 9p tcp based rootfs support
Date: Fri, 20 Oct 2023 10:28:54 +0200	[thread overview]
Message-ID: <20231020082854.GZ3184561@pengutronix.de> (raw)
In-Reply-To: <20230621224609.932551-1-m.grzeschik@pengutronix.de>

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 <m.grzeschik@pengutronix.de>
> ---
>  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    |



      reply	other threads:[~2023-10-20  8:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21 22:46 Michael Grzeschik
2023-10-20  8:28 ` Robert Schwebel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231020082854.GZ3184561@pengutronix.de \
    --to=r.schwebel@pengutronix.de \
    --cc=distrokit@pengutronix.de \
    --cc=m.grzeschik@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox