public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: kdevops@lists.linux.dev
Cc: Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH 2/3] scripts/bringup_guestfs.sh: allow libvirt user to modify extra disks
Date: Mon,  4 Mar 2024 16:56:43 -0800	[thread overview]
Message-ID: <20240305005645.2697081-3-mcgrof@kernel.org> (raw)
In-Reply-To: <20240305005645.2697081-1-mcgrof@kernel.org>

When a system session is used libvirt runs as a privileged user, not
the user, and so the user needs to be able to modify the user's files.
The directory already should have the correct permissions, but no the
files. Fix those.

This let's us start guestfs guests on debian.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 scripts/bringup_guestfs.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh
index 19e636fc64f3..58e5e3d2a018 100755
--- a/scripts/bringup_guestfs.sh
+++ b/scripts/bringup_guestfs.sh
@@ -114,6 +114,9 @@ do
 		diskimg="$STORAGEDIR/$name/extra${i}.${IMG_FMT}"
 		rm -f $diskimg
 		qemu-img create -f $IMG_FMT "$STORAGEDIR/$name/extra${i}.$IMG_FMT" 100G
+		if [[ "$CONFIG_LIBVIRT_URI_SYSTEM" == "y" ]]; then
+			chmod g+rw $STORAGEDIR/$name/extra${i}.$IMG_FMT
+		fi
 	done
 
 	virsh define $GUESTFSDIR/$name/$name.xml
-- 
2.43.0


  parent reply	other threads:[~2024-03-05  0:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05  0:56 [PATCH 0/3] kdevops: add debian support Luis Chamberlain
2024-03-05  0:56 ` [PATCH 1/3] scripts/bringup_guestfs.sh: start networking for system session Luis Chamberlain
2024-03-05  0:56 ` Luis Chamberlain [this message]
2024-03-05  0:56 ` [PATCH 3/3] guestfs: add debian guest support Luis Chamberlain
2024-03-06  0:12 ` [PATCH 0/3] kdevops: add debian support Luis Chamberlain

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=20240305005645.2697081-3-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=kdevops@lists.linux.dev \
    /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