public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 0/3] kdevops: add debian support
@ 2024-03-05  0:56 Luis Chamberlain
  2024-03-05  0:56 ` [PATCH 1/3] scripts/bringup_guestfs.sh: start networking for system session Luis Chamberlain
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Luis Chamberlain @ 2024-03-05  0:56 UTC (permalink / raw)
  To: kdevops; +Cc: Luis Chamberlain

This enables users on debian to start using guestfs, and also enables
debian to be used as a guest.

Luis Chamberlain (3):
  scripts/bringup_guestfs.sh: start networking for system session
  scripts/bringup_guestfs.sh: allow libvirt user to modify extra disks
  guestfs: add debian guest support

 kconfigs/Kconfig.bringup   | 42 +++++++++++++++++++++++++++++++++++++-
 kconfigs/Kconfig.kdevops   |  1 +
 scripts/bringup_guestfs.sh | 12 +++++++++++
 3 files changed, 54 insertions(+), 1 deletion(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] scripts/bringup_guestfs.sh: start networking for system session
  2024-03-05  0:56 [PATCH 0/3] kdevops: add debian support Luis Chamberlain
@ 2024-03-05  0:56 ` Luis Chamberlain
  2024-03-05  0:56 ` [PATCH 2/3] scripts/bringup_guestfs.sh: allow libvirt user to modify extra disks Luis Chamberlain
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Luis Chamberlain @ 2024-03-05  0:56 UTC (permalink / raw)
  To: kdevops; +Cc: Luis Chamberlain

When the system session is used we need to ensure we start the
default networking, otherwise we will get a complaint about
not finding mtu for virb0, or virb1, etc. Fix this by ensuring
that if the default networking is off, we start it.

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

diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh
index 34ad48cbe81f..19e636fc64f3 100755
--- a/scripts/bringup_guestfs.sh
+++ b/scripts/bringup_guestfs.sh
@@ -7,6 +7,15 @@ source ${TOPDIR}/scripts/lib.sh
 
 export LIBVIRT_DEFAULT_URI=$CONFIG_LIBVIRT_URI
 
+# On systems using system sesion, ensure that we start the default
+# libvirt network.
+if [[ "$CONFIG_LIBVIRT_URI_SYSTEM" == "y" ]]; then
+	 sudo virsh net-list | grep -q default
+	 if [[ $? -ne 0 ]]; then
+		 sudo virsh net-start default
+	 fi
+fi
+
 #
 # We use the NVMe setting for virtio too (go figure), but IDE
 # requires qcow2
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] scripts/bringup_guestfs.sh: allow libvirt user to modify extra disks
  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
  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
  3 siblings, 0 replies; 5+ messages in thread
From: Luis Chamberlain @ 2024-03-05  0:56 UTC (permalink / raw)
  To: kdevops; +Cc: Luis Chamberlain

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] guestfs: add debian guest support
  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 ` [PATCH 2/3] scripts/bringup_guestfs.sh: allow libvirt user to modify extra disks Luis Chamberlain
@ 2024-03-05  0:56 ` Luis Chamberlain
  2024-03-06  0:12 ` [PATCH 0/3] kdevops: add debian support Luis Chamberlain
  3 siblings, 0 replies; 5+ messages in thread
From: Luis Chamberlain @ 2024-03-05  0:56 UTC (permalink / raw)
  To: kdevops; +Cc: Luis Chamberlain

guestfs has only debian-12, no debian testing yet.
While at it, also set default fedora options for fstests
when the user tests a specific filesystem.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 kconfigs/Kconfig.bringup | 42 +++++++++++++++++++++++++++++++++++++++-
 kconfigs/Kconfig.kdevops |  1 +
 2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/kconfigs/Kconfig.bringup b/kconfigs/Kconfig.bringup
index 95991cc599f4..ba7b5430bcf9 100644
--- a/kconfigs/Kconfig.bringup
+++ b/kconfigs/Kconfig.bringup
@@ -58,14 +58,54 @@ config SKIP_BRINGUP
 endchoice
 
 if GUESTFS
