summaryrefslogtreecommitdiffstats
path: root/configs/platform-v7a/run
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2020-04-09 09:37:31 +0200
committerRobert Schwebel <r.schwebel@pengutronix.de>2020-04-09 09:55:03 +0200
commitcb61169a5f30fa41dc20e75e62838da96aa528e6 (patch)
tree4a7be0f3798f15da5728436c9aa85127f71805d6 /configs/platform-v7a/run
parent7ec5eba7a929dacb8f178c5b88f5791fba6067a5 (diff)
downloadDistroKit-cb61169a5f30fa41dc20e75e62838da96aa528e6.tar.gz
DistroKit-cb61169a5f30fa41dc20e75e62838da96aa528e6.tar.xz
platform-v7a: run: use security_model=mapped-file when possible
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>
Diffstat (limited to 'configs/platform-v7a/run')
-rwxr-xr-xconfigs/platform-v7a/run12
1 files changed, 9 insertions, 3 deletions
diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
index 3a65c43..1dc4fd6 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 \