mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Michael Olbrich <m.olbrich@pengutronix.de>
Subject: [ptxdist] [PATCH 2/2] platform-v7a: run: use security_model=mapped-file when possible
Date: Thu,  9 Apr 2020 09:35:33 +0200	[thread overview]
Message-ID: <20200409073533.30522-3-m.olbrich@pengutronix.de> (raw)
In-Reply-To: <20200409073533.30522-1-m.olbrich@pengutronix.de>

PTXdist can now provide the necessary metadata files for
security_model=mapped-file. With this enabled, the rootfs on 9p has the
correct ownership and permissions.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 configs/platform-v7a/run | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
index 3a65c43da7be..1dc4fd645d88 100755
--- a/configs/platform-v7a/run
+++ b/configs/platform-v7a/run
@@ -67,6 +67,12 @@ fi
 
 BASE_CMDLINE="console=ttyAMA0,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=( -machine vexpress-a9 -cpu cortex-a9 -smp 4 -m 1024M )
 # disable graphics output
@@ -122,7 +128,7 @@ check_flash() {
 run_qemu_9p() {
 	exec ${QEMU_EXEC} \
 		"${QEMU_ARGS[@]}" \
-		-fsdev local,id=rootfs,path=${PTXDIST_PLATFORMDIR}/root,security_model=none \
+		-fsdev local,id=rootfs,path=${PTXDIST_PLATFORMDIR}/root,security_model="${security_model}" \
 		-device virtio-9p-device,fsdev=rootfs,mount_tag=/dev/root \
 		"${QEMU_EXTRA_ARGS[@]}" \
 		"${QEMU_LINUX_ARGS[@]}" \
@@ -164,9 +170,9 @@ run_qemu_barebox() {
 	exec ${QEMU_EXEC} \
 		"${QEMU_ARGS[@]}" \
 		-smp 1 \
-		-fsdev local,id=rootfs,path=${PTXDIST_PLATFORMDIR}/root,security_model=none \
+		-fsdev local,id=rootfs,path=${PTXDIST_PLATFORMDIR}/root,security_model="${security_model}" \
 		-device virtio-9p-device,fsdev=rootfs,mount_tag=/dev/root \
-		-fsdev local,id=images,path=${PTXDIST_PLATFORMDIR}/images,security_model=none \
+		-fsdev local,id=images,path=${PTXDIST_PLATFORMDIR}/images,security_model="${security_model}" \
 		-device virtio-9p-device,fsdev=images,mount_tag=/dev/images \
 		-drive if=sd,format=raw,file=${PTXDIST_PLATFORMDIR}/images/vexpress.hdimg,id=mmc0 \
 		-drive if=pflash,format=raw,file=${PTXDIST_PLATFORMDIR}/images/vexpress.norimg,id=nor0 \
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  parent reply	other threads:[~2020-04-09  7:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09  7:35 [ptxdist] [PATCH 0/2] Prepare for PTXdist 2020.04.0 Michael Olbrich
2020-04-09  7:35 ` [ptxdist] [PATCH 1/2] ptxd_make_nfsd_exec: sync with upstream Michael Olbrich
2020-04-09  7:35 ` Michael Olbrich [this message]
2020-04-09  7:36 ` [ptxdist] [PATCH 0/2] Prepare for PTXdist 2020.04.0 Michael Olbrich

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=20200409073533.30522-3-m.olbrich@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@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