From: "Jan Lübbe" <jlu@pengutronix.de>
To: Michael Grzeschik <m.grzeschik@pengutronix.de>, distrokit@pengutronix.de
Subject: Re: [DistroKit] [PATCH] x86_64: run: add 9p support
Date: Tue, 31 Jan 2023 07:50:40 +0100 [thread overview]
Message-ID: <58a8bd3808670b3c84573b404992a60371c3e5b7.camel@pengutronix.de> (raw)
In-Reply-To: <20230130220323.408947-1-m.grzeschik@pengutronix.de>
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
>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
> configs/platform-x86_64/run | 23 ++++++++++++++++++++++-
> 1 file changed, 22 insertions(+), 1 deletion(-)
>
> 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
>
> BASE_CMDLINE="console=ttyS0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto"
>
> +if [ -d "${PTXDIST_PLATFORMDIR}/root/.virtfs_metadata" ]; then
> + security_model="mapped-file"
> +else
> + security_model="none"
> +fi
> +
> # Machine to emulate
> QEMU_ARGS=( -L ${PTXDIST_PLATFORMDIR}/sysroot-host/share/qemu/ -machine 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=/dev/vda console=ttyS0,115200 rw ${BASE_CMDLINE}"
> }
>
> -target="${1:-hda}"
> +#
> +# This needs:
> +# CONFIG_NET_9P_VIRTIO=y
> +# CONFIG_9P_FS=y
> +#
> +run_qemu_9p() {
> + exec ${QEMU_EXEC} \
> + "${QEMU_ARGS[@]}" \
> + -fsdev local,id=rootfs,path=${PTXDIST_PLATFORMDIR}/root,security_model="${security_model}" \
> + -device virtio-9p-pci,fsdev=rootfs,mount_tag=/dev/root \
> + "${QEMU_EXTRA_ARGS[@]}" \
> + "${QEMU_LINUX_ARGS[@]}" \
> + -append "root=/dev/root rw rootfstype=9p rootflags=trans=virtio ${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="${1:-9p}"
>
> #set -x
> run_qemu_${target}
--
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 |
next prev parent reply other threads:[~2023-01-31 6:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 22:03 Michael Grzeschik
2023-01-31 6:50 ` Jan Lübbe [this message]
2023-03-01 15:55 ` Robert Schwebel
2023-03-01 19:24 ` Michael Grzeschik
2023-03-02 7:48 ` Jan Lübbe
2023-03-02 8:06 ` [DistroKit] [PATCH v2] " Michael Grzeschik
2023-03-24 23:39 ` Michael Grzeschik
2023-03-25 6:24 ` Robert Schwebel
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=58a8bd3808670b3c84573b404992a60371c3e5b7.camel@pengutronix.de \
--to=jlu@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