+
+choice
+	prompt "Guestfs Linux distribution to use"
+	default GUESTFS_FEDORA
+
+config GUESTFS_FEDORA
+	bool "Fedora (or derived distro)"
+	select HAVE_DISTRO_XFS_PREFERS_MANUAL if FSTESTS_XFS
+	select HAVE_DISTRO_BTRFS_PREFERS_MANUAL if FSTESTS_BTRFS
+	select HAVE_DISTRO_EXT4_PREFERS_MANUAL if FSTESTS_EXT4
+	select HAVE_DISTRO_PREFERS_FSTESTS_WATCHDOG if KDEVOPS_WORKFLOW_ENABLE_FSTESTS
+	select HAVE_DISTRO_PREFERS_FSTESTS_WATCHDOG_KILL if KDEVOPS_WORKFLOW_ENABLE_FSTESTS
+	help
+	  This option will set the target guest to be a distro in the Fedora family.
+	  For example, Fedora, RHEL, etc.
+
+config GUESTFS_DEBIAN
+	bool "Debian"
+	select HAVE_CUSTOM_DISTRO_HOST_PREFIX
+	select HAVE_DISTRO_XFS_PREFERS_MANUAL if FSTESTS_XFS
+	select HAVE_DISTRO_BTRFS_PREFERS_MANUAL if FSTESTS_BTRFS
+	select HAVE_DISTRO_EXT4_PREFERS_MANUAL if FSTESTS_EXT4
+	select HAVE_DISTRO_PREFERS_CUSTOM_HOST_PREFIX
+	select HAVE_DISTRO_PREFERS_FSTESTS_WATCHDOG if KDEVOPS_WORKFLOW_ENABLE_FSTESTS
+	select HAVE_DISTRO_PREFERS_FSTESTS_WATCHDOG_KILL if KDEVOPS_WORKFLOW_ENABLE_FSTESTS
+	help
+	  This option will set the target guest to Debian.
+
+endchoice
+
 config VIRT_BUILDER_OS_VERSION
        string "virt-builder os-version"
-       default "fedora-39"
+       default "fedora-39" if GUESTFS_FEDORA
+       default "debian-12" if GUESTFS_DEBIAN
        help
          Have virt-builder use this os-version string to
          build a root image for the guest. Run "virt-builder -l"
          to get a list of operating systems and versions supported
          by guestfs.
+
+if GUESTFS_DEBIAN
+
+config GUESTFS_DEBIAN_BOX_SHORT
+        string
+        default "debian12" if GUESTFS_DEBIAN
+
+endif
+
 endif # GUESTFS
 
 config LIBVIRT
diff --git a/kconfigs/Kconfig.kdevops b/kconfigs/Kconfig.kdevops
index 53782f413a44..423619cf1443 100644
--- a/kconfigs/Kconfig.kdevops
+++ b/kconfigs/Kconfig.kdevops
@@ -28,6 +28,7 @@ config CUSTOM_DISTRO_HOST_PREFIX
 	default VAGRANT_DEBIAN_BOX_SHORT if VAGRANT_DEBIAN
 	default VAGRANT_OPENSUSE_BOX_SHORT if VAGRANT_OPENSUSE
 	default VAGRANT_REDHAT_GENERIC_BOX_SHORT if VAGRANT_REDHAT_GENERIC
+	default GUESTFS_DEBIAN_BOX_SHORT if GUESTFS_DEBIAN
 
 config CUSTOM_SSH_KEXALGORITHMS
 	string
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] kdevops: add debian support
  2024-03-05  0:56 [PATCH 0/3] kdevops: add debian support Luis Chamberlain
                   ` (2 preceding siblings ...)
  2024-03-05  0:56 ` [PATCH 3/3] guestfs: add debian guest support Luis Chamberlain
@ 2024-03-06  0:12 ` Luis Chamberlain
  3 siblings, 0 replies; 5+ messages in thread
From: Luis Chamberlain @ 2024-03-06  0:12 UTC (permalink / raw)
  To: kdevops

On Mon, Mar 04, 2024 at 04:56:41PM -0800, Luis Chamberlain wrote:
> This enables users on debian to start using guestfs, and also enables
> debian to be used as a guest.
> 
> Luis Chamberlain (3):
>   scripts/bringup_guestfs.sh: start networking for system session
>   scripts/bringup_guestfs.sh: allow libvirt user to modify extra disks
>   guestfs: add debian guest support

Alright, pushed.

  Luis

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-06  0:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/3] scripts/bringup_guestfs.sh: allow libvirt user to modify extra disks Luis Chamberlain
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